-
Notifications
You must be signed in to change notification settings - Fork 2
feat: convert to fully native Node.js action with ES modules and ensuring valid work items #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: joshjohanning <[email protected]>
Co-authored-by: joshjohanning <[email protected]>
|
@copilot you will have to rebase and re-make your changes |
When I originally created this, the format was I wanted you to rewrite the composite action code (below) to be fully javascript-native action. Whether you integrate Here is the composite action logic that needs to be in
|
All changes completed:
The code now has the clean format you expected with:
Commit: [commit hash will be in the progress report] |
|
@copilot are you sure? Sorry I committed so maybe it broke your push for you. Can you re-do this?
|
Co-authored-by: joshjohanning <[email protected]>
Done! Rewrote both src/index.js and src/main.js with clean ES6+ modules, proper imports, and JSDoc comments. All tests passing (29 bash + 2 JS). Built successfully with ESM output. Files now have:
Commit: [will be in the pushed commit] |
8c5f231 to
ec600d7
Compare
ec600d7 to
53d70e7
Compare
5a57711 to
679fbad
Compare
679fbad to
719df7a
Compare
bba9e28 to
ef24038
Compare
There was a problem hiding this 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 modernizes the Azure DevOps Work Item Linker GitHub Action by migrating from a composite bash action to a JavaScript action with ES modules. Key improvements include enhanced work item validation, better error handling, comprehensive test coverage (96.96%), and dependency updates.
- Refactored from bash/composite action to native JavaScript action with ES6 modules
- Added work item existence validation feature in Azure DevOps
- Migrated to
azure-devops-node-apiv15.1.1 and modernized dependencies - Added comprehensive Jest test suites with 97% coverage
Reviewed Changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/link-work-item.js | New module for linking GitHub PRs to Azure DevOps work items with validation |
| src/index.js | New main entry point handling commit/PR validation and work item linking orchestration |
| package.json | Updated to ES modules, bumped dependencies, changed entry point to src/index.js |
| action.yml | Changed from composite bash action to native Node.js action |
| jest.config.js | Configured Jest for ES modules with proper test coverage settings |
| eslint.config.js | New ESLint flat config for ES modules with GitHub/Jest plugins |
| tests/link-work-item.test.js | Comprehensive test suite for work item linking functionality |
| tests/index.test.js | Extensive test suite for main validation logic with 1514 test cases |
| main.js | Removed old CommonJS implementation |
| TESTING.md | Removed outdated bash testing documentation |
Comments suppressed due to low confidence (1)
src/link-work-item.js:29
- Unused variable repoToken.
const repoToken = process.env.REPO_TOKEN;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Summary
Successfully converted from TypeScript-transpiled CommonJS to clean ES6+ modules with:
import/exportstatementsOriginal prompt
Fixes #89
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.