fix: add is_directory support to scripts sync section#1435
Conversation
The sync workflow's scripts processing loop always called sync_file(), which uses shutil.copy2() and fails on directories with IsADirectoryError. This broke sync for all 7 consumer repos when minimatch/, brace-expansion/, and balanced-match/ were added to the sync manifest as script entries. Changes: - Add is_directory check to scripts processing loop (matches actions and copilot_config sections) - Add is_directory: true to minimatch/, brace-expansion/, balanced-match/ entries in sync manifest Fixes #1432
🤖 Keepalive Loop StatusPR #1435 | Agent: Codex | Iteration 0/5 Current State
🔍 Failure Classification| Error type | infrastructure | |
Automated Status SummaryHead SHA: 3bfd08d
Coverage Overview
Coverage Trend
Top Coverage Hotspots (lowest coverage)
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeNo scope information available Tasks
Acceptance criteria
|
There was a problem hiding this comment.
Pull request overview
Fixes consumer repo sync failures caused by adding vendored node_modules/ directories to the scripts sync manifest, by teaching the sync workflow to copy directories in the scripts section.
Changes:
- Update
maint-68-sync-consumer-repos.ymlto supportis_directoryforscriptsmanifest entries and usesync_directory()when set. - Update
.github/sync-manifest.ymlto mark vendoredminimatch/,brace-expansion/, andbalanced-match/entries as directories.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/maint-68-sync-consumer-repos.yml |
Adds directory-aware syncing for scripts entries to avoid shutil.copy2() on directories. |
.github/sync-manifest.yml |
Marks vendored node_modules/*/ entries with is_directory: true so the sync workflow copies them correctly. |
The check_consumer_sync_drift.py script crashed with IsADirectoryError when encountering directory entries (minimatch/, brace-expansion/, balanced-match/) in the sync manifest. Extract file comparison into _check_file() helper and add directory handling that recursively compares all files within directory entries, matching the fix applied to the sync workflow in PR #1435.
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
minimatchlibrary, but:bot-comment-dismiss.jsstill defines ~140 lines of custom glob functions instead of importingminimatch.minimatchat.github/scripts/node_modules/minimatch/is a0.0.0-localreimplementation, not the real npm package.pr-context-graphql.jsandmerge_manager.jsbothrequire('minimatch'), but the template directory has nonode_modules/minimatch/and the sync manifest does not include it.Context for Agent
Related Issues/PRs
Context for Agent
Related Issues/PRs
Tasks
Replace custom glob in bot-comment-dismiss.js
escapeRegExp,expandBraces,globToRegExp, andminimatchfunctions (lines 21–163) from.github/scripts/bot-comment-dismiss.jsconst { minimatch } = require('minimatch');import at the top ofbot-comment-dismiss.jsshouldIgnorePathinbot-comment-dismiss.jsto callminimatch(normalized, pattern, { dot: true, nocomment: true, nonegate: true })— matching the options used inmerge_manager.jstemplates/consumer-repo/.github/scripts/bot-comment-dismiss.jsStandardize the vendored minimatch module
.github/scripts/node_modules/minimatch/package.jsonversion from0.0.0-localto10.0.1-vendored(or current real minimatch major) and add a comment in the file explaining it is a vendored subsetnode --test .github/scripts/__tests__/bot-comment-dismiss.test.js && node --test tests/test/dismiss/dismiss-bot-comment.test.jsFix consumer repo sync for minimatch
.github/scripts/node_modules/minimatch/totemplates/consumer-repo/.github/scripts/node_modules/minimatch/.github/scripts/package.jsontotemplates/consumer-repo/.github/scripts/package.jsonnode_modules/minimatch/directory andpackage.jsonto.github/sync-manifest.ymlunder the scripts sectionStandardize minimatch options
bot-comment-dismiss.js,pr-context-graphql.js, andmerge_manager.jsall use consistent minimatch options ({ dot: true, nocomment: true, nonegate: true })node --test .github/scripts/__tests__/*.test.js && node --test tests/test/dismiss/*.test.jsAcceptance criteria
bot-comment-dismiss.jsdoes NOT contain any of:function escapeRegExp,function expandBraces,function globToRegExp, or a localfunction minimatch.Verification:
grep -c "function escapeRegExp\|function expandBraces\|function globToRegExp" .github/scripts/bot-comment-dismiss.jsreturns0.bot-comment-dismiss.jsimports minimatch viarequire('minimatch').Verification:
grep -c "require.*minimatch" .github/scripts/bot-comment-dismiss.jsreturns1.Template copy matches:
diff .github/scripts/bot-comment-dismiss.js templates/consumer-repo/.github/scripts/bot-comment-dismiss.jsexits 0.Consumer template has
node_modules/minimatch/:test -f templates/consumer-repo/.github/scripts/node_modules/minimatch/index.jsexits 0.All existing JS tests pass:
node --test .github/scripts/__tests__/*.test.js && node --test tests/test/dismiss/*.test.jsexits 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.jsanddismiss-bot-comment.test.jscover 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 |
Head SHA: d50c21d
Latest Runs: ❔ in progress — Gate
Required: gate: ❔ in progress