Inject proper crane version from tag in CI#458
Conversation
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
|
Warning Review limit reached
More reviews will be available in 18 minutes and 55 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds an exported BuildCommit variable, prints that SHA in the ChangesBuild version injection and validation
Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant GoBuild as "go build"
participant DistArtifact as "dist/<binary>"
GitHubActions->>GitHubActions: compute BUILD_VERSION (tag || main-<sha>)
GitHubActions->>GoBuild: run `go build -ldflags -X internal/buildinfo.Version=${BUILD_VERSION} -X internal/buildinfo.BuildCommit=${BUILD_COMMIT}` -> outputs to dist/
GoBuild->>DistArtifact: write binary with embedded Version and BuildCommit strings
GitHubActions->>DistArtifact: run `strings | grep -Fq "${BUILD_VERSION}"` to validate
GitHubActions-->>GitHubActions: fail workflow if grep misses match
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Test Coverage ReportTotal: 46.6% Per-package coverage
Full function-level detailsPosted by CI |
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmd/version/version.go`:
- Line 63: TestVersionOutput currently doesn't assert the new "SHA" line; update
the test in cmd/version/version_test.go (TestVersionOutput) to assert that the
captured stdout contains the SHA output by checking for the substring "\tSHA:"
or the actual buildinfo.BuildCommit value (e.g., using strings.Contains or
require/ assert Contains on the test's stdout variable). Locate the test helper
that invokes version.PrintVersion (or main/version command) and add a single
assertion asserting stdout includes "\tSHA:" (or buildinfo.BuildCommit) so the
new line is covered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: df523179-a799-4255-b78f-67c6fd6746f2
📒 Files selected for processing (2)
cmd/version/version.gointernal/buildinfo/buildinfo.go
aufi
left a comment
There was a problem hiding this comment.
Looks great, thanks for the PR! Left one minor comment.
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
|
@CodeRabbit summary |
✅ Action performedSummary regeneration triggered. |
Summary by CodeRabbit
Chores
New Features