Skip to content

[quality] scripts: add regression suite for netlify-ignore.sh - #6844

Open
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-netlify-ignore
Open

[quality] scripts: add regression suite for netlify-ignore.sh#6844
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-netlify-ignore

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds scripts/test_netlify-ignore.sh — a self-contained bash regression suite for scripts/netlify-ignore.sh.

Why

netlify-ignore.sh is wired into netlify.toml:

ignore = "/bin/bash scripts/netlify-ignore.sh"

and runs on every Netlify build. It exits 0 to SKIP a build (for chore/hive-snapshot* branches) and 1 to proceed. The script had zero test coverage — a regex regression silently burns Netlify build minutes on snapshot branches or, worse, skips real PR builds. This is the highest-risk of the 8 untested scripts/ shell scripts flagged in #6842 because it directly gates CI resource consumption.

Coverage added

10 assertions, stdlib-only bash + coreutils (no framework, no network), each isolated with env -i:

Skip cases (exit 0):

  • BRANCH is chore/hive-snapshot-2026-09-09
  • BRANCH is bare chore/hive-snapshot
  • HEAD is a hive snapshot (BRANCH empty)
  • Both BRANCH and HEAD are hive snapshots

Proceed cases (exit 1):

  • Regular feature branch (feat/add-a-page)
  • main
  • Empty env (scheduled Netlify build)
  • Middle-substring guard: docs/hive-snapshot-notes proceeds (pins that the glob is prefix-anchored)

Diagnostic contract:

  • Debug preamble [netlify-ignore] BRANCH=… present on both proceed and skip

Runs locally

$ bash scripts/test_netlify-ignore.sh
Result: 10 passed, 0 failed

Wired-into-CI is deliberately out of scope (see workflows note below).

Scope

Refs #6842 — partial fix (1 of 8 untested scripts/ covered — netlify-ignore.sh only). The remaining 7 scripts (update-version.js, generate-shared-config.ts, add-repo-breakdown.mjs, create-version-branches.sh, migrate-version.sh, verify-site-health.sh, and the leaderboard .mjs set) are still uncovered and #6842 remains open to track them. Not adding a workflow to run this file yet — that's a follow-up.


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-opus-4.7

netlify-ignore.sh is called by Netlify (netlify.toml line 8) on every deploy-preview build and decides skip (exit 0) vs proceed (exit 1). It had no tests — a regex regression silently either burns build minutes on hive snapshot branches or, worse, skips real PR builds.

Adds scripts/test_netlify-ignore.sh, a self-contained bash harness (env -i to isolate each case) with 10 assertions covering: hive snapshot BRANCH, hive snapshot HEAD, both set, bare chore/hive-snapshot, regular feature branch, main, empty env, middle-substring guard against a well-meaning branch name, and preamble-present pins on both outcomes.

Refs #6842 (partial fix: covers 1 of the 8 untested scripts identified in that issue — netlify-ignore.sh only; remaining 7 scripts still uncovered).

Signed-off-by: kubestellar-hive[bot] <223556219+Copilot@users.noreply.github.com>
@kubestellar-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human sign-off on the direction, not on the code.

This PR's only tracked rationale is #6842, which the hive filed itself — issue #6842 was filed by kubestellar-hive[bot] and no human has acknowledged it. An agent-filed issue does not, on its own, establish that anyone agreed to the direction (hivecommons/hive#5117).

The change may well be right; nothing here is a review of it. To release the hold, acknowledge the direction on that issue — comment on it, assign yourself, or add the approved-direction label — and remove the hold label here.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Sep 9, 2026
@kubestellar-prow

Copy link
Copy Markdown

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

@netlify

netlify Bot commented Sep 9, 2026

Copy link
Copy Markdown

Deploy Preview for kubestellar-docs ready!

Name Link
🔨 Latest commit 3dbfbe1
🔍 Latest deploy log https://app.netlify.com/projects/kubestellar-docs/deploys/6aa1ebac7ff5520009b9dcde
😎 Deploy Preview https://deploy-preview-6844--kubestellar-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 9, 2026
@kubestellar-prow

Copy link
Copy Markdown

Hi @kubestellar-hive[bot]. Thanks for your PR.

I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@kubestellar-prow kubestellar-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 9, 2026
@kubestellar-prow kubestellar-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 10, 2026
@kubestellar-prow

Copy link
Copy Markdown

PR needs rebase.

Details

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.

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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