[jsweep] Clean assign_milestone.cjs#21522
Closed
github-actions[bot] wants to merge 2 commits intomainfrom
Closed
Conversation
- Remove unused HANDLER_TYPE constant - Remove unnecessary 'item' alias (use 'message' directly) - Move staged-mode early return before try/catch (it cannot throw) - Add 8 new test cases: staged mode, cached milestones, fetch failure, milestone not found, allowed by number string, zero issue/milestone Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
@copilot add temporary id support |
Contributor
Added in commit 519d49b. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cleaned
assign_milestone.cjs(github-script context handler factory) and added temporary ID support.Changes to
assign_milestone.cjsHANDLER_TYPEconstant — declared but never referenced anywhere in the fileitemalias —const item = messagewas dead indirection; now usesmessagedirectly (7 occurrences simplified)try/catch— the staged path (logStagedPreviewInfo+ return) cannot throw, so wrapping it in a try/catch added noise without benefit; it now clearly sits outside the error boundaryissue_number—issue_numbercan now be a temporary ID (aw_*format); unresolved temporary IDs are deferred ({ success: false, deferred: true }) rather than treated as errorsChanges to
assign_milestone.test.cjsAdded 11 new test cases (7 → 18 total):
GH_AW_SAFE_OUTPUTS_STAGED=truepathallowed: ["5"]matches milestone #5listMilestonescalled exactly onceissue_numberis invalidissue_number: 0milestone_numberis invalidmilestone_number: 0issue_numberaw_issue1resolves to real issue numberissue_numberis an unresolved temporary IDdeferred: true#aw_issue1resolves correctlyContext
core,github,context)main(config)returns a closurehandleAssignMilestone(message, resolvedTemporaryIds)✅ Validation Checks
npm run format:cjs✓npm run lint:cjs✓npm run typecheck✓npm run test:js -- --no-file-parallelism✓ (assign_milestone.test.cjs: 18/18 passed; pre-existing failures in unrelated infrastructure tests)🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.