Skip to content

ci(review): require code-owner approvals on gitlab merge requests - #6731

Draft
kajalj22 wants to merge 19 commits into
mainfrom
kajalj/codeowners-gitlab-enforce
Draft

kajalj22 wants to merge 19 commits into
mainfrom
kajalj/codeowners-gitlab-enforce

Conversation

@kajalj22

@kajalj22 kajalj22 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Why

#6168 makes the reviewer groups in .github/CODEOWNERS required on GitHub. Internal merge requests must keep the same rule: one approval from the owning team for every changed path. The shared review-pools adapter already mirrors # suggest: lines to GitLab as optional pools; this PR turns on its required mode so enforced lines are mirrored too. No separate issue; this is the GitLab half of #6168.

What changed

  • .gitlab/ci/review-pools-run.yml: pin the shared adapter to the revision that adds --require-codeowners (feat(review): require code-owner approvals on gitlab merge requests FW-CI-templates#632) and pass --require-codeowners --codeowners-fallback @nvidia-nemo/gym_maintainers. Each changed file's last matching enforced line becomes a github-codeowners: <owners> MR approval rule requiring one approval from the live members of those GitHub teams; on identity problems the MR stays gated by the maintainers and the job fails with the problems listed.
  • .gitlab/ci/review-pools.yml, review-pools-run.yml: allow_failure: false on all three review-pool jobs so a failed reconciliation is visible.
  • .gitlab/ci/README.md: document the required pools, the present adapter pin, and the limitation that MR-local rules can be edited until the next MR update restores them ("Prevent editing approval rules in merge requests" must stay disabled because it also blocks the adapter).
  • tests/unit_tests/tooling/test_review_pool_dispatch.py: assert allow_failure: false on all three jobs, the enforcement flags, and that the README pin matches the job pin.

Validation

  • pytest tests/unit_tests/tooling/test_review_pool_dispatch.py tests/unit_tests/tooling/test_review_policy.py — 9 passed, 11 subtests
  • pre-commit run --files <changed files> — passed
  • Shared adapter: 58 unit tests in feat(review): require code-owner approvals on gitlab merge requests FW-CI-templates#632 cover last-match owner groups, owner-less lines, one-approval rules, fallback, restored rules, and no-flag runs
  • Model rollouts: N/A, CI configuration only

Merge order

🤖 Generated with Claude Code

Run the shared review-pools adapter with --require-codeowners so the
enforced .github/CODEOWNERS lines on GitHub main also gate GitLab MRs
with one-approval rules from the same GitHub teams. Fall back to
gym_maintainers when identities cannot be resolved, and stop treating
review-pool job failures as advisory.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 325e95b

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review

@copy-pr-bot

copy-pr-bot Bot commented Nov 24, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added ci CI, automation, test queue, or workflow infrastructure work area:ci CI workflows, test routing, and repository automation risk:high Autobot PR risk: high labels Nov 24, 2026
Repin the adapter to the revision that scopes required pools to the flag,
drop the project-setting advice that would block the adapter's own writes,
describe the pin in the present tense, and assert allow_failure, the
enforcement flags and the pin on the child job template.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test a3b2aa9

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

…test

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 97b8018

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 18844f1

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 2c31fa3

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test cf09f99

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 1b4dbc4

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

SHIP WITH CARE

I reviewed all four changed files and their connected dispatcher, ownership policy and CI paths, with three delegated reviews. I found one RISK in the required-approval enforcement boundary and one non-blocking NOTE about the new test.

Validation: I ran CPU probes in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:54800b761ceea0f1b3b7d1a62b4008046207395b, a successful default-branch CI build; this head had no CI image. probe_dispatch_and_job.py passed 13 webhook cases and confirmed the actual enforcement arguments and exit-code propagation. Stubbed full-job probes confirmed fetch/setup failures stop before adapter execution and shell values remain literal. probe_routing.py confirmed that MR CPU CI and review-pool reconciliation run in separate pipelines. guard_probe.py reproduced the test false positive described inline. These scripts are under /workspace/review-probes/; I did not rerun the full CI suite.

CI reports Lint check and Unit tests / Sandbox tests successful. All four core shards and eight server-suite shards were still running at my final read, so I am not claiming their aggregate checks passed. The optional miniswe_sandboxed conformance check failed; it also failed at the admitted base, although I did not establish that both failures have the same cause.

The shared adapter repository was not admitted, so I did not fetch it. Its required-rule matching, identity fallback and live GitLab approval behavior remain unvalidated here; the local probes exercised Gym's invocation and failure boundaries, not real approval-rule writes.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

stage: report
needs: [gym-review-pools-prepare]
allow_failure: true
allow_failure: false

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.

RISK: Required-owner enforcement can fail open before the adapter writes.

allow_failure: false makes the protected-branch trigger pipeline red, but the review-pool rules select a different pipeline from MR CPU CI. There is no dependency between them. On a new MR, an install/fetch/credential failure can therefore leave a green MR pipeline with no required owner rule. The README explicitly confirms the missing rule and absence of a backstop. My routing probe confirmed the disjoint job sets, and a failing package-manager stub stopped the real child script before adapter execution.

The pipeline separation predates this PR, but it becomes an enforcement gap when these pools become required policy. Could you add a required reconciliation result bound to the MR's current SHA, or an equivalent provider-enforced backstop, so missing reconciliation blocks merge? Keep credentialed execution on trusted code rather than moving it into the untrusted MR job.

Acceptance: create an MR touching an enforced owner path, fail setup before the adapter runs, and verify it cannot merge even when CPU CI passes. After successful reconciliation, verify an eligible owner approval is still required. Repeat after a push so a stale reconciliation result cannot satisfy the requirement.

self.assertFalse(parent["gym-review-pools"]["allow_failure"])
self.assertFalse(child[".gym-review-pools"]["allow_failure"])
script = "\n".join(child[".gym-review-pools"]["script"])
self.assertIn("--require-codeowners", script)

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.

NOTE: Suggest checking the executed adapter arguments rather than searching the joined script.

These substring assertions can pass when the enforcement flags are not passed to the adapter. In guard_probe.py, I removed both flags from the invocation and left their text in a separate shell-comment entry. The new test still passed, while a recording fake adapter received neither flag. The current head does pass both flags correctly; this is a regression-coverage improvement, not a current enforcement failure.

Could you select/tokenize the adapter command, or execute it with a small recording fake, and check its argv? Keep the direct allow_failure assertions. Acceptance: the test passes on this head but fails when either flag is removed from the invocation, even if its text remains elsewhere, and checks the exact fallback value @nvidia-nemo/gym_maintainers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 5cc3afa

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

… text

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 4122bf2

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

SHIP WITH CARE

I reviewed all four changed files and their connected dispatch, ownership and CI paths, with three delegated reviews. The prior enforcement RISK is unchanged. The prior shell-comment test NOTE is fixed: the previous guard accepted comment-only flags, while the current guard rejects them. No additional findings.

Validation: I used 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:cdf2a680f265977c26a8906d136c801c701a5ffa, the successful base-branch CI image; this head had no successful image-build check. Local probes passed three routing contexts, 12 shell/failure cases and 20 test-oracle cases. They confirmed the enforcement arguments and failure propagation, reproduced setup stopping before adapter execution, and verified the test repair against the previous-review revision. I did not rerun the full CI suite.

CI: Nemo_CICD_Test, lint, both component-lock jobs, all four core shards, combined coverage, sandbox tests, LongMT scoring and all eight server-suite shards passed on this head. The core-shard-3 log confirms all six dispatcher tests passed. Changed-server tests and session-routing end-to-end were skipped, not passed. The non-blocking miniswe_sandboxed and openclaw conformance jobs failed at their five-minute validation-step limit; their failures do not feed the required aggregate.

The shared adapter repository was not admitted, so I did not fetch it. Its implementation, real approval-rule writes and live GitLab mergeability are unvalidated here. The probes exercised Gym's invocation and failure boundaries with fakes. GitLab expanded CI lint was not run.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

stage: report
needs: [gym-review-pools-prepare]
allow_failure: true
allow_failure: false

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.

RISK: Required-owner enforcement can still fail open before the adapter writes.

This is unchanged from the prior review. allow_failure: false propagates failure within the protected-branch trigger pipeline, but the review-pool predicates select a different pipeline from MR CPU CI, with no reconciliation dependency between them. The README confirms that a pre-write failure leaves no required rule and that no project-level backstop is configured.

Under that documented configuration, a new MR touching an enforced path can therefore have green CPU CI without an owner rule. PYTHONDONTWRITEBYTECODE=1 /opt/nemo_gym_venv/bin/python /workspace/review-probes/pipeline-enforcement-1/probe.py confirmed the disjoint job sets and reproduced package, fetch and npm failures stopping before the adapter under both sh and bash. These are local boundary checks, not a live mergeability test.

Could you require successful reconciliation bound to the MR's current SHA, or an equivalent provider-enforced backstop, before merge? Keep credentialed execution on protected trusted code and preserve the eligible-owner approval requirement after reconciliation.

Acceptance: open an MR touching an enforced path, fail setup before adapter execution, and verify merging stays blocked despite green CPU CI. Restore setup and verify an eligible owner approval is required. Push again and verify an earlier reconciliation cannot satisfy the new head.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 79c507d

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 92bb6e2

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 74510f7

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 5b7dba3

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 14bfce1

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 3956254

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

@svcnvidia-nemo-ci svcnvidia-nemo-ci 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.

SHIP WITH CARE

I reviewed all four changed files and their connected dispatch, ownership and test paths, with three delegated reviews. The prior enforcement RISK is still open. The earlier shell-comment test NOTE stays fixed: fresh mutation probes rejected comment-only enforcement flags. I found no additional defects. Since the reachable previous-review commit, only the adapter pin and matching README pin changed.

Validation: I used 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:cdf2a680f265977c26a8906d136c801c701a5ffa, the successful base-branch CI image; this head's image build was skipped. The focused dispatcher and review-policy tests passed: 9 tests and 11 subtests, with one cache-plugin configuration warning. Ruff check and format-check passed for the changed Python file. Mock probes covered six routing contexts, setup and adapter failures under sh and bash, and 13 independent mutation/shell/CLI checks. They confirmed argument passing and failure propagation, and reproduced setup stopping before the adapter could install fallback rules.

CI is red. Classify changes failed with PR merge revision is unavailable or the PR mirror is stale. GitHub reported mergeable=false, mergeable_state=dirty and no merge commit. Nemo_CICD_Test consequently failed; component locks, unit tests and the container build were skipped, not passed. The local focused results do not clear that CI failure.

The shared adapter repository was not admitted, so I did not fetch it. Its newly pinned implementation, real approval-rule writes and live GitLab mergeability are unvalidated. Expanded GitLab CI lint and the full test suite were not run.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

stage: report
needs: [gym-review-pools-prepare]
allow_failure: true
allow_failure: false

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.

RISK: Required-owner enforcement can still fail open before the adapter writes.

This is the unresolved prior finding. allow_failure: false makes failure visible within the protected-branch trigger pipeline, but the review-pool predicates select a different pipeline from MR CPU CI, with no reconciliation dependency between them. The README confirms that a pre-write failure leaves no required rule and that no project-level backstop is configured.

Under that documented configuration, a new MR touching an enforced path can have green CPU CI without an owner-approval rule. PYTHONDONTWRITEBYTECODE=1 /opt/nemo_gym_venv/bin/python /workspace/review-probes/r6731-dispatch-1/probe.py passed six routing contexts and 12 shell/failure cases. Package, fetch and npm failures stopped before adapter execution under both sh and bash, so --codeowners-fallback could not run. These are local boundary checks, not a live mergeability test. Repinning the adapter cannot repair paths that never execute it.

Could you require successful reconciliation bound to the MR's current SHA, or an equivalent provider-enforced backstop, before merge? Keep credentialed execution on trusted protected-branch code and preserve the eligible-owner approval requirement after reconciliation.

Acceptance checks:

  1. Open an MR touching an enforced path, fail setup before adapter execution, and verify merging stays blocked despite green CPU CI.
  2. Restore setup and verify an eligible owner approval is required.
  3. Push a new head and verify an earlier successful reconciliation cannot satisfy its requirement.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 3537ac2

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review reset=true

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review 3537ac2

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 744d876

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review 744d876

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@kajalj22

Copy link
Copy Markdown
Contributor Author

/ok to test 2e7b45e

@kajalj22

Copy link
Copy Markdown
Contributor Author

/review 2e7b45e

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI workflows, test routing, and repository automation ci CI, automation, test queue, or workflow infrastructure work risk:high Autobot PR risk: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants