Skip to content

[quality] test: cover pluk_dirs error/repair branches (ensurePlukLogFile, ensurePlukRunDirs) in src/pkg/agent/pluk_dirs.go - #6221

Merged
kubestellar-prow[bot] merged 1 commit into
v4from
quality/test-pluk-dirs-branches
Sep 8, 2026
Merged

[quality] test: cover pluk_dirs error/repair branches (ensurePlukLogFile, ensurePlukRunDirs) in src/pkg/agent/pluk_dirs.go#6221
kubestellar-prow[bot] merged 1 commit into
v4from
quality/test-pluk-dirs-branches

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds src/pkg/agent/pluk_dirs_branches_test.go covering the branches of src/pkg/agent/pluk_dirs.go the existing setgid-mode test never reaches:

  • ensurePlukLogFile creates the session log 0660 under a 0077 umask (the reason the file is created in Go, not by the pane shell's >>)
  • ensurePlukLogFile widens an existing 0600 log back to 0660 and appends (never truncates) — the documented inherit-from-earlier-run contract
  • ensurePlukLogFile error return when logs/ is missing: wrapped (errors.Is fs.ErrNotExist) and names the log path
  • ensurePlukRunDirs MkdirAll error return when a regular file squats on the run dir: wrapped and names the child dir
  • ensurePlukRunDirs re-widens pre-existing tightened dirs to 0770+setgid (Chmod repair path)

Coverage: ensurePlukLogFile 66.7% → 73.3%, ensurePlukRunDirs 60% → 70%. Remaining uncovered branches are root-only (os.Geteuid()==0 chown) or require an un-chmoddable file, unreachable in non-root CI.

Verified: go test -run TestEnsurePluk ./pkg/agent/ passes; go vet ./pkg/agent/ clean.

Disjointness

No open PR touches pkg/agent/pluk_dirs.go or the pluk helpers (checked the open hold-gated snapshot; nearest neighbors #6197 request-watcher and #6196 cadence touch different files).

Hold

This PR is hold-gated — do not merge without human review.


Opened by quality agent (hold-gated mode)

— hive: agent=quality backend=copilot model=claude-fable-5

…ile, ensurePlukRunDirs)

Covers the umask-independence and widen-existing-log contract documented in
pkg/agent/pluk_dirs.go, the OpenFile/MkdirAll error returns, and the
Chmod repair of pre-existing tightened dirs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: hive-quality <hive-quality@users.noreply.github.com>
@kubestellar-hive kubestellar-hive Bot added the hold label Sep 7, 2026
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but carries no changelog entry
(no changelog.d/ fragment and no CHANGELOG.md edit).

If it is user-visible — a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking —
please add a fragment file changelog.d/<category>-<pr-or-slug>.md
containing exactly your entry (see changelog.d/README.md; the
category is one of added/changed/deprecated/fixed/security). Please
do not append to CHANGELOG.md's ## Unreleased directly — that
shared section is the merge-conflict generator fragments replaced
(#5675). If it is a refactor, a test-only change, or dependency
churn, no entry is needed and you can ignore this.

This is a reminder, not a gate; it never blocks a merge.

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 7, 2026
@kubestellar-hive kubestellar-hive Bot added agent/quality Approved by a Hive merger/owner for auto-merge on green CI hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI labels Sep 7, 2026
@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed hold labels Sep 8, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

The pull request process is described here

Details 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

@kubestellar-prow
kubestellar-prow Bot merged commit 1e83b6e into v4 Sep 8, 2026
55 of 60 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-pluk-dirs-branches branch September 8, 2026 13:45
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

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

Labels

agent/quality Approved by a Hive merger/owner for auto-merge on green CI approved Indicates a PR has been approved by an approver from all required OWNERS files. copilot dco-signoff: yes Indicates the PR's author has signed the DCO. hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant