Skip to content

ci: add guardwords checks for PR changes and descriptions - #4271

Merged
chtruong814 merged 21 commits into
mainfrom
chtruong/guardwords
Oct 13, 2026
Merged

chtruong814 merged 21 commits into
mainfrom
chtruong/guardwords

Conversation

@chtruong814

@chtruong814 chtruong814 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Adds the Gym Guardwords caller for approved pull-request/** mirror pushes. It obtains PR metadata, verifies that the mirror SHA matches the PR head, and passes the base SHA, head SHA, and numeric PR number to the reusable workflow at FW-CI-templates commit d0a139c4943a203afaadb6af7373b9055e653cd1 (v1.15.0).

CI checks both added diff lines and the full current PR description. The shared workflow fetches the description directly to a temporary file, verifies the PR number/repository/head SHA, and reports only match locations. Gym's mirror verification receives only the head SHA rather than the full metadata in its step environment, avoiding description exposure there. Existing contents: read and pull-requests: read permissions satisfy the merged interface.

Also adds the optional shared pre-commit hook at the same release commit. It checks staged additions when the developer can access the private catalog and succeeds with a generic skip message otherwise. The refreshed secrets baseline preserves every existing exclusion and detector setting; only the accepted template-pin hash and timestamp changed.

The shared implementations are merged in FW-CI-templates #599 and #602. No separate Gym issue is needed for this focused consumer integration.

Validation:

  • pre-commit run --all-files: passed with the v1.15.0 pin.
  • pre-commit validate-config: passed.
  • actionlint 1.7.12 on .github/workflows/guardwords-check.yml: passed with shellcheck disabled.
  • Caller/template contract checks: passed for numeric PR wiring, matching read permissions, and matching/mismatched/empty/shell-syntax head SHA cases; verification produced no description output.
  • Exact v1.15.0 template tests: 20 scanner/workflow tests and 6 fetch tests passed, including unavailable private-catalog skips, description matching, simulated API failures, and shell/logging safety.
  • detect-secrets 1.5.0 scan and hook: passed; verified all baseline exclusions and detector settings remain unchanged, with the same three findings.
  • git diff --check: passed.
  • Prior diff-only CI canary failure: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37873115647/job/113635506144 (earlier pin; temporary canary removed).
  • Live description canary against private-catalog CI: not run for this revision; local integration checks use synthetic data.

Rollouts: N/A — CI/developer tooling only; no environment, agent, verifier, or benchmark behavior changes.

Compatibility: developers without Guardwords access can still commit. CI remains the enforced check. The workflow triggers on approved mirror pushes; a description edit alone does not trigger it, so rerun the caller to fetch and check the edited description.

@copy-pr-bot

copy-pr-bot Bot commented Oct 8, 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.

@chtruong814 chtruong814 changed the title ci: scan pull request branches for private references ci: add guardwords-check for pull-request branches Oct 8, 2026
Reuse the FW-CI-templates scanner at its reviewed PR commit and remove the Gym-local copy.

Refs: AUT-2502
Signed-off-by: Charlie Truong <[email protected]>
@chtruong814
chtruong814 marked this pull request as ready for review October 9, 2026 01:41
@chtruong814
chtruong814 requested a review from a team as a code owner October 9, 2026 01:41
@chtruong814

Copy link
Copy Markdown
Contributor Author

/ok to test ac48434

@chtruong814

Copy link
Copy Markdown
Contributor Author

/ok to test ea8c7c1

@chtruong814

Copy link
Copy Markdown
Contributor Author

/ok to test f886b00

@chtruong814

Copy link
Copy Markdown
Contributor Author

/claude review

@claude

claude Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

SHIP — LGTM, no reliability concerns.

CI/tooling-only change (new guardwords workflow + pre-commit hook + regenerated .secrets.baseline). Reviewed against repo conventions:

  • .github/workflows/guardwords-check.yml follows the established mirror-trust pattern: pinned action SHAs, persist-credentials: false, the get-pr-info + Verify mirror commit (jq -e .head.sha == $GITHUB_SHA) gate used by fern-docs-preview.yml, and minimal contents: read/pull-requests: read permissions. Reusable workflow pinned to a FW-CI-templates SHA.
  • .pre-commit-config.yaml adds the guardwords hook pinned to a rev; placement and format match surrounding hooks.
  • .secrets.baseline regeneration collapses the should_exclude_file pattern list into a single equivalent |-joined regex and drops result entries for files now covered by the exclusion filters — functionally equivalent, no secrets unmasked.

No verifier/scorer, async, or public-API surface touched; nothing to smoke-test with a model.

@chtruong814

Copy link
Copy Markdown
Contributor Author

/ok to test 594cc43

@yaoyu-33 yaoyu-33 added needs-review PR is ready for code review and waiting on a reviewer and removed blocked Work cannot move forward until an external dependency is cleared labels Oct 10, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 12, 2026
@chtruong814 chtruong814 changed the title ci: add guardwords-check for pull-request branches ci: add guardwords checks for PR changes and descriptions Oct 13, 2026
@chtruong814

Copy link
Copy Markdown
Contributor Author

/ok to test 62ecd50

@chtruong814

Copy link
Copy Markdown
Contributor Author

/review

@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 — LGTM — no reliability concerns.

Reviewed all three changed files and their affected CI/pre-commit paths:

  • Guardwords workflow: mirror-SHA verification gates the reusable job; PR inputs are passed without interpolating metadata into shell code.
  • Pre-commit configuration: hook and workflow use the same immutable template pin.
  • Secrets baseline: combined exclusion regex preserves the existing alternatives, and detector settings remain unchanged.

Static review only. Tests were not executed; external template internals and live private-catalog behavior were not independently verified.

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex

@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 13, 2026
@chtruong814
chtruong814 added this pull request to the merge queue Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/38332040057

Merged via the queue into main with commit 43a5e5c Oct 13, 2026
50 of 55 checks passed
@chtruong814
chtruong814 deleted the chtruong/guardwords branch October 13, 2026 01:42

This branch was previously deployed

1 inactive deployment
public — 62ecd50f Deployed Oct 13, 2026 by copy-pr-bot[bot] via release / finalize / notify #5127
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 complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants