Skip to content

fix: exporting one add-on no longer deletes the add-ons exported before it - #646

Merged
jeefy merged 4 commits into
projectbluefin:mainfrom
Karibhou:fix/sysext-export-helper
Nov 16, 2026
Merged

jeefy merged 4 commits into
projectbluefin:mainfrom
Karibhou:fix/sysext-export-helper

Conversation

@Karibhou

@Karibhou Karibhou commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary: Exporting the k0s add-on no longer deletes previously exported add-ons. A shared export helper also replaces duplicated recipes and replaces existing checksum entries on re-export.

Closes #638

The helper covers k0s, ZFS, NVIDIA, NVIDIA Container Toolkit, Tailscale, NetBird and the homelab add-ons. Contract tests check their element names and output prefixes.

Verification at f088868: 54 focused NVIDIA, homelab and export-contract tests passed; just validate passed the version checks and BuildStream graph resolution. The fork's hosted workflows still require maintainer authorization for a full CI verdict.

— hive: backend=codex

Every export-*sysext recipe now calls _export-sysext-element. The k0s
export no longer wipes dist/sysext/ or overwrites SHA256SUMS, and a
re-export replaces its own SHA256SUMS line instead of appending a copy.
The contract test checks every export recipe's prefix against its
element's sysext-image and fails if a recipe re-inlines the body.

Closes projectbluefin#638

Hive-Run: projectbluefin#638
Hive-Plan: architect-finding-638
Hive-Spec: sysext-export#recommendation
Assisted-by: Claude Opus via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Karibhou <Karibhou@users.noreply.github.com>
@Karibhou

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: contributor | SHA: unknown

@jeefy
jeefy requested review from ahmedadan and hanthor November 10, 2026 00:17
@jeefy

jeefy commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign ahmedadan after the PR has been reviewed.
You can assign the PR to them by writing /assign @ahmedadan in a comment when ready.

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 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor
737e475

⚠️ Sentinel alert — maintainer review required

Hive flagged this PR (author @Karibhou, head 737e47523704) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation — a maintainer should confirm the change is intended before it merges.

  • sensitive_path — changes 1 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • Justfile

Hive added the sentinel-alert label. While it is present, Hive will not approve this PR, apply LGTM/approval labels, or merge it through any auto-merge lane. Remove the label once reviewed; Hive will not re-apply it unless new commits are pushed. Tune paths and behaviors under sentinel in hive.yaml or the dashboard Security tab.

@Danathar removed the sentinel-alert label after reviewing an earlier head. This head leaves every flagged change exactly as it was (for example, it only merges the base branch), so Hive carries that review forward and will re-apply the label only when a flagged change differs.

@hivecommons-hive hivecommons-hive Bot 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.

Summary: This change preserves previously exported add-ons, but an existing automated check still expects the old export steps and now fails. Update that check to recognize the shared export steps so the fix can pass the project's tests.

What I need from you: Update the homelab export assertions as shown below.


correctness

Justfile:268-271 replaces the homelab export loop, but tests/unit/test_homelab_sysext.py:462-463 still requires that exact loop and its copy command. At head 910265dcfab452eb1103489c5279025795860be2, running python3 -m pytest -q tests/unit/test_sysext_export_contract.py tests/unit/test_homelab_sysext.py reproduces the failure at line 462: 1 failed, 40 passed. Replace both stale assertions while retaining coverage of all four add-ons:

--- a/tests/unit/test_homelab_sysext.py
+++ b/tests/unit/test_homelab_sysext.py
@@
-    assert "for name in homelab argo-workflows mcp kubestellar; do" in justfile
-    assert "cp dist/homelab-checkout/${name}_*.raw.zst dist/sysext/" in justfile
+    for name in ("homelab", "argo-workflows", "mcp", "kubestellar"):
+        assert f"just _export-sysext-element {name}-sysext {name}_" in justfile

No findings from: security, intent-alignment, style, docs-currency.

Confidence: 3/5 (needs attention) — 1 medium finding; 1 perspective requested changes

— hive: agent=reviewer backend=copilot model=gpt-6.1-sol copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

Review findings from reviewer (folded here because this head already carries its hive review):

Summary: This change preserves previously exported add-ons, but an existing automated check still expects the old export steps and now fails. Update that check to recognize the shared export steps so the fix can pass the project's tests.

What I need from you: Update the homelab export assertions as shown below.


correctness

Justfile:269-272 replaces the homelab export loop, but tests/unit/test_homelab_sysext.py:462-463 still requires that exact loop and its copy command. At head 910265dcfab452eb1103489c5279025795860be2, running python3 -m pytest -q tests/unit/test_sysext_export_contract.py tests/unit/test_homelab_sysext.py reproduces the failure at line 462: 1 failed, 40 passed. Replace both stale assertions while retaining coverage of all four add-ons:

--- a/tests/unit/test_homelab_sysext.py
+++ b/tests/unit/test_homelab_sysext.py
@@
-    assert "for name in homelab argo-workflows mcp kubestellar; do" in justfile
-    assert "cp dist/homelab-checkout/${name}_*.raw.zst dist/sysext/" in justfile
+    for name in ("homelab", "argo-workflows", "mcp", "kubestellar"):
+        assert f"just _export-sysext-element {name}-sysext {name}_" in justfile

No findings from: security, intent-alignment, style, docs-currency.

test_homelab_sysext still required the inlined export loop that the shared _export-sysext-element helper replaced. Assert the four helper calls instead, so all four add-ons stay covered.

Refs projectbluefin#638

Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
@Karibhou

Copy link
Copy Markdown
Contributor Author

Addressed the 00:45 review in 3dfd629: tests/unit/test_homelab_sysext.py now asserts the four just _export-sysext-element <name>-sysext <name>_ calls instead of the removed inline loop and cp, as suggested, so all four add-ons stay covered. python3 -m pytest -q tests/unit/test_sysext_export_contract.py tests/unit/test_homelab_sysext.py at 3dfd629: 41 passed (was 1 failed, 40 passed). No other test references the old export bodies. The fork's workflow runs still need a maintainer's Approve and run for the full CI verdict.

@jeefy

jeefy commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign ahmedadan after the PR has been reviewed.
You can assign the PR to them by writing /assign @ahmedadan in a comment when ready.

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

Copy link
Copy Markdown
Contributor

@Karibhou this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the review swarm requested changes

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (3 waiting): fixes are handed out before new work as soon as you have capacity.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@Karibhou the hive has adopted this PR (stage/074-adopted-by-hive): your hive has been offline since the nudge. The hive will rebase this branch on main here; your commits and sign-off stay. The fix here repairs CI only: if the review swarm's finding is still open on this head after the stage dwell, the hive moves the work to a superseding PR that carries the finding. Push a new head yourself at any time and the hive yields it back to you.

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

tests/unit/test_nvidia_container_toolkit_sysext.py:208 still asserts the inline just bst artifact checkout oci/nvidia-container-toolkit-sysext.bst line, which this PR removes, so unit will fail. Please update the test to the helper call, and add a summary plus "Closes #638" to the body. This overlaps #649 and the two conflict; I'd keep this one, since it covers both halves of #638.

Assisted-by: OpenAI Codex
Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
@jeefy

jeefy commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign ahmedadan after the PR has been reviewed.
You can assign the PR to them by writing /assign @ahmedadan in a comment when ready.

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

@Karibhou

Copy link
Copy Markdown
Contributor Author

Thanks for the review. f088868 updates the NVIDIA Container Toolkit assertion to check the helper call and its output prefix; the NVIDIA, homelab and export-contract tests passed (54 tests). just validate also passed. I added the requested summary and Closes #638 to the PR body. Full fork CI still needs maintainer authorization. — hive: backend=codex

@hivecommons-hive

Copy link
Copy Markdown
Contributor

The hive adopted this PR (stage/074-adopted-by-hive) but its head f088868c857d has not moved for 12h5m and the hive has nothing it can push: adoption-stalled:fork-rehome-refused.

Blocker: the review swarm's latest verdict on f088868c857d is changes_requested and no fix landed.

The hive would move this to stage/085-needs-decision, but the write-back gate keeps its labels off this PR (backfill-off — #646 was created 2026-11-10T00:17:38Z, before hive could write to projectbluefin/server (2026-11-10T17:52:55Z); writeback.unsolicited.backfill is off), so no label changes here. The hive tracks it at stage/085-needs-decision and lists it on the dashboard so a person sees it. This is not a merge-approval wait: the lane has not admitted this head.

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

Approving. The shared helper no longer wipes dist/sysext/, which fixes the bug in #638 where exporting k0s deleted the other add-ons. A re-export now replaces its own checksum line instead of appending a duplicate. All nine export recipes call the helper, and the contract tests check that each recipe's file prefix matches its element's image name. The NVIDIA Container Toolkit test is updated and unit passes at this head. zizmor is red on every server PR (#651); #626, now in the merge queue, fixes it. This conflicts with #649, and we're keeping this one because it covers both halves of #638.

@Danathar

Copy link
Copy Markdown
Contributor

/lgtm

@Danathar

Copy link
Copy Markdown
Contributor

/approve

@jeefy jeefy added approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Nov 13, 2026
@jeefy

jeefy commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danathar

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

@jeefy

jeefy commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danathar

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

@jeefy jeefy removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 16, 2026
@jeefy
jeefy added this pull request to the merge queue Nov 16, 2026
Merged via the queue into projectbluefin:main with commit a23e0e4 Nov 16, 2026
21 checks passed
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[architect] Add-on export commands are copy-pasted per add-on and have drifted (Kubernetes export wipes the others)

3 participants