[jsweep] Clean assign_to_user, check_command_position, and check_membership#7891
[jsweep] Clean assign_to_user, check_command_position, and check_membership#7891github-actions[bot] wants to merge 3 commits into
Conversation
…bership - Replace verbose if/else chains with ternary operators and object maps - Use array destructuring and optional chaining for cleaner code - Extract isCommandAtStart boolean to eliminate duplicate logic - Simplify target repository parsing with destructuring - Add comprehensive test file for assign_to_user.cjs with 12 test cases - Use nullish coalescing (??) for consistent error handling
|
@copilot merge main, format, lint, recompile |
|
📰 VERDICT: Smoke Copilot Playwright has concluded. All systems operational. This is a developing story. 🎤 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰 |
|
✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️ |
|
🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS. |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
Smoke Test Results✅ File Writing: Created Overall Status: ✅ PASS
|
Smoke Test Results✅ GitHub MCP Testing Overall: PASS (6/7 tests passed - gateway test expected to fail in non-gateway mode) cc
|
Smoke Test ResultsLast 2 Merged PRs:
Test Results:
Overall Status: PASS
|
|
Smoke test results:
|
Smoke Test Results - Claude EngineRecent PRs
Test Results✅ GitHub MCP - Retrieved 2 recent merged PRs Status: PASSAll core tools functional. Safe input gh tool unavailable but properly reported.
|
|
Recent merged PRs: Fix syntax error and missing return in check_membership.cjs; Fix ineffectual error assignments in pull request activity type tests
|
Smoke Test Results
Overall Status: ❌ FAIL Note: Playwright browser installation blocked by network restrictions in this environment.
|
Summary
Cleaned three JavaScript files in
actions/setup/js/to improve code quality using modern ES6+ features and patterns.Files Changed
1.
assign_to_user.cjs(github-script context)Improvements:
assigneevs pluralassignees)targetOwnerandtargetRepovariables?.) and nullish coalescing (??) for error handlingCode Reduction: Cleaner logic without sacrificing readability
2.
check_command_position.cjs(github-script context)Improvements:
eventTextMapobject for cleaner event text lookupisCommandAtStartboolean to eliminate duplicate conditional logic andsetOutputcallsString()conversion forsetOutputto ensure consistent string output (vs hardcoded "true"/"false")?.) and nullish coalescing (??) for error handlingCode Reduction: 19 lines → 13 lines for event handling (32% reduction)
3.
check_membership.cjs(github-script context)Improvements:
eventName,actor, andrepoproperties in single statementhasWriteRolevariable, using inline condition?.) forrequiredPermissionsandallowedBotslength checkserrorMsgvariable to eliminate duplication in configuration error handlingelse-ifchain with multipleifstatements for clearer bot status handlingelseblock by handling all cases with early returnsCode Reduction: More linear control flow with fewer nested blocks
Testing
assign_to_user.test.cjswith 12 comprehensive test casescheck_command_position.test.cjs(10 tests) andcheck_membership.test.cjsremain unchangedContext
All three files run in github-script context, so they have access to:
core(GitHub Actions core functions)github(Octokit REST/GraphQL API)context(workflow event context)Validation
Changes preserve original logic while improving: