Skip to content

test(bundle): drive commandLines' fence-closer, indented-code and info-string guards through dist/index.js - #324

Merged
github-actions[bot] merged 3 commits into
mainfrom
quality/test-bundle-command-markdown
Oct 9, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
quality/test-bundle-command-markdown

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Files: __tests__/bundle/commandMarkdown.test.ts (new, bundle e2e). Cluster: src/utils/command.ts commandLines() / fenceOpener() / closesFence() — the Markdown-code guards — driven through dist/index.js with /hold as the probe. No src/, no helpers.ts, no existing suite touched; disjoint from every open held bundle PR (repoLabels() in helpers.ts is #246's, so this suite inlines its single labels route).

13 issue_comment cases:

  • fires once after Markdown code that ends — closed ``` and ~~~ fences, a ```` fence closed by a longer closer, a closer with trailing whitespace, a backtick opener disqualified by a backtick in its info string (CommonMark), and an indented paragraph continuation — asserting the full request sequence (configReads(), GET /labels, one POST /issues/1/labels with do-not-merge/hold)
  • no API call for a /hold inside a fence that a shorter closer, a different fence character, or a closer with trailing text does not close; indented code after a blank line or at the start of the body; tab-indented code; and a later line of an indented block

Measured with npm run test:coverage:e2e on main @ 3fc21f2: command.ts 87.09 → 98.38 % lines, 79.41 → 94.11 % branches (previously only the unclosed-fence /kind case in bundle.test.ts reached commandLines' Markdown handling). The remainder — getLineArgs' ?? '' (L23) and getCommandArgs' throw (L38) — is unreachable from the dispatcher, which gates every handler on hasCommand.

Verified locally: npx vitest run __tests__/bundle/commandMarkdown.test.ts → 13 pass; npx eslint and npx tsc --noEmit clean.

Related Issue

Closes #323


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

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

…o-string guards through dist/index.js

Adds __tests__/bundle/commandMarkdown.test.ts: 13 issue_comment cases using
/hold as the probe. Six assert the command fires once after Markdown code
that ends (closed backtick/tilde fences, a longer closer, a closer with
trailing whitespace, a backtick opener disqualified by a backtick in its
info string, an indented paragraph continuation); seven assert no API call
for a /hold inside a fence a shorter/different/trailing-text line does not
close, indented code after a blank line or at the start of the body,
tab-indented code, and a later line of an indented block.

src/utils/command.ts end-to-end coverage (npm run test:coverage:e2e):
87.09 -> 98.38 % lines, 79.41 -> 94.11 % branches. No src/, helpers.ts or
existing suite is changed.

Closes #323

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 5, 2026 09:30
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 5, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

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

Only 3 of the 13 rows add coverage: :42 (command.ts:135), :43 (a branch at :109) and :61 (:102–105, 110–111). bundle.test.ts:263 already closes its ``` fence, so closing a fence is already covered.

  • Drop commandMarkdown.test.ts:38–41 and :58–60. main already reaches every line and branch they do (command.ts:94–96, 133–147).
  • Drop :62–64. They repeat what :61 reaches.

quality added 2 commits October 7, 2026 21:50
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed: dropped the ten rows main already reaches; the three remaining rows are the ones you measured as new (command.ts:135, the :109 branch, and :102–105/110–111). Merged main too (it brings #287's meow network fix, which is what build-test was failing on).


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: unknown

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in a64d268: kept only the three rows that reach new command.ts lines; the fence/indented rows main already covers are dropped.

CI is green on the new head.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 1f7d33c

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

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

Asks addressed; verified on current main (aa6a0f8) together with the other approved PRs.

@jeefy

jeefy commented Oct 9, 2026

Copy link
Copy Markdown
Member

/kind cleanup
/lgtm
/approve
/hold cancel

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 9, 2026
@github-actions
github-actions Bot merged commit 2aaecfa into main Oct 9, 2026
10 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-bundle-command-markdown branch October 9, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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] commandLines' Markdown code guards (fence closer, indented code, info-string opener) are never reached by the bundle e2e suite

1 participant