Skip to content

polish(update): clarify target-specific release output#99

Merged
Vasanthdev2004 merged 1 commit into
mainfrom
polish/update-target-output
Jun 6, 2026
Merged

polish(update): clarify target-specific release output#99
Vasanthdev2004 merged 1 commit into
mainfrom
polish/update-target-output

Conversation

@anandh8x

@anandh8x anandh8x commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • include the verified release target in text update output
  • replace ambiguous "your platform" wording with target-specific guidance
  • cover update-available and up-to-date formatter output in tests

Validation

  • GOCACHE=/tmp/zero-go-cache go test ./internal/update
  • GOCACHE=/tmp/zero-go-cache go test ./...
  • GOCACHE=/tmp/zero-go-cache go run ./cmd/zero-release build
  • ./zero update --check --target windows-x64 --endpoint 'data:application/json,%7B%22tag_name%22%3A%22v0.2.0%22%2C%22html_url%22%3A%22https%3A%2F%2Fexample.test%2Frelease%22%2C%22assets%22%3A%5B%7B%22name%22%3A%22zero-v0.2.0-windows-x64.zip%22%2C%22browser_download_url%22%3A%22https%3A%2F%2Fexample.test%2Fzero-v0.2.0-windows-x64.zip%22%7D%2C%7B%22name%22%3A%22zero-v0.2.0-windows-x64.zip.sha256%22%2C%22browser_download_url%22%3A%22https%3A%2F%2Fexample.test%2Fzero-v0.2.0-windows-x64.zip.sha256%22%7D%5D%7D'
  • git diff --check

Sample output

Release target: windows-x64
Release asset: zero-v0.2.0-windows-x64.zip
Checksum asset: zero-v0.2.0-windows-x64.zip.sha256
Download the verified windows-x64 release asset, then replace the current zero binary.

Summary by CodeRabbit

  • Bug Fixes

    • Improved update availability messages to include platform and architecture-specific download instructions when release metadata is available, providing clearer guidance.
  • Tests

    • Enhanced test coverage to verify platform-specific guidance and release target information are correctly included in update notifications.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Zero automated PR review

Verdict: No blockers found

Blockers

  • None found.

Validation

  • [pass] Diff hygiene: git diff --check
  • [pass] Tests: go test ./...
  • [pass] Build: go run ./cmd/zero-release build
  • [pass] Smoke build: go run ./cmd/zero-release smoke

Scope

Head: e018334e7c7d
Changed files (2): internal/update/update.go, internal/update/update_test.go

This deterministic review checks validation status and basic diff hygiene. A human reviewer still owns product judgment and design quality.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Lost in the diff? Review this PR in Change Stack to follow the change map from intent to exact ranges.

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 Plus

Run ID: 6dc3aeee-d94c-4cd3-b1e5-4d74371e9412

📥 Commits

Reviewing files that changed from the base of the PR and between 699df01 and e018334.

📒 Files selected for processing (2)
  • internal/update/update.go
  • internal/update/update_test.go

Walkthrough

This PR enhances update messages with platform-arch visibility. It introduces a helper to compute platform-arch from release asset metadata, displays that target in asset lines, and provides platform-specific download guidance in the update message instead of generic fallback text.

Changes

Platform-arch-specific release guidance

Layer / File(s) Summary
Release target display in asset lines
internal/update/update.go, internal/update/update_test.go
A new releaseAssetTarget helper derives platform-arch from asset metadata. appendAssetLines now conditionally appends a "Release target: " line when both platform and arch fields are present, while keeping asset and checksum lines. The "up to date" test output asserts this line is included.
Platform-aware download guidance
internal/update/update.go, internal/update/update_test.go
The Format function's "update available" message now uses platform-specific download instructions when a valid platform-arch target can be derived from verified asset metadata, falling back to generic verified-asset language otherwise. Tests verify the output includes targeted guidance and rejects ambiguous "your platform" wording.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Gitlawb/zero#84: Both PRs modify release-asset formatting in internal/update/update.go; this PR builds on the prior PR's platform/arch metadata additions to introduce target-aware display and guidance.

Suggested reviewers

  • gnanam1990
  • Vasanthdev2004
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: making the release output target-specific and clarifying guidance, which aligns with adding platform-arch information and replacing ambiguous 'your platform' wording.
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 polish/update-target-output

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

@Vasanthdev2004 Vasanthdev2004 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Blockers

  • None.

Non-Blocking

  • None.

Looks Good

  • The formatter now includes the resolved release target before the archive/checksum names and removes the ambiguous "your platform" guidance from update-available output.
  • The fallback path remains safe when asset platform/arch are absent: it omits the target line and uses generic verified-release-asset wording instead of inventing a target.
  • The branch was behind current origin/main, so I also validated a clean latest-main test merge.
  • Validation run locally on the PR head:
    • go test -count=1 ./internal/update
    • go test -count=1 -p 1 ./...
    • go run ./cmd/zero-release build
    • ./zero update --check --target windows-x64 --endpoint <windows data: endpoint>
    • git diff --check
  • Validation run locally on a latest-main test merge:
    • go test -count=1 ./internal/update
    • go test -count=1 -p 1 ./...
    • go run ./cmd/zero-release build
    • ./zero update --check --target windows-x64 --endpoint <windows data: endpoint>
    • git diff --check

@Vasanthdev2004
Vasanthdev2004 merged commit 2d41e24 into main Jun 6, 2026
6 checks passed
@Vasanthdev2004
Vasanthdev2004 deleted the polish/update-target-output branch June 28, 2026 08:27
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.

2 participants