Skip to content

status: Render cached update info in human-readable output#2047

Open
cgwalters wants to merge 3 commits intobootc-dev:mainfrom
cgwalters:cached-status
Open

status: Render cached update info in human-readable output#2047
cgwalters wants to merge 3 commits intobootc-dev:mainfrom
cgwalters:cached-status

Conversation

@cgwalters
Copy link
Collaborator

After running bootc upgrade --check, the registry metadata for a
newer image is cached in ostree commit metadata. The bootc status
command already reads this into the cachedUpdate field and exposes
it in JSON/YAML output, but the human-readable output never displayed
it. This meant users had to parse structured output or re-run
upgrade --check to see available updates.

Render the cached update inline with each deployment entry, showing
version, timestamp, and digest when the cached digest differs from
the currently deployed image.

Relates: https://issues.redhat.com/browse/RHEL-139384

@github-actions github-actions bot added the area/documentation Updates to the documentation label Mar 5, 2026
@bootc-bot bootc-bot bot requested a review from gursewak1997 March 5, 2026 00:21
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the bootc status command to display cached update information, which is populated by bootc upgrade --check. The implementation is well-structured, introducing a new render_cached_update function and a format_timestamp helper. The changes are thoroughly tested with new unit tests and an integration test, covering various scenarios. The unrelated documentation changes to rename --insecure to --allow-missing-verity also improve clarity. Overall, this is a solid improvement to user experience.

@henrywang
Copy link
Collaborator

The OpenSSF Scorecard failure should be fixed by PR bootc-dev/actions#18

@cgwalters cgwalters marked this pull request as draft March 5, 2026 12:29
@cgwalters cgwalters marked this pull request as draft March 5, 2026 12:29
Run update-generated to sync man pages and tmt plans with
current CLI options and test summaries.

Assisted-by: OpenCode (Claude claude-opus-4-6)
Signed-off-by: Colin Walters <walters@verbum.org>
Deduplicate the timestamp formatting code used in human-readable
status output. The format string was inlined with a multi-line
comment explaining it; extract it into a named function.

Assisted-by: OpenCode (Claude claude-opus-4-6)
Signed-off-by: Colin Walters <walters@verbum.org>
After running `bootc upgrade --check`, the registry metadata for a
newer image is cached in ostree commit metadata. The `bootc status`
command already reads this into the `cachedUpdate` field and exposes
it in JSON/YAML output, but the human-readable output never displayed
it. This meant users had to parse structured output or re-run
`upgrade --check` to see available updates.

Render the cached update inline with each deployment entry, showing
version, timestamp, and digest when the cached digest differs from
the currently deployed image.

Relates: https://issues.redhat.com/browse/RHEL-139384

Assisted-by: OpenCode (Claude claude-opus-4-6)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters marked this pull request as ready for review March 5, 2026 15:25
@cgwalters cgwalters requested a review from henrywang March 5, 2026 15:25
discover:
how: fmf
test:
- /tmt/tests/tests/test-35-upgrade-preflight-disk-check
Copy link
Collaborator

@henrywang henrywang Mar 6, 2026

Choose a reason for hiding this comment

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

Should add add extra-fixme_skip_if_composefs: true for this test to fix CI test failures.

assert ($v2_cached.imageDigest != $booted_digest) "Cached update digest should differ from booted"

# Verify human-readable output contains update info
let human_output = bootc status
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need --format humanreadable

assert ($v3_cached.imageDigest != $v2_cached.imageDigest) "v3 cached digest should differ from v2"

# Verify human-readable output updated to v3
let human_output_v3 = bootc status
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need --format humanreadable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Updates to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants