Skip to content

ci: run markdownlint via npm script to exercise overridden re2js - #518

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:mainfrom
odttlnt:fix/517-ci-markdownlint-use-npm-script
Oct 30, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:mainfrom
odttlnt:fix/517-ci-markdownlint-use-npm-script

Conversation

@odttlnt

@odttlnt odttlnt commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

📌 Fixes

Fixes #517


📝 Summary of Changes

The Markdown Lint CI workflow used DavidAnson/markdownlint-cli2-action which bundles its own copy of markdownlint/re2js, completely bypassing the "re2js": ">=2.8.7" override in package.json. This meant the CI job never validated the locally installed markdownlint-cli2 against the pinned re2js version — the 'lints cleanly on re2js 2.9.1' claim in PR #516 was local-only.

This PR replaces the GitHub Action with:

  1. actions/setup-node (node 22, same as typecheck.yml / build.yml)
  2. npm ci — installs the exact locked tree including the overridden re2js
  3. npm run lint:md — the repo's own script, already defined in package.json

This makes CI exercise the same markdownlint-cli2 + re2js combination that developers run locally, closing the correctness gap filed in #517.


Changes Made

  • Replaced DavidAnson/markdownlint-cli2-action with setup-node + npm ci + npm run lint:md in .github/workflows/markdownlint-cli2.yml

Checklist

Security Considerations

  • CI/CD workflows — inspected for command injection or credential exposure. This change removes a third-party action's bundled dependency and replaces it with the repo's own npm install; no new credentials or command injection surface.
  • Dockerfiles — not applicable
  • Kubernetes manifests — not applicable
  • Dependencies — not applicable (no new deps)
  • Security configs — not applicable

— hive: backend=bob model=premium

The Markdown Lint workflow used DavidAnson/markdownlint-cli2-action which
bundles its own copy of markdownlint/re2js, completely bypassing the
`"re2js": ">=2.8.7"` override in package.json (overrides). As a result,
the CI job never validated that the locally installed markdownlint-cli2
works correctly with the pinned re2js version.

Replace the GitHub Action with:
  1. actions/setup-node (same version used by typecheck.yml and build.yml)
  2. npm ci  — installs the exact locked tree including the overridden re2js
  3. npm run lint:md — the repo's own lint:md script, already defined in
     package.json and exercised locally

This makes CI exercise the same markdownlint-cli2 + re2js combination that
developers run locally, closing the gap identified in issue hivecommons#517.

Closes hivecommons#517

Hive-Run: hivecommons#517
Hive-Plan: correctness/ci-gate
Hive-Spec: review-backlog#correctness
Signed-off-by: SACHIN NAIK <[email protected]>
@netlify

netlify Bot commented Oct 29, 2026

Copy link
Copy Markdown

👷 Deploy request for hivecommons-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit b2b4df7

@hivecommons-hive

Copy link
Copy Markdown
Contributor
b2b4df7

⚠️ Sentinel alert — maintainer review required

Hive flagged this PR (author @odttlnt, head b2b4df7cff8b) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation — a maintainer should confirm the change is intended before it merges.

  • sensitive_path — changes 1 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • .github/workflows/markdownlint-cli2.yml

Hive added the sentinel-alert label. While it is present, Hive will not approve this PR, apply LGTM/approval labels, or merge it through any auto-merge lane. Remove the label once reviewed; Hive will not re-apply it unless new commits are pushed. Tune paths and behaviors under sentinel in hive.yaml or the dashboard Security tab.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Decision needed: @clubanderson should decide whether to accept this workflow change as-is (the lint job still only triggers on README/CONTRIBUTING/docs/** path changes, so a re2js/package-lock bump never runs it) or require the paths: filter to also include package.json, package-lock.json and the workflow file itself.

Routing to a human: this edits .github/workflows/ and carries sentinel-alert. Workflow trust decisions belong to a CODEOWNER (.github/CODEOWNERS names @clubanderson / @KPRoche for /.github/workflows/).

The steps themselves look correct, but the change does not fully close #517 as filed:

  1. The lint job did not run on this PR. .github/workflows/markdownlint-cli2.yml:3-9 (unchanged) restricts pull_request to paths: README.md, CONTRIBUTING.md, docs/**/*.md, docs/**/*.mdx. This PR touches only the workflow file, so no markdownlint check-run exists on head b2b4df7 (check-runs list: TypeScript & ESLint, Audit, unit tests, Lint and build, DCO). The new npm ci + npm run lint:md steps are therefore still unexercised by CI — the same "local-only" condition #517 complains about.
  2. A re2js bump still won't trigger it. #517's trigger was PR #516 (a package.json override bump). With the paths: filter unchanged, a future package.json / package-lock.json change does not run this job either, so CI still never validates the overridden re2js against the locked tree on the PR that changes it. Adding package.json, package-lock.json and .github/workflows/markdownlint-cli2.yml to paths: would close that gap.
  3. Scope note, not a defect: package.json:15 lint:md also globs src/**/*.{md,mdx}, which the old action did not lint. There are currently no .md/.mdx files under src/ on main, so this is a no-op today, but it widens what the job will lint in future.

Verified: the actions/setup-node@949feb2… pin and node-version: "22" / cache: "npm" match typecheck.yml:26-30 exactly; npm ci + the repo's own script mirrors that workflow's pattern.

I have not approved or changed anything.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Decision needed: @clubanderson should decide whether this CODEOWNERS-protected workflow change (replacing the pinned markdownlint-cli2 action with setup-node + npm ci + npm run lint:md) is acceptable from a fork contributor; note the modified workflow did not run on this PR.

Change does what #517 asks, verified locally; routing because it edits .github/workflows/ from a fork and carries sentinel-alert.

What I checked at b2b4df7:

  • package.json:15 defines lint:md and package.json:85 carries the re2js >=2.8.7 override, so npm ci + npm run lint:md really does exercise the overridden re2js, which is the gap #517 names.
  • actions/setup-node@949feb2… is the same pin used by build.yml:28, typecheck.yml:27, vitest.yml:27, etc. — consistent with repo convention.
  • Ran npm ci && npm run lint:md on a clean clone of this head: Linting: 85 files / Summary: 0 issues in 0 files.
  • The lint:md glob also includes src/**/*.{md,mdx}, which the old action globs did not; there are currently no markdown files under src/, so no scope change in practice.

One thing a maintainer should know before merging: this PR's checks did not run the workflow it changes. markdownlint-cli2.yml:4-10 triggers only on paths: README.md, CONTRIBUTING.md, docs/**, and this PR touches only the workflow file — the markdownlint job is absent from the status rollup. The green checks here are the other workflows. The local run above is the only evidence the new job passes; if you want CI to self-validate, adding .github/workflows/markdownlint-cli2.yml to the paths: list would do it (optional).

I have not approved or merged anything.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge:

  • the reviewer swarm returned requires_human @b2b4df7
  • reviewer question: @clubanderson should decide whether this CODEOWNERS-protected workflow change (replacing the pinned markdownlint-cli2 action with setup-node + npm ci + npm run lint:md) is acceptable from a fork contributor; note the modified workflow did not run on this PR.
  • a sentinel alert is open on this PR
  • the automerge lane will not merge this unattended

Head: verdict requires_human @b2b4df7, 4/4 checks green, DCO yes, sentinel alert, soak 30m0s elapsed.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed. An ordinary contributor cannot release their own PR.
  • Resolve the sentinel alert and have a maintainer clear its label.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

@kubestellar-prow

Copy link
Copy Markdown

@hivecommons-hive[bot]: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

/approve

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hivecommons-hive[bot]
Once this PR has been reviewed and has the lgtm label, please assign clubanderson 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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson approved head b2b4df7cff8b, which edits CI workflow / action files. That explicit owner approval releases the contributor lane's workflow-path fence: the hive merges this PR itself once the usual gates (CI, soak, holds, review verdict) are clear. A new push re-arms the fence until the new head is approved again.

@hivecommons-hive
hivecommons-hive Bot merged commit 018ab1e into hivecommons:main Oct 30, 2026
6 of 7 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#518b2b4df7` sha256:6ea7f2075dbf31c72229612c3fac67d3464983946c7c54dd1392f856c4efcb3a — download from the dashboard or `hivectl review evidence #518`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Merged by hive contributor-lane auto-merge: CI green for ≥30m, reviewer verdict not required, @clubanderson approved this head as the owner decision (admitted_by: operator-approval:clubanderson) — merged as-is on that approval.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review backlog (correctness): Overridden re2js is not exercised by CI markdownlint

1 participant