Skip to content

chore: Release PR checks no longer fail on an environment-dependent unit test - #1326

Merged
hatayama merged 1 commit into
v3-betafrom
fix/clear-head-ref-in-minimum-version-unit-test
Jun 12, 2026
Merged

chore: Release PR checks no longer fail on an environment-dependent unit test#1326
hatayama merged 1 commit into
v3-betafrom
fix/clear-head-ref-in-minimum-version-unit-test

Conversation

@hatayama

@hatayama hatayama commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

User Impact

  • Before: TestMinimumVersionWarningSkipsMissingBaseRefBeforeRepositoryResolution failed when the test suite ran on the release PR's own CI, keeping the release blocked.
  • After: the test passes regardless of the CI environment, so the release PR can go green.

Changes

Verification

  • GITHUB_HEAD_REF=release-please--branches--v3-beta GITHUB_BASE_REF=v3-beta go test ./... -count=1 reproduced the CI failure before the fix and passes after it
  • scripts/check-go-cli.sh: all green

Review in cubic

GitHub Actions sets GITHUB_HEAD_REF for every step of pull_request
runs, so on the release-please release PR the inherited
release-please--branches--v3-beta value made the release-please skip
fire before the base-ref skip under test, failing build-cli on the
release PR itself. The test now controls GITHUB_HEAD_REF explicitly
like the architecture test harness already does.
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 39bb3182-a0df-43a0-a042-8d9462025982

📥 Commits

Reviewing files that changed from the base of the PR and between d5ae563 and a95f228.

📒 Files selected for processing (1)
  • cli/internal/automation/minimum_version_warning_test.go

📝 Walkthrough

Walkthrough

Test TestMinimumVersionWarningSkipsMissingBaseRefBeforeRepositoryResolution now explicitly clears GITHUB_HEAD_REF environment variable to ensure the missing base ref skip behavior is evaluated before dependent logic runs.

Changes

Test environment fix

Layer / File(s) Summary
Environment variable cleanup in version warning test
cli/internal/automation/minimum_version_warning_test.go
Test adds t.Setenv("GITHUB_HEAD_REF", "") to clear CI's PR head branch so the base-ref skip is the first condition evaluated.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • hatayama/unity-cli-loop#1244: Both PRs modify the CLI minimum-version warning test suite in minimum_version_warning_test.go, directly connected to the same test logic for missing-base-ref handling.

  • hatayama/unity-cli-loop#1246: This test change (clearing GITHUB_HEAD_REF to force the missing base ref skip path) is directly related to updates in RunMinimumVersionWarning that depend on PR head/base ref handling.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing a unit test that was failing in certain CI environments due to environment-dependent behavior.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the problem, root cause, solution, and verification steps for the test fix.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/clear-head-ref-in-minimum-version-unit-test

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.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Re-trigger cubic

@hatayama
hatayama merged commit a370507 into v3-beta Jun 12, 2026
8 checks passed
@hatayama
hatayama deleted the fix/clear-head-ref-in-minimum-version-unit-test branch June 12, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant