Fix lint errors by wiring up noop safe output job#4301
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR resolves linter warnings by integrating the previously-implemented but unused noop safe output feature into the workflow compiler. The noop safe output type allows agents to log transparency messages without making GitHub API calls, serving as a fallback mechanism.
Key Changes
- Core integration: Added noop job instantiation in
buildSafeOutputsJobs()following the established pattern used by other safe outputs - Formatting fixes: Applied Prettier formatting to JavaScript test files and fixed indentation in Go test file
- Lock file regeneration: All 80 workflow lock files updated to include the noop job in their dependency graphs with proper job dependencies and detection success checks
Reviewed Changes
Copilot reviewed 72 out of 74 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/compiler_jobs.go |
Added noop job creation logic with threat detection integration |
pkg/workflow/notify_comment_test.go |
Fixed indentation (formatting) |
pkg/workflow/js/notify_comment_error.cjs |
Removed trailing whitespace (formatting) |
pkg/workflow/js/noop.test.cjs |
Applied Prettier formatting to test file |
.github/workflows/*.lock.yml (80 files) |
Regenerated lock files with noop job integration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot fix JavaScript tests |
- Refactored noop.test.cjs to use eval pattern instead of dynamic imports - Updated notify_comment_error.test.cjs expected message to match current implementation - Fixed collect_ndjson_output.test.cjs noop tests to: - Add config file setup for noop output type - Use setFailed expectations for validation error tests - Configure max: 3 for multiple messages test - All 1016 JavaScript tests now passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit d6a8f57. All 1016 JavaScript tests now pass. Changes made:
|
|
@copilot fix javascript tests |
The JavaScript tests were already fixed in commit d6a8f57. All 1018 JavaScript tests are currently passing, along with all lint checks and unit tests:
The merge with main (commit 8d420de) maintained test compatibility and added 2 new tests from PR #4303. |
Fix Linting Issues ✅
Successfully fixed all linting issues and JavaScript test failures in the repository.
Changes Summary
1. Fixed JavaScript Formatting (2 files)
pkg/workflow/js/noop.test.cjs- Fixed with Prettierpkg/workflow/js/notify_comment_error.cjs- Fixed with Prettier2. Wired Up No-Op Safe Output Feature
Added missing integration for the noop safe output feature:
pkg/workflow/compiler_jobs.goto add noop job creation logicnoopScriptvariable inpkg/workflow/js.gogetNoOpScript()function inpkg/workflow/noop.gobuildCreateOutputNoOpJob()function inpkg/workflow/noop.go3. Recompiled All Workflows (70 files)
4. Fixed JavaScript Test Failures (3 test files, 12 failures → 0 failures)
noop.test.cjs - Refactored test structure:
await import()) to eval patternnotify_comment_error.test.cjs - Updated expected message:
collect_ndjson_output.test.cjs - Fixed noop validation tests:
/tmp/gh-aw/safeoutputs/config.json) to enable noop output typesetFailedinstead ofsetOutputmax: 3for the multiple messages test (default max for noop is 1)Verification Results
✅ All checks pass:
make lint- All validations passed ✓make build- Build successful ✓make test-unit- All unit tests passed ✓make test-js- All 1016 JavaScript tests passed ✓Technical Details
The noop feature was already fully implemented (code, tests, schema documentation) but wasn't wired up in the compiler. By adding the job creation logic and fixing the tests, the feature is now complete and all tests pass.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.