Skip to content

fix: unify all scripts to use vendored minimatch, remove minimatch-lite.js#1433

Merged
stranske merged 2 commits intomainfrom
fix/unify-minimatch-imports
Feb 10, 2026
Merged

fix: unify all scripts to use vendored minimatch, remove minimatch-lite.js#1433
stranske merged 2 commits intomainfrom
fix/unify-minimatch-imports

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Feb 10, 2026

Source: Issue #1425

Automated Status Summary

Scope

PR #1409 (issue #1407) merged with CONCERNS from both verify:compare providers (openai 78%, anthropic 85%). The core unresolved concern is that custom regex-based glob matching was supposed to be replaced with a standard minimatch library, but:

  1. bot-comment-dismiss.js still defines ~140 lines of custom glob functions instead of importing minimatch.
  2. The vendored minimatch at .github/scripts/node_modules/minimatch/ is a 0.0.0-local reimplementation, not the real npm package.
  3. Consumer repos will break on sync — template files pr-context-graphql.js and merge_manager.js both require('minimatch'), but the template directory has no node_modules/minimatch/ and the sync manifest does not include it.

Context for Agent

Related Issues/PRs

Tasks

Replace custom glob in bot-comment-dismiss.js

  • Remove the inline escapeRegExp, expandBraces, globToRegExp, and minimatch functions (lines 21–163) from .github/scripts/bot-comment-dismiss.js
  • Add const { minimatch } = require('minimatch'); import at the top of bot-comment-dismiss.js
  • Update shouldIgnorePath in bot-comment-dismiss.js to call minimatch(normalized, pattern, { dot: true, nocomment: true, nonegate: true }) — matching the options used in merge_manager.js
  • Apply the identical changes to templates/consumer-repo/.github/scripts/bot-comment-dismiss.js

Standardize the vendored minimatch module

  • Replace .github/scripts/node_modules/minimatch/package.json version from 0.0.0-local to 10.0.1-vendored (or current real minimatch major) and add a comment in the file explaining it is a vendored subset
  • Verify existing tests pass with the vendored module: node --test .github/scripts/__tests__/bot-comment-dismiss.test.js && node --test tests/test/dismiss/dismiss-bot-comment.test.js

Fix consumer repo sync for minimatch

  • Copy .github/scripts/node_modules/minimatch/ to templates/consumer-repo/.github/scripts/node_modules/minimatch/
  • Copy .github/scripts/package.json to templates/consumer-repo/.github/scripts/package.json
  • Add the node_modules/minimatch/ directory and package.json to .github/sync-manifest.yml under the scripts section
  • Verify the sync manifest health check passes

Standardize minimatch options

  • Ensure bot-comment-dismiss.js, pr-context-graphql.js, and merge_manager.js all use consistent minimatch options ({ dot: true, nocomment: true, nonegate: true })
  • Verify all JS tests still pass: node --test .github/scripts/__tests__/*.test.js && node --test tests/test/dismiss/*.test.js

Acceptance criteria

  • bot-comment-dismiss.js does NOT contain any of: function escapeRegExp, function expandBraces, function globToRegExp, or a local function minimatch.
    Verification: grep -c "function escapeRegExp\|function expandBraces\|function globToRegExp" .github/scripts/bot-comment-dismiss.js returns 0.
  • bot-comment-dismiss.js imports minimatch via require('minimatch').
    Verification: grep -c "require.*minimatch" .github/scripts/bot-comment-dismiss.js returns 1.
  • Template copy matches: diff .github/scripts/bot-comment-dismiss.js templates/consumer-repo/.github/scripts/bot-comment-dismiss.js exits 0.
  • Consumer template has node_modules/minimatch/: test -f templates/consumer-repo/.github/scripts/node_modules/minimatch/index.js exits 0.
  • All existing JS tests pass: node --test .github/scripts/__tests__/*.test.js && node --test tests/test/dismiss/*.test.js exits 0.
  • Glob matching behavior is unchanged: brace expansion (src/*.{ts,tsx}), character classes (src/[ab].ts), and escaped metacharacters (docs/\\[draft\\].md) continue to pass.
    Verification: tests in bot-comment-dismiss.test.js and dismiss-bot-comment.test.js cover these patterns and pass.

Head SHA: bea55c4
Latest Runs: ✅ success — Gate
Required: gate: ✅ success

Workflow / Job Result Logs
Agents PR meta manager ❔ in progress View run
CI Autofix Loop ✅ success View run
Gate ✅ success View run
Health 40 Sweep ✅ success View run
Health 44 Gate Branch Protection ❔ in progress View run
Health 45 Agents Guard ✅ success View run
Health 50 Security Scan ✅ success View run
Health 72 Template Sync ✅ success View run
Health 73 Template Completeness ✅ success View run
Maint 52 Validate Workflows ✅ success View run
PR 11 - Minimal invariant CI ✅ success View run
Selftest CI ✅ success View run
Validate Sync Manifest ✅ success View run

…te.js

PR #1426 resolved custom glob removal in bot-comment-dismiss.js but
introduced minimatch-lite.js (a copy of the old custom code) used by
merge_manager.js and pr-context-graphql.js. This created inconsistency
(one script using vendored minimatch, two using custom lite version)
and a consumer repo breakage risk since minimatch-lite.js was not in
the templates directory or sync manifest.

Changes:
- merge_manager.js: require('./minimatch-lite.js') → require('minimatch')
- pr-context-graphql.js: require('./minimatch-lite.js') → require('minimatch')
- Delete .github/scripts/minimatch-lite.js (176-line custom reimplementation)
- Update template copies to match

All 767 JS tests pass. Addresses verify:compare FAIL from issue #1425.
Copilot AI review requested due to automatic review settings February 10, 2026 06:54
@stranske-keepalive
Copy link
Copy Markdown
Contributor

stranske-keepalive bot commented Feb 10, 2026

Automated Status Summary

Head SHA: 5bde019
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / guard
Required: core tests (3.11): ⏳ pending, core tests (3.12): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 93.12%
Baseline 85.00%
Delta +8.12%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
src/cli_parser.py 81.8% 4
src/percentile_calculator.py 95.0% 1
src/aggregator.py 95.0% 2
src/__init__.py 100.0% 0
src/ndjson_parser.py 100.0% 0

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

PR #1409 (issue #1407) merged with CONCERNS from both verify:compare providers (openai 78%, anthropic 85%). The core unresolved concern is that custom regex-based glob matching was supposed to be replaced with a standard minimatch library, but:

  1. bot-comment-dismiss.js still defines ~140 lines of custom glob functions instead of importing minimatch.
  2. The vendored minimatch at .github/scripts/node_modules/minimatch/ is a 0.0.0-local reimplementation, not the real npm package.
  3. Consumer repos will break on sync — template files pr-context-graphql.js and merge_manager.js both require('minimatch'), but the template directory has no node_modules/minimatch/ and the sync manifest does not include it.

Context for Agent

Related Issues/PRs

Tasks

Replace custom glob in bot-comment-dismiss.js

  • Remove the inline escapeRegExp, expandBraces, globToRegExp, and minimatch functions (lines 21–163) from .github/scripts/bot-comment-dismiss.js
  • Add const { minimatch } = require('minimatch'); import at the top of bot-comment-dismiss.js
  • Update shouldIgnorePath in bot-comment-dismiss.js to call minimatch(normalized, pattern, { dot: true, nocomment: true, nonegate: true }) — matching the options used in merge_manager.js
  • Apply the identical changes to templates/consumer-repo/.github/scripts/bot-comment-dismiss.js

Standardize the vendored minimatch module

  • Replace .github/scripts/node_modules/minimatch/package.json version from 0.0.0-local to 10.0.1-vendored (or current real minimatch major) and add a comment in the file explaining it is a vendored subset
  • Verify existing tests pass with the vendored module: node --test .github/scripts/__tests__/bot-comment-dismiss.test.js && node --test tests/test/dismiss/dismiss-bot-comment.test.js

Fix consumer repo sync for minimatch

  • Copy .github/scripts/node_modules/minimatch/ to templates/consumer-repo/.github/scripts/node_modules/minimatch/
  • Copy .github/scripts/package.json to templates/consumer-repo/.github/scripts/package.json
  • Add the node_modules/minimatch/ directory and package.json to .github/sync-manifest.yml under the scripts section
  • Verify the sync manifest health check passes

Standardize minimatch options

  • Ensure bot-comment-dismiss.js, pr-context-graphql.js, and merge_manager.js all use consistent minimatch options ({ dot: true, nocomment: true, nonegate: true })
  • Verify all JS tests still pass: node --test .github/scripts/__tests__/*.test.js && node --test tests/test/dismiss/*.test.js

Acceptance criteria

  • bot-comment-dismiss.js does NOT contain any of: function escapeRegExp, function expandBraces, function globToRegExp, or a local function minimatch.
    Verification: grep -c "function escapeRegExp\|function expandBraces\|function globToRegExp" .github/scripts/bot-comment-dismiss.js returns 0.
  • bot-comment-dismiss.js imports minimatch via require('minimatch').
    Verification: grep -c "require.*minimatch" .github/scripts/bot-comment-dismiss.js returns 1.
  • Template copy matches: diff .github/scripts/bot-comment-dismiss.js templates/consumer-repo/.github/scripts/bot-comment-dismiss.js exits 0.
  • Consumer template has node_modules/minimatch/: test -f templates/consumer-repo/.github/scripts/node_modules/minimatch/index.js exits 0.
  • All existing JS tests pass: node --test .github/scripts/__tests__/*.test.js && node --test tests/test/dismiss/*.test.js exits 0.
  • Glob matching behavior is unchanged: brace expansion (src/*.{ts,tsx}), character classes (src/[ab].ts), and escaped metacharacters (docs/\\[draft\\].md) continue to pass.
    Verification: tests in bot-comment-dismiss.test.js and dismiss-bot-comment.test.js cover these patterns and pass.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR completes the “single shared minimatch” cleanup by removing the temporary minimatch-lite.js shim and standardizing all affected scripts (including consumer templates) to import the vendored minimatch module directly.

Changes:

  • Switch merge_manager.js and pr-context-graphql.js (source + templates) from require('./minimatch-lite.js') to require('minimatch').
  • Delete .github/scripts/minimatch-lite.js now that it has no remaining consumers.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/scripts/pr-context-graphql.js Uses the shared vendored minimatch module instead of a local shim.
.github/scripts/merge_manager.js Uses the shared vendored minimatch module instead of a local shim.
.github/scripts/minimatch-lite.js Removed (no longer referenced).
templates/consumer-repo/.github/scripts/pr-context-graphql.js Mirrors the source script import change for consumer sync correctness.
templates/consumer-repo/.github/scripts/merge_manager.js Mirrors the source script import change for consumer sync correctness.

@stranske-keepalive
Copy link
Copy Markdown
Contributor

stranske-keepalive bot commented Feb 10, 2026

🤖 Keepalive Loop Status

PR #1433 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Disposition skipped (transient)
Gate success
Tasks 0/18 complete
Timeout 45 min (default)
Timeout usage 3m elapsed (8%, 42m remaining)
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b487f9ddb4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…h) for consumer repos

The vendored minimatch requires brace-expansion at runtime, which in turn
requires balanced-match. Without these transitive dependencies in the
template node_modules, consumer repos would hit MODULE_NOT_FOUND when
running reusable-pr-context.yml or merge_manager.js.

Changes:
- Copy brace-expansion/ and balanced-match/ to templates/consumer-repo/
  .github/scripts/node_modules/
- Add both to .github/sync-manifest.yml so they get synced to consumers

Addresses review feedback on PR #1433.
@stranske stranske temporarily deployed to agent-high-privilege February 10, 2026 07:18 — with GitHub Actions Inactive
@stranske stranske merged commit 4931e81 into main Feb 10, 2026
219 checks passed
@stranske stranske deleted the fix/unify-minimatch-imports branch February 10, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants