[No QA] Refactor createOrUpdateStagingDeploy for clarity and maintainability#83119
[No QA] Refactor createOrUpdateStagingDeploy for clarity and maintainability#83119roryabraham wants to merge 9 commits intomainfrom
Conversation
Extracts StagingDeploy-specific logic from GithubUtils into a dedicated StagingDeployUtils module, restructures the action as a standalone ts-node CLI script with a thin GitHub Actions wrapper, and applies several code quality improvements: - Break run() into focused helpers (buildNewChecklistParams, buildUpdateChecklistParams) - Consolidate checkbox state preservation into preserveCheckboxState() - Generalize checklist parsers into a single parseChecklistSection() helper - Accept PR numbers directly instead of URL roundtripping - Use dedent template literals for issue body construction - Remove void from generateStagingDeployCashBodyAndAssignees return type - Convert .then() chains to async/await throughout Co-authored-by: Cursor <cursoragent@cursor.com>
This comment was marked as resolved.
This comment was marked as resolved.
- Fix "accessble" → "accessible" typo in scripts/createOrUpdateStagingDeploy.ts - Rebuild all GitHub Actions bundles with npm run gh-actions-build Co-authored-by: Cursor <cursoragent@cursor.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
The thin action wrapper only read GITHUB_TOKEN from action input and delegated to the core script. Running the script directly with `npx ts-node` eliminates the ncc build step for this action and reduces file count. Co-authored-by: Cursor <cursoragent@cursor.com>
…m type Both StagingDeployCashPR and StagingDeployCashBlocker had the same shape with differently-named boolean keys. Collapsing them into ChecklistItem with isChecked removes the generic K parameter from parseChecklistSection and preserveCheckboxState, making both functions simpler to read and call. Co-authored-by: Cursor <cursoragent@cursor.com>
…deploy Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # .github/actions/javascript/createOrUpdateStagingDeploy/index.js
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: Cursor <cursoragent@cursor.com>
Add back comments that explain non-obvious logic (submodule grouping algorithm, version naming conventions) and section markers that help orient readers in the long run() function. Co-authored-by: Cursor <cursoragent@cursor.com>
- Switch deployBlockers/resolvedDeployBlockers from URL strings to numbers in StagingDeployCashParams, generating /issues/N URLs at render time - Replace confusing two-step deploy blocker dedup with a single-pass merge - Replace isEmptyObject(find(...)) with .some() for label checks - Replace arrayDifference with Set-based filter - Inline buildNewChecklistParams at its single call site - Update stale ncc comment to explain testability rationale for fs.readFileSync Co-authored-by: Cursor <cursoragent@cursor.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
Rename all internal code references from "StagingDeployCash" / "stagingDeploy" to "deployChecklist" / "DeployChecklist" to improve readability. The actual GitHub label string 'StagingDeployCash' remains unchanged. Renames files, types, functions, variables, log messages, imports, workflow steps, and action directories. The awaitStagingDeploys action is unchanged (separate concept from the checklist). Co-authored-by: Cursor <cursoragent@cursor.com>
This comment was marked as resolved.
This comment was marked as resolved.
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@parasharrajat Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@mountiny some time ago, I believe you were one of the people who requested a refactor of the action to create deploy checklists. here you go, ready for your review 🙂 I think it's greatly cleaned up and simplified now |
Explanation of Change
Refactors the
createOrUpdateStagingDeployGitHub Action for clarity and maintainability:GithubUtils.tsinto.github/libs/DeployChecklistUtils.ts.scripts/createOrUpdateDeployChecklist.ts, ats-nodescript runnable locally. The GitHub Actions wrapper is removed; the workflow calls the script directly.run()into focused helpers, consolidate checkbox state logic, generalize four checklist parsers into oneparseChecklistSection(), accept PR numbers directly instead of URLs, usededentfor issue body construction, convert.then()chains toasync/await.Fixed Issues
$ #60060
Tests
TODO: manually test the script in App-Test-Fork?
Offline tests
N/A — This is a CI/CD script, not a user-facing feature.
QA Steps
[No QA] — This change only affects CI/CD tooling (GitHub Actions). No user-facing behavior is modified.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A — CI/CD tooling change only
Android: mWeb Chrome
N/A — CI/CD tooling change only
iOS: Native
N/A — CI/CD tooling change only
iOS: mWeb Safari
N/A — CI/CD tooling change only
MacOS: Chrome / Safari
N/A — CI/CD tooling change only