Skip to content

test(homelab): cover the join command's password sources and manual main-machine address - #604

Merged
jeefy merged 2 commits into
mainfrom
quality/test-bluefin-cluster-join
Nov 3, 2026
Merged

jeefy merged 2 commits into
mainfrom
quality/test-bluefin-cluster-join

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Summary: Adds automated tests for the command that lets a machine join a Bluefin Server home cluster. They check two setup paths nothing tested before: reading the join password from a protected system file, and joining a main machine given by address. A mistake in either would otherwise only show up as a machine that silently fails to join.


Test Improvement

The weekly homelab-cluster e2e scenario always sets the passphrase in homelab.conf and finds the control plane over mDNS, so the credential fallback in nodePassphrase and the HOMELAB_CONTROL_PLANE branch of attempt run in no test. The package had no _test.go.

New cmd/bluefin-cluster/main_test.go (tempdirs and loopback only, no root):

  • nodePassphrase: conf value wins over the credential and is normalised; falls back to $CREDENTIALS_DIRECTORY/bluefin-cluster.passphrase; the missing-passphrase error names the key, the conf path and the credential; non-ASCII refused.
  • attempt with a manual control plane against a real join.Server on 127.0.0.1: success payload; wrong passphrase → join.ErrNotProven naming the address; bad ports (0, 65536, http) refused.

Paths hardcoded under /var/lib and /run (controlPlanePassphrase, publish, writeIssue) are left alone: testing them needs a production change.

Validation: gofmt -l clean and the file type-checks with go build; go test cannot run on the agent host, so the CI go job (go test -race ./...) is the first execution.

Fixes #603


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-opus-5.5 copilot=1.0.88

@jeefy
jeefy requested review from daegalus and hanthor November 2, 2026 21:09
@jeefy

jeefy commented Nov 2, 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 Author

zizmor is red for a reason outside this PR, and the fix needs a human push.

Cause: upstream taiki-e/install-action moved its floating v2 tag from 1919c4a (v2.89.0) to 682ce6c (v2.89.1). The repo pins 1919c4a… # v2 (from #601), so zizmor's ref-version-mismatch check now fails on all 7 uses. main will fail the same way on its next run. This PR's diff does not touch these lines.

Fix: change the version comment to the exact tag, with no change to the SHA:

sed -i 's|install-action@1919c4a95903d2c33e4a221102edca87309fc14b # v2$|install-action@1919c4a95903d2c33e4a221102edca87309fc14b # v2.89.0|' .github/workflows/*.yml

(build.yml:142,182,222,297; reproducibility.yml:64; track-junctions.yml:45; unit-tests.yml:45)

The agent could not push this because its GitHub App token lacks workflows permission. A maintainer needs to apply it, either here or as a small PR to main followed by a rebase of this branch.


🐝 Hive Agent: quality | Instance: hosted-projectbluefin-knuckle-gjvq | SHA: 05905a03491b7c63d2e864f0fad457fbd2c96264

— hive: agent=quality backend=copilot model=claude-opus-5.5 copilot=1.0.88

…trol plane

nodePassphrase's credential fallback and attempt's HOMELAB_CONTROL_PLANE
path are not reached by the homelab-cluster e2e scenario, which uses
homelab.conf and mDNS. Test them against a loopback join server.

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive
hivecommons-hive Bot force-pushed the quality/test-bluefin-cluster-join branch from 205d269 to 02abe93 Compare November 2, 2026 22:33
@jeefy

jeefy commented Nov 2, 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 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.

Reviewed — no findings from correctness, security, intent-alignment, style, docs-currency.

Confidence: 5/5 (safe)

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@jeefy

jeefy commented Nov 2, 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

…test.go

#591 adds cmd/bluefin-cluster/main_test.go with its own nodePassphrase
cases, so this file moves to join_test.go and drops the three cases
that duplicate them (conf beats credential, credential fallback,
non-ASCII). Kept: the missing-passphrase error naming its sources and
the manual-control-plane joins against a loopback join.Server.

Assisted-by: Claude Opus 5.5 via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jeefy

jeefy commented Nov 3, 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

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

Moved to join_test.go and trimmed to the cases #591's main_test.go does not cover, so the two land together; go vet + go test pass on this branch alone and merged with #591.

@jeefy
jeefy enabled auto-merge November 3, 2026 02:56
@jeefy

jeefy commented Nov 3, 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

@jeefy
jeefy added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 88b4a26 Nov 3, 2026
23 checks passed
@jeefy jeefy added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 3, 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. lgtm "Looks good to me", indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] Joining a machine to a home cluster: two setup paths have no tests

1 participant