Skip to content

[quality] test: pin degraded-boot branches of MergeLayersYAML/MergeLayersWithFallback + PauseIsOperatorOwned - #5746

Merged
clubanderson merged 1 commit into
v4from
quality/test-layers-yaml-boot-branches
Sep 3, 2026
Merged

[quality] test: pin degraded-boot branches of MergeLayersYAML/MergeLayersWithFallback + PauseIsOperatorOwned#5746
clubanderson merged 1 commit into
v4from
quality/test-layers-yaml-boot-branches

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds src/pkg/config/layers_yaml_boot_branches_test.go pinning the previously untested degraded-boot branches in src/pkg/config/layers_yaml.go and the pause-ownership predicate in src/pkg/config/config.go:

  • MergeLayersYAML (58.8% → 100%):
    • unparsable seed returns an error instead of booting an empty config
    • absent overlay (first boot) uses the seed with no rejection reported
    • malformed non-YAML overlay (distinct from parseable-but-implausible, which layers_guard_test.go already covers) falls back to the seed with OverlayRejected and a parse-error reason
  • MergeLayersWithFallback (→ 95.5%): an unparsable last-good backup keeps the seed and leaves LastGoodUsed false — no phantom recovery
  • seedHasIsPublic (→ 100%): unparsable probe assumes hub.is_public present, preserving fleet visibility semantics
  • PauseIsOperatorOwned (0% → 100%): the ACMM pack visibility sweep immunity marker (ACMM pack apply re-pauses operator-created non-pack agents on every boot #5706) matches exactly operator — empty/pack/case-variant owners do not grant immunity

The only remaining uncovered branch in MergeLayersWithFallback is the seed re-unmarshal failure at layers_yaml.go:113, which is unreachable when MergeLayersYAML has already parsed the same bytes.

Cluster claimed: src/pkg/config/layers_yaml.go (MergeLayersYAML, MergeLayersWithFallback, seedHasIsPublic) and src/pkg/config/config.go (PauseIsOperatorOwned). Disjoint from open PRs #5697 (pkg/hub wrapkey), #5705/#5728 (pkg/hub alerts/remediation), #5720 (scheduler reviewer-lane), #5711 (dashboard contribute activity), and the open lease-registry persist test PR.

Verified: go test ./pkg/config/ green (94.3% pkg coverage).


Filed by quality agent (hold-gated mode). Human review required.

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

…yersWithFallback and PauseIsOperatorOwned

Covers the previously untested branches in pkg/config/layers_yaml.go:
- unparsable seed returns an error (no empty-config boot)
- absent overlay uses the seed with no rejection reported
- malformed (non-YAML) overlay falls back to the seed with
  OverlayRejected + parse-error reason
- MergeLayersWithFallback keeps the seed when the last-good backup
  is itself unparsable (LastGoodUsed stays false)
- seedHasIsPublic assumes present on an unparsable probe

Also pins the PauseIsOperatorOwned predicate (pkg/config/config.go)
the ACMM pack visibility sweep consults (#5706): exact 'operator'
marker only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: hive-quality <quality@hive.local>
@kubestellar-hive kubestellar-hive Bot added the hold label Sep 2, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 added dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 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.

@clubanderson clubanderson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed tests against pkg/config behavior rather than just accepting the assertions. The pinned degraded-boot branches match the documented MergeLayersYAML/MergeLayersWithFallback contracts (seed parse fails closed, malformed overlay falls back loudly, unparsable last-good is ignored) and PauseIsOperatorOwned is exact-marker only. go build ./... and targeted pkg/config tests pass.

@kubestellar-prow kubestellar-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 3, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: c112364e714680c1d5391dcc625926560df2a56b

@clubanderson
clubanderson merged commit 9fed41b into v4 Sep 3, 2026
56 of 60 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-layers-yaml-boot-branches branch September 3, 2026 01:45
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

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

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. hold 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