Environment reviewers silently dropped when reviewer access is granted in the same sync
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github, javascript
- Domain
- backend
Research direction
Start in lib/settings.js at the updateRepos() paths linked in the issue, then trace how the teams and environments child plugins are scheduled. Check how the environments plugin sends its PUT and what tests cover a full sync. Done means one sync that grants a team's repo access also creates the environment with that team as a reviewer.
Written by the indexing model from the issue text.
Description
Problem Description
What is actually happening
A single config change that both grants a team repo access and names that team as an environment reviewer creates the environment without the reviewer. Example repo config:
teams:
- name: deployers
permission: maintain
environments:
- name: prod
reviewers:
- type: Team
id: 12345678 # deployers
updateRepos() runs every child plugin concurrently, so the environments plugin's PUT can land before the teams plugin grants access:
The no-repo-config branch has the same pattern:
GitHub's PUT /repos/{owner}/{repo}/environments/{environment_name} returns 200 for a reviewer that has no repo access, but it doesn't add the reviewer. The sync reports success, and the environment has no required reviewers until a later sync runs. Because nop mode doesn't render environment changes, the plan doesn't flag it either.
Debug log from the affected full sync, in order:
GitHub request: PUT https://api.github.com/repos/<org>/<repo>/environments/prod - 200
GitHub request: PUT https://api.github.com/orgs/<org>/teams/<team>/repos/<org>/<repo> - 204
What is the expected behavior
The environment is created with the configured reviewer in the same sync that grants the reviewer repo access.
Error output, if available
None. Every request returns 2xx.
Context
Are you using the hosted instance of probot/settings or running your own?
Running our own, via full-sync.js in GitHub Actions.
If running your own instance, are you using it with github.com or GitHub Enterprise?
github.com
Version of probot/settings
3.0.0, and the same code is on main-enterprise at e19444e0d69de050ba55d0262b71fcd8a98edfef
Version of GitHub Enterprise
- Dominant language
- JavaScript
- Stars
- 942
- Forks
- 238
- PR merge metrics
- No merged PRs in 30d
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github-community-projects/safe-settings
-
Teams: teams with organization-role access show up as deletionsPossibly taken @TovaBecker claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
github-community-projects/safe-settings#1144 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
github-community-projects/safe-settings#1143 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
github-community-projects/safe-settings#1135 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
github-community-projects/safe-settings#1134 ·
Maintainers usually reply within 2 days
-
environments: additive_plugins is ignored, undeclared environments are deletedPossibly taken @yaunj claimed this 12 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
github-community-projects/safe-settings#1133 ·
Maintainers usually reply within 2 days
All issues in github-community-projects/safe-settings
Similar issues
-
area:webapp bug finding
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
humlab-sead/sead_shape_shifter#779 ·
Maintainers usually reply within 1 day
-
enhancement feature/llm-analytics
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
PostHog/posthog#139959 · 1 comment ·
Maintainers usually reply within 1 day
-
ci good first issue priority:p1
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
mobeloper/better-oss#23 ·
-
accessibility Could Have good first issue seo
Difficulty 1/5 Under an hour Newbie friendliness 88/100
hannahro15/Musical-Match-Saga#278 ·
Maintainers usually reply within 1 day