Skip to content

Add blocking unit-test gates for PRs and NuGet releases#17

Merged
Freezor merged 1 commit intomainfrom
codex/update-github-actions-workflow-for-test-gates
Mar 27, 2026
Merged

Add blocking unit-test gates for PRs and NuGet releases#17
Freezor merged 1 commit intomainfrom
codex/update-github-actions-workflow-for-test-gates

Conversation

@Freezor
Copy link
Copy Markdown
Owner

@Freezor Freezor commented Mar 27, 2026

Motivation

  • Ensure unit tests are enforced as hard quality gates before code is merged and before NuGet packages are published.
  • Prevent a failing test suite from allowing a tag-driven release to proceed to packing or publishing.
  • Preserve existing release behavior and conventions while inserting test verification in the release dependency graph.

Description

  • Added a new PR workflow .github/workflows/pr-tests.yml that runs on pull_request and executes dotnet test "${{ steps.solution.outputs.SOLUTION_PATH }}" -c Release --no-build --verbosity normal as a blocking gate.
  • The PR job locates the solution dynamically, restores, builds in Release, runs tests with TRX logging (--logger "trx;LogFileName=test-results.trx") and uploads test results as artifacts for reviewer inspection.
  • Updated the release workflow .github/workflows/release-nuget.yml to introduce a pre-publish test-gate job that performs the same restore/build/test sequence and made build-pack-push depend on it via needs: test-gate so pack/publish steps are blocked if tests fail.
  • Kept all original release steps (version validation, pack, package verification, NuGet push, changelog, artifact upload, and GitHub release creation) and preserved the existing style, actions, .NET version, and use of ${{ steps.solution.outputs.SOLUTION_PATH }}.

Testing

  • Verified both workflow YAML files parse successfully using Ruby's YAML parser.
  • A Python YAML load check was attempted but skipped due to missing PyYAML in the environment.
  • Inspected diffs and file contents to confirm .github/workflows/pr-tests.yml was added and .github/workflows/release-nuget.yml was updated to include the test-gate job and needs: test-gate dependency.

Codex Task

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 27, 2026

Warning

Rate limit exceeded

@Freezor has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 5 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 5 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 41cd0020-1a48-4e35-b86b-db591c8eae23

📥 Commits

Reviewing files that changed from the base of the PR and between dfa40ed and a9c8cc8.

📒 Files selected for processing (2)
  • .github/workflows/pr-tests.yml
  • .github/workflows/release-nuget.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/update-github-actions-workflow-for-test-gates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9c8cc81b6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ inputs.ref || github.ref }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pin build job to the tested commit SHA

In .github/workflows/release-nuget.yml, the new test-gate and existing build-pack-push jobs each run their own checkout from ${{ inputs.ref || github.ref }}; for workflow_dispatch this defaults to main, which is mutable. That means if main advances after test-gate passes but before build-pack-push starts, the package can be built/published from a different commit than the one that was tested, which breaks the intended hard gate. To keep the gate trustworthy, resolve and pass a specific commit SHA from test-gate to build-pack-push and checkout that SHA in the second job.

Useful? React with 👍 / 👎.

@Freezor Freezor merged commit 13e40aa into main Mar 27, 2026
3 checks passed
@Freezor Freezor deleted the codex/update-github-actions-workflow-for-test-gates branch March 27, 2026 07:46
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.

1 participant