Skip to content

NO-ISSUE: Assign osac-ci-bot, not a maintainer, to maintainers reviews - #288

Merged
eliorerz merged 6 commits into
osac-project:mainfrom
eliorerz:maintainers-no-delegation
Nov 2, 2026
Merged

eliorerz merged 6 commits into
osac-project:mainfrom
eliorerz:maintainers-no-delegation

Conversation

@eliorerz

@eliorerz eliorerz commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Changes how the maintainers team is assigned review requests, so that nobody is picked at random and nobody is broadcast to. This replaces the earlier content of this pull request (turning delegation off and the team notification setting do not do it: GitHub's docs say the notification setting "does not affect notifications for reviews requested from the team", as @sk-ilya pointed out).

What

CODEOWNERS sends every path no working group owns to @osac-project/maintainers, and any member of a working group may approve (members of the child teams count as members of maintainers). GitHub notifies every member of a team that is requested for review; the only switch is review assignment, which assigns members and notifies only them. So:

  • osac-ci-bot becomes the only direct member of maintainers (github_team_membership.maintainers_review_sink). It is already an organization member and in wg-infra. It approves nothing, and nothing waits for it.
  • Review assignment for maintainers: LOAD_BALANCE, one member, team not notified, and includeChildTeamMembers: false, so only direct members are eligible: it always picks the bot. A pull request lists maintainers and osac-ci-bot as reviewers; the bot's request stays pending.
  • The provider cannot set includeChildTeamMembers, so apply.yaml sets all of it with the GraphQL mutation updateTeamReviewAssignment after every apply (scheduled ones included). It is idempotent and puts the setting back if someone changes it by hand.
  • github_team_settings.maintainers (from NO-ISSUE: Assign one load-balanced maintainers reviewer #286) is forgotten with a removed block and destroy = false, so nothing is destroyed or switched off, and the apply step owns the setting.
  • The teams that own a folder (wg-infra, wg-vmaas, ...) are requested and notified as usual. The README explains the design.

Checked / not checked

  • Checked: the mutation exists and has includeChildTeamMembers (GitHub's schema), the enum and field types match the query, and the apply token already ran the same mutation through github_team_settings.
  • Not checked: that GitHub really assigns only direct members and keeps the team quiet with that flag. The setting cannot be read back, so the only check is a pull request after the first apply: its reviewers should be maintainers and osac-ci-bot, and no person should be notified. tofu fmt runs in CI only (no tofu where I wrote it).
  • Rollback: remove the apply step and the membership; set delegation off by hand.

Please review, @sk-ilya.

Summary

  • Team configuration: Adds github_team_membership.maintainers_review_sink, making osac-ci-bot a direct member of maintainers. Removes the old github_team_settings.maintainers resource from active management without destroying it.
  • CI and deployment: After TF Apply is not skipped, .github/workflows/apply.yaml checks for the maintainers team and the bot’s direct membership. If the team is missing, the step fails. If the bot is not a direct member, it warns and leaves the assignment unchanged. Otherwise, it runs updateTeamReviewAssignment with load balancing, one member, child-team members excluded, team notifications disabled, and the team request retained. It verifies the returned enabled, member-count, and notification settings. The step also runs after a failed apply unless the workflow is cancelled.
  • Documentation: Explains the intended review assignment and notification behavior, child-team approval eligibility, and unchanged review requests to folder-owning teams.
  • Other areas: No API, controller, database, authentication, or test changes are described in the supplied evidence.

Compatibility and verification

The change alters GitHub team review-assignment behavior and stops managing the previous provider resource without destroying its setting. The workflow cannot read back includeChildTeamMembers, so that value is not covered by its read-back check. The intended GitHub behavior remains unverified. No test results are available.

Risk classification

risk:ask — Applied provisionally because the intended assignment and notification behavior has not been verified. The risk-label criteria were not supplied, so this classification cannot be matched to documented criteria. risk:show may be a nearby alternative, but whether it qualifies cannot be determined without those criteria.

Turn review request delegation off for the maintainers team: any
member may approve, and GitHub must not pick one of them. The
resource keeps no review_request_delegation block, so every apply
keeps it off. Notifications are the team's notification setting,
which the provider cannot manage; the README says how it is set.

Signed-off-by: Elior Erez <eerez@redhat.com>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: abb2acbc-ef29-4280-af0c-c16e7d74faa2
Commits

Reviewing files that changed from the base of the PR and between 03fa52e and d7d5e73.

Files selected for processing: 1
  • .github/workflows/apply.yaml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

Walkthrough

The change adds osac-ci-bot as a direct member of maintainers. After Terraform apply, the workflow queries the team and configures review assignment settings through GraphQL. The README documents the team membership and assignment behavior.

Changes

Maintainers review assignment

Layer / File(s) Summary
Maintainer team configuration
teams.tf
Adds osac-ci-bot as a direct member of maintainers. Replaces the prior settings resource with a removed block configured not to destroy it.
Post-apply assignment configuration
.github/workflows/apply.yaml, README.md
After Terraform apply is not skipped and the workflow is not cancelled, the workflow queries the team and its direct members. It errors if the team is missing and warns without changing settings if the bot is not a direct member. Otherwise, it sets load-balanced assignment to one member, disables team-wide notifications and child-team inclusion, and checks the returned assignment settings. The README describes the assignment behavior and notes that folder-owning teams remain requested and notified.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant ApplyWorkflow
  participant GitHubGraphQL
  ApplyWorkflow->>GitHubGraphQL: Query maintainers team and direct members
  GitHubGraphQL-->>ApplyWorkflow: Return team and membership data
  ApplyWorkflow->>GitHubGraphQL: Set assignment fields if osac-ci-bot is a direct member
  GitHubGraphQL-->>ApplyWorkflow: Return mutation result
Loading

Suggested labels: risk:ask

Suggested reviewers: sk-ilya, larsks

Merge Risk: Moderate · up to 8f141

Bot-only assignment is not guaranteed, and malformed API data can silently skip configuration; resolve both before relying on this workflow.

Pre-merge checks: Passed 10 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Ai-Attribution Warning The PR uses an AI tool identified as CodeRabbit. All four commits in the reviewed range contain only a Signed-off-by trailer. None contains an Assisted-by: or Generated-by: trailer, and no Co-Authored… Add a Red Hat Assisted-by: or Generated-by: trailer naming CodeRabbit to each applicable commit. Do not add Co-Authored-By for the AI tool.
Passed Passed checks: 10 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: assigning osac-ci-bot to maintainers reviews instead of a maintainer.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets Passed No hardcoded secret is introduced. The changed workflow uses the generated GitHub App token via ${{ steps.generate-token.outputs.token }}, and the new literals are team names, GraphQL settings, and …
No-Weak-Crypto Passed The pull request adds no MD5, SHA1, DES, 3DES, RC4, Blowfish, or ECB usage, and no custom cryptography. The only token-related addition is passing GH_TOKEN to gh for GraphQL authentication; it is not …
No-Injection-Vectors Passed No configured injection vector is introduced. The new workflow uses fixed GraphQL queries, passes ORG and team_id as quoted gh arguments, and passes SINK to jq through --arg. No SQL concat…
Container-Privileges Passed The pull request changes only README.md, teams.tf, and a GitHub Actions workflow. The workflow uses runs-on: ubuntu-latest and adds no container or Kubernetes privilege settings. No changed code int…
No-Sensitive-Data-In-Logs Passed PASS: The pull request adds no sensitive-data logging. The GraphQL response containing the team ID and member logins is captured in answer and only queried locally. The only emitted values are fixed…
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Full details: No-Hardcoded-Secrets

Explanation

No hardcoded secret is introduced. The changed workflow uses the generated GitHub App token via ${{ steps.generate-token.outputs.token }}, and the new literals are team names, GraphQL settings, and the osac-ci-bot username. No API-key/token/password assignment, private-key material, embedded credentials, or qualifying long base64 string appears in the added lines.

Full details: No-Weak-Crypto

Explanation

The pull request adds no MD5, SHA1, DES, 3DES, RC4, Blowfish, or ECB usage, and no custom cryptography. The only token-related addition is passing GH_TOKEN to gh for GraphQL authentication; it is not compared or processed cryptographically. The jq index checks the public team-member login against osac-ci-bot, not a secret or token.

Full details: No-Injection-Vectors

Explanation

No configured injection vector is introduced. The new workflow uses fixed GraphQL queries, passes ORG and team_id as quoted gh arguments, and passes SINK to jq through --arg. No SQL concatenation, shell=True, eval/exec, unsafe YAML loading, pickle loading, os.system, or dangerouslySetInnerHTML appears in the changed code.

Full details: Container-Privileges

Explanation

The pull request changes only README.md, teams.tf, and a GitHub Actions workflow. The workflow uses runs-on: ubuntu-latest and adds no container or Kubernetes privilege settings. No changed code introduces privileged: true, host PID/network/IPC, SYS_ADMIN, allowPrivilegeEscalation: true, or root container execution.

Full details: No-Sensitive-Data-In-Logs

Explanation

PASS: The pull request adds no sensitive-data logging. The GraphQL response containing the team ID and member logins is captured in answer and only queried locally. The only emitted values are fixed warning/error text and the mutation's selected public team settings (slug, booleans, and member count). No token, password, API key, email, session ID, hostname, or customer data is printed.

Full details: Ai-Attribution

Explanation

The PR uses an AI tool identified as CodeRabbit. All four commits in the reviewed range contain only a Signed-off-by trailer. None contains an Assisted-by: or Generated-by: trailer, and no Co-Authored-By trailer is present.

Resolution

Add a Red Hat Assisted-by: or Generated-by: trailer naming CodeRabbit to each applicable commit. Do not add Co-Authored-By for the AI tool.

@coderabbitai coderabbitai Bot added the risk:ask label Nov 2, 2026

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread README.md Resolved
Comment thread teams.tf Resolved
The provider sets notification_setting on every apply and defaults it
to notifications_enabled, so a setting changed by hand is undone at
the next apply. State it as notifications_disabled in teams.tf, and
correct the README, which said the provider cannot manage it.

Signed-off-by: Elior Erez <eerez@redhat.com>

@sk-ilya sk-ilya left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? We'll get spammed again. #286 assigns a single random reviewer to each PR. If we revert it, everyone will start getting review-request notifications again.

Comment thread teams.tf Resolved
The notification setting of a team does not cover review requests,
so drop it. Make osac-ci-bot the only direct member of maintainers
and set review assignment after every apply (the provider cannot set
includeChildTeamMembers): it picks the bot, notifies only the bot,
and leaves the members of the working groups out. Any of them may
still approve. github_team_settings is forgotten, not destroyed.

Signed-off-by: Elior Erez <eerez@redhat.com>
@eliorerz eliorerz changed the title NO-ISSUE: Do not pick a maintainer for each pull request NO-ISSUE: Assign osac-ci-bot, not a maintainer, to maintainers reviews Nov 2, 2026

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread .github/workflows/apply.yaml Resolved
A broken resource elsewhere must not hold the maintainers review
assignment back, so the step runs after a failed apply too. It first
asks for the direct members of the team and does nothing unless
osac-ci-bot is one of them: with nobody eligible the assignment
would have no one to pick.

Signed-off-by: Elior Erez <eerez@redhat.com>
Read back what GitHub says it stored after the mutation (enabled, one
member, team not notified) and fail the run when it is not what was
asked, so a setting that did not take is not silent.

Signed-off-by: Elior Erez <eerez@redhat.com>

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread .github/workflows/apply.yaml Resolved
Only direct members of maintainers can be assigned, so any other
direct member would be picked for pull requests. The step now fails
when it finds one besides osac-ci-bot, and still leaves the assignment
alone when the bot is not a member (yet). The README says so.

Signed-off-by: Elior Erez <eerez@redhat.com>
@eliorerz
eliorerz merged commit d043bc7 into osac-project:main Nov 2, 2026
1 check passed
@eliorerz
eliorerz deleted the maintainers-no-delegation branch November 2, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants