Skip to content

fix(countme): read the booted image ref without running bootc (utah#1198) - #1708

Merged
castrojo merged 2 commits into
mainfrom
hive/adopt-1689
Nov 20, 2026
Merged

castrojo merged 2 commits into
mainfrom
hive/adopt-1689

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Supersedes #1689 (adopted after CI went red and the contributor was unavailable; original commits by @Danathar preserved).

This branch is #1689's head 9460399a87e7 as pushed by @Danathar (fork projectbluefin/common), unchanged. Last lane reason on the original: optional-check-failing:E2E — composed common suite / e2e / GNOME — common.

Hive fix agent: rebase this branch on main, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and their Signed-off-by; add your own sign-off on your commits. Do not open another PR.

Danathar and others added 2 commits November 15, 2026 16:08
projectbluefin-countme ran `bootc status --json` from an unconfined
service. bootc's SELinux probe (chcon to a test label) was denied
mac_admin, logging two AVC denials on every boot
(projectbluefin/utah#1198).

Read the ref from the booted deployment's .origin file (found through
ostree= on the kernel command line), falling back to the boot-time
snapshot /run/ublue-os/booted-image. Non-bootc hosts keep their
image-tag fallback.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WcWm7tJ5iop2b4GMkKSPAv
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
Follow the composefs=/composefs.digest= command-line arguments to
/sysroot/state/deploy/<id>/<id>.origin, the same lookup utah#1220 uses,
and avoid a stray error when the snapshot file is missing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WcWm7tJ5iop2b4GMkKSPAv
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
@mergeraptor

mergeraptor Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: castrojo

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 18, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks correct to me for the ostree path. One open question on the composefs path. The red E2E check is not caused by this change.

Code. booted_ref() in system_files/shared/usr/libexec/projectbluefin-countme:36-65 no longer runs bootc. Here is how each piece works:

  • ostree path. ostree= from /proc/cmdline goes through readlink -f and then gets .origin appended. On a booted host, /ostree/boot.N/<stateroot>/<csum>/<serial> resolves to …/deploy/<csum>.<serial>, and the .origin keyfile sits beside it.
  • Transport stripping. The strips at lines 53-58 use shortest-prefix # matches, so ostree-remote-registry:<remote>: and ostree-remote-image:<remote>:docker:// both reduce to a bare ref. The new transport-form test covers all five forms.
  • Stream parsing. The stream is still taken from ${ref##*:} after stripping @digest. A registry port such as localhost:5000/dakota comes out as unknown, and a test covers it.
  • Sandbox. The service still runs as root under ProtectSystem=strict, which leaves /sysroot readable. The unit comment change at projectbluefin-countme.service:25-26 matches the new behavior.
  • No-ref case. The no-ref branch for Server/live ISO (lines 74-87) is unchanged, so Server DDI reporting is unaffected.
  • Test guard. The bootc stub now leaves a marker that teardown checks for. Every test therefore asserts that the script never runs bootc, which is the regression guard utah#1198 needs.

Open question (not verified). Line 45 reads ${COUNTME_SYSROOT:-/sysroot}/state/deploy/$id/$id.origin on composefs hosts, citing utah's ublue-booted-image-sync. That script's source is in neither this repo nor projectbluefin/utah, so I could not confirm that the path or the container-image-reference key matches bootc's composefs backend. The fallback to /run/ublue-os/booted-image (lines 60-63) limits the damage. If the path is wrong, composefs Utah hosts are still counted when that snapshot exists, and they skip silently when it doesn't. Someone with a composefs VM can confirm with cat /sysroot/state/deploy/*/*.origin.

E2E attribution. This run (44372598326) has 6 failing scenarios:

  • common_dconf.feature:91, common_desktop_entries.feature:12 and :24 also fail on #1709, which shares none of this diff.
  • common_portals.feature:25, :29 and portal_integration.feature:10 are the uwelcome portal stall that #1709 fixes. They pass on #1709's run.

None of the 6 touches countme.

Confidence: 5/5 (safe)

— hive: agent=reviewer-2 backend=claude model=claude-opus-5-5 effort=medium claude=2.1.326

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

E2E GNOME-common failure is not caused by this PR. Failing scenarios (dconf Searchlight, desktop entries, xdg-desktop-portal / portal_integration) are unrelated to countme and fail identically on other heads: #1690 run 44372663960 (same 3 base failures), merge-queue runs 44359456291 and 44359291950 (same 12). This PR only touches projectbluefin-countme files and tests/test_projectbluefin_countme.bats, whose bats test and validate jobs pass. The countme opt-out marker took effect in the VM (service skipped on ConditionPathExists). No code change pushed. Needs the shared baseline E2E regression fixed on main, or a rerun after that.


🐝 Hive Agent: scanner | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: 0b15add4014dcf7109b6a775372dcb23cd1138dc

— hive: agent=scanner backend=copilot model=claude-sonnet-5.5 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 18, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Nov 18, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

stage 060-reviewed → 050-review-pending: repo-auto-merge-disabled

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 18, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 19, 2026

@juanresendiz813 juanresendiz813 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.

Ran the script against a real composefs-booted Dakota's cmdline and .origin and it reports dakota/main:stable, path layout matches bootc. One small thing: the insecure composefs=? form keeps the '?', so it looks for the wrong .origin and only works if /run/ublue-os/booted-image exists. id=${id#?} after the case fixes it. Low impact today. FYI utah#1198 itself was already closed by utah#1279 (SELinux rule), but this is still a nicer fix.

@castrojo castrojo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Second ack. Correct root cause: the service no longer runs bootc at all, so the unconfined_service_t SELinux probe's mac_admin denials (utah#1198) are avoided. booted_ref reads the booted deployment .origin via ostree=/composefs= cmdline (falling back to /run/ublue-os/booted-image); transport-prefix stripping and the registry-port guard are each covered by new tests, and the bootc stub now asserts non-invocation in teardown.

@mergeraptor mergeraptor Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 20, 2026
@castrojo
castrojo added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit ac5c44a Nov 20, 2026
240 of 242 checks passed
@castrojo
castrojo deleted the hive/adopt-1689 branch November 20, 2026 01:46
@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants