Skip to content

[quality] test: cover Cadence serialization/formatting branches (pkg/config/cadence.go) - #6196

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

[quality] test: cover Cadence serialization/formatting branches (pkg/config/cadence.go)#6196
kubestellar-prow[bot] merged 1 commit into
v4from
quality/test-cadence-serialization-branches

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds src/pkg/config/cadence_branches_test.go covering ~25 previously untested branches in pkg/config/cadence.go (file coverage 87.1% → ~98%):

  • IsPaused — false for times/cron modes
  • String, MarshalJSON, MarshalYAML, HumanSummary, ShortLabel, cronSpecs — interval-mode branches
  • UnmarshalYAML decode error; UnmarshalJSON non-string/non-object error
  • Validate — missing-tz and invalid-day errors surfaced through JSON decode
  • NextAfter — invalid schedule, unparseable/negative/paused interval fail branches
  • DueOccurrence — interval last-kick due/not-due, default catch-up window, nothing-due window
  • HumanSummary — verbatim fallback for unparseable stored times
  • ShortLabel — configured-tz fallback when TimezoneAbbrev is empty (times and cron)
  • cronSpecs — skips unparseable times
  • daysSummary — every-day defaults and Mon–Fri collapse; joinHuman single/pair

Remaining uncovered lines in the file are unreachable defensive marshal-error paths (yaml/json Marshal of plain structs cannot fail; cron specs are pre-validated).

Disjoint from open quality PRs: no open PR touches pkg/config/cadence.go (#6185 deletes dead kick-cadence code in pkg/dashboard/status_builder.go only).

Verified: go test ./pkg/config/ passes (95.1% package coverage).


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

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

…config/cadence.go)

Covers previously untested branches in pkg/config/cadence.go:
- IsPaused false for times/cron modes
- String/MarshalJSON/MarshalYAML/HumanSummary/ShortLabel/cronSpecs interval branches
- UnmarshalYAML decode error and UnmarshalJSON non-object error
- Validate missing-tz and invalid-day errors surfaced via JSON decode
- NextAfter fail branches (invalid schedule, unparseable/negative/paused interval)
- DueOccurrence interval last-kick path, default catch-up window, nothing-due
- HumanSummary verbatim fallback for unparseable times
- ShortLabel configured-tz fallback when TimezoneAbbrev is empty
- cronSpecs skipping unparseable times
- daysSummary every-day defaults + Mon-Fri, joinHuman single/pair

pkg/config/cadence.go rises from 87.1% to ~98% file coverage; the only
uncovered lines left are unreachable defensive marshal-error paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: hive-quality <sec-check@hive.kubestellar.io>
@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
@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 486742e into v4 Sep 8, 2026
54 of 58 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-cadence-serialization-branches branch September 8, 2026 13:38
@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

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