Enforce syntax-aware linting for bundled CommonJS action scripts#43470
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🛠️ Agentic Maintenance updated this pull request branch. |
There was a problem hiding this comment.
Pull request overview
This PR strengthens the repository’s validation gates by making make lint-cjs run syntax-aware ESLint parsing over the bundled CommonJS action scripts under actions/setup/js, preventing invalid .cjs bundles (e.g., await inside non-async functions) from shipping via workflow lockfiles.
Changes:
- Updated
make lint-cjsto runeslint-factory’slint:setup-js(bootstrappingnode_moduleswhen absent) in addition to existing formatting checks. - Added a focused ESLint parser-level regression test to codify the “invalid
awaitin non-async function” failure mode. - Regenerated multiple workflow
.lock.ymlfiles (notably changing embeddedawf-config.jsonpayloads, such as adding amodels.lyriaentry).
Show a summary per file
| File | Description |
|---|---|
| Makefile | Enhances lint-cjs to include syntax-aware ESLint linting via eslint-factory (plus Node version gating). |
| eslint-factory/src/commonjs-syntax.test.ts | Adds regression coverage ensuring ESLint parsing fails for await in non-async functions and succeeds when async is present. |
| .github/workflows/workflow-health-manager.lock.yml | Regenerated lockfile content; embedded firewall config payload changed (e.g., models mapping updated). |
| .github/workflows/schema-consistency-checker.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/safe-output-health.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/pr-triage-agent.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/poem-bot.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/gpclean.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/daily-team-evolution-insights.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/daily-safe-output-optimizer.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/daily-regulatory.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/daily-observability-report.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/daily-multi-device-docs-tester.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/daily-max-ai-credits-test.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/daily-credit-limit-test.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/daily-compiler-quality.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/daily-cli-tools-tester.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/daily-cache-strategy-analyzer.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/copilot-centralization-optimizer.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/copilot-centralization-drilldown.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/code-simplifier.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/ci-coach.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/agentic-token-optimizer.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
| .github/workflows/agent-performance-analyzer.lock.yml | Regenerated lockfile content; embedded firewall config payload changed. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
Makefile:823
- The comment above
lint-cjssays it lints ".cjs and .js", but the target only checks Prettier formatting for**/*.cjs,**/*.ts, and**/*.json(viaactions/setup/jsscripts) and then runs ESLint overactions/setup/js*.cjsfiles. Consider updating this comment to accurately reflect what the target validates so contributors don’t assume.jsfiles are covered.
# Check JSON file formatting in pkg directory (excluding actions/setup/js, which is handled by npm script)
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Low
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Resolved — I merged the latest |
|
@copilot please run the
|
A bundled
actions/setup/js/*.cjsscript previously shipped withawaitinside a non-async helper, causing a hardSyntaxErroratrequire()time and breaking runtime log parsing steps. This change moves detection of that failure class into the standard lint gate so invalid bundled CommonJS syntax is rejected before lock files ship.Make
lint-cjssyntax-awaremake lint-cjsto run the existingeslint-factorylint overactions/setup/js.eslint-factorydependencies when needed so the gate works from a fresh clone.Add a focused regression test
awaitinside a non-async functionasyncScope
eslint-factorypath that already targets bundled setup scripts.