sfdx-hardis 8.7.1 → 8.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/lib/commands/hardis/project/deploy/smart.js +1 -1
  2. package/lib/commands/hardis/project/promotion/create.js +2 -2
  3. package/lib/commands/hardis/work/backpromote.d.ts +47 -0
  4. package/lib/commands/hardis/work/backpromote.js +1314 -141
  5. package/lib/commands/hardis/work/backpromote.js.map +1 -1
  6. package/lib/commands/hardis/work/new.js +9 -24
  7. package/lib/commands/hardis/work/new.js.map +1 -1
  8. package/lib/commands/hardis/work/save.js +7 -0
  9. package/lib/commands/hardis/work/save.js.map +1 -1
  10. package/lib/common/gitProvider/azureDevops.js +8 -8
  11. package/lib/common/gitProvider/azureDevops.js.map +1 -1
  12. package/lib/common/gitProvider/bitbucket.js +20 -12
  13. package/lib/common/gitProvider/bitbucket.js.map +1 -1
  14. package/lib/common/gitProvider/github.js +24 -18
  15. package/lib/common/gitProvider/github.js.map +1 -1
  16. package/lib/common/gitProvider/gitlab.js +11 -9
  17. package/lib/common/gitProvider/gitlab.js.map +1 -1
  18. package/lib/common/gitProvider/index.d.ts +6 -0
  19. package/lib/common/gitProvider/index.js +65 -1
  20. package/lib/common/gitProvider/index.js.map +1 -1
  21. package/lib/common/ticketProvider/azureBoardsProvider.js +17 -13
  22. package/lib/common/ticketProvider/azureBoardsProvider.js.map +1 -1
  23. package/lib/common/ticketProvider/jiraProvider.js +24 -18
  24. package/lib/common/ticketProvider/jiraProvider.js.map +1 -1
  25. package/lib/common/ticketProvider/serviceNowProvider.js +28 -20
  26. package/lib/common/ticketProvider/serviceNowProvider.js.map +1 -1
  27. package/lib/common/utils/adaptiveBatch.d.ts +66 -0
  28. package/lib/common/utils/adaptiveBatch.js +248 -0
  29. package/lib/common/utils/adaptiveBatch.js.map +1 -0
  30. package/lib/common/utils/backpromoteCommentUtils.d.ts +66 -0
  31. package/lib/common/utils/backpromoteCommentUtils.js +272 -0
  32. package/lib/common/utils/backpromoteCommentUtils.js.map +1 -0
  33. package/lib/common/utils/backpromoteGitUtils.d.ts +151 -0
  34. package/lib/common/utils/backpromoteGitUtils.js +569 -0
  35. package/lib/common/utils/backpromoteGitUtils.js.map +1 -0
  36. package/lib/common/utils/backpromoteOrgUtils.d.ts +166 -0
  37. package/lib/common/utils/backpromoteOrgUtils.js +773 -0
  38. package/lib/common/utils/backpromoteOrgUtils.js.map +1 -0
  39. package/lib/common/utils/backpromotePlanUtils.d.ts +262 -0
  40. package/lib/common/utils/backpromotePlanUtils.js +243 -0
  41. package/lib/common/utils/backpromotePlanUtils.js.map +1 -0
  42. package/lib/common/utils/backpromoteRules.d.ts +264 -0
  43. package/lib/common/utils/backpromoteRules.js +589 -0
  44. package/lib/common/utils/backpromoteRules.js.map +1 -0
  45. package/lib/common/utils/backpromoteUtils.d.ts +55 -56
  46. package/lib/common/utils/backpromoteUtils.js +186 -999
  47. package/lib/common/utils/backpromoteUtils.js.map +1 -1
  48. package/lib/common/utils/deploymentActionsStateUtils.js +21 -19
  49. package/lib/common/utils/deploymentActionsStateUtils.js.map +1 -1
  50. package/lib/common/utils/filesUtils.js +2 -1
  51. package/lib/common/utils/filesUtils.js.map +1 -1
  52. package/lib/common/utils/index.d.ts +7 -1
  53. package/lib/common/utils/index.js +15 -2
  54. package/lib/common/utils/index.js.map +1 -1
  55. package/lib/common/utils/progressFileUtils.d.ts +11 -0
  56. package/lib/common/utils/progressFileUtils.js +28 -0
  57. package/lib/common/utils/progressFileUtils.js.map +1 -0
  58. package/lib/common/utils/projectUtils.js +3 -3
  59. package/lib/common/utils/projectUtils.js.map +1 -1
  60. package/lib/common/utils/promotionBranchUtils.d.ts +35 -8
  61. package/lib/common/utils/promotionBranchUtils.js +59 -18
  62. package/lib/common/utils/promotionBranchUtils.js.map +1 -1
  63. package/lib/common/utils/promotionCreateUtils.d.ts +8 -3
  64. package/lib/common/utils/promotionCreateUtils.js +101 -18
  65. package/lib/common/utils/promotionCreateUtils.js.map +1 -1
  66. package/lib/common/utils/pullRequestUtils.js +2 -1
  67. package/lib/common/utils/pullRequestUtils.js.map +1 -1
  68. package/lib/common/websocketClient.js +7 -1
  69. package/lib/common/websocketClient.js.map +1 -1
  70. package/lib/hooks/init/start-ws-client.d.ts +5 -0
  71. package/lib/hooks/init/start-ws-client.js +12 -0
  72. package/lib/hooks/init/start-ws-client.js.map +1 -1
  73. package/lib/i18n/de.json +115 -78
  74. package/lib/i18n/en.json +115 -78
  75. package/lib/i18n/es.json +115 -78
  76. package/lib/i18n/fr.json +115 -78
  77. package/lib/i18n/it.json +115 -78
  78. package/lib/i18n/ja.json +115 -78
  79. package/lib/i18n/nl.json +115 -78
  80. package/lib/i18n/pl.json +115 -78
  81. package/lib/i18n/pt-BR.json +115 -78
  82. package/oclif.lock +101 -101
  83. package/oclif.manifest.json +6150 -6025
  84. package/package.json +7 -7
@@ -200,7 +200,7 @@ Deployment actions and selected Apex test classes are scoped to the Pull Request
200
200
 
201
201
  If the deployment job of a feature branch fails, its actions are not picked up by the next merged Pull Request: re-run the failed deployment job, or move the actions to a new Pull Request.
202
202
 
203
- With \`enablePromotionBranches: true\`, a merge from a [promotion branch (experimental)](${CONSTANTS.DOC_URL_ROOT}/salesforce-ci-cd-promotion-branches/) (named \`promotion/<source>/<target>/<YYYY-MM-DD>-<counter>\`, ex: \`promotion/uat/preprod/2026-09-06-1\`, assembled by cherry-picking approved User Stories) keeps the deployment actions, Apex test classes and custom behaviors (NO_DELTA, PURGE_FLOW_VERSIONS...) of the Pull Requests declared in its description with \`promotionPullRequests: [482, 487]\`.
203
+ With \`enablePromotionBranches: true\`, a merge from a [promotion branch (experimental)](${CONSTANTS.DOC_URL_ROOT}/salesforce-ci-cd-promotion-branches/) (named \`promotion/<source>/<target>/<YYYY-MM-DD>-<HHMM>\`, ex: \`promotion/uat/preprod/2026-09-06-1430\`, assembled by cherry-picking approved User Stories) keeps the deployment actions, Apex test classes and custom behaviors (NO_DELTA, PURGE_FLOW_VERSIONS...) of the Pull Requests declared in its description with \`promotionPullRequests: [482, 487]\`.
204
204
 
205
205
  After every action runs, its result (✅ success, ❌ failed, 👋 manual) is recorded in a dedicated **"Deployment Actions"** PR comment - ordered by org (integration → uat → preprod → prod) - regardless of \`runOnlyOnceByOrg\`.
206
206
 
@@ -25,7 +25,7 @@ This is the only supported way to create a [promotion branch (experimental)](${C
25
25
  - checks that \`enablePromotionBranches: true\` is set in the sfdx-hardis configuration;
26
26
  - checks that \`allowedPromotionSteps\` declares the steps promotions may run on (ex: \`- source: uat\` / \`target: preprod\`), and keeps to them: only those source and target branches are offered, and naming another one fails;
27
27
  - lists the Pull Requests merged into the source branch and not yet promoted to the target branch, and lets you select the ones to carry (or takes them from \`--pull-requests\`). A Pull Request another promotion branch already carries to the same target is left out, unless \`--include-already-promoted\` is passed;
28
- - creates the branch from the target branch, named \`promotion/<source>/<target>/<YYYY-MM-DD>-<counter>\` (ex: \`promotion/uat/preprod/2026-09-06-1\`), the counter separating several promotions assembled the same day;
28
+ - creates the branch from the target branch, named \`promotion/<source>/<target>/<YYYY-MM-DD>-<HHMM>\` (UTC, ex: \`promotion/uat/preprod/2026-09-06-1430\`), with \`-2\`, \`-3\`... added only when that name is already taken;
29
29
  - cherry-picks the merge commit of each selected Pull Request, oldest first, with \`-x\` so each commit keeps a pointer to its origin;
30
30
  - pushes the branch and creates the Pull Request to the target branch, with a description declaring the carried Pull Requests (\`${PROMOTION_PULL_REQUESTS_KEY}\`), their titles, authors, source branches and tickets.
31
31
 
@@ -45,7 +45,7 @@ On a cherry-pick conflict, you choose (or \`--on-conflict\` decides) to:
45
45
  - A first-parent commit that only moves other merges (a major-to-major sync like \`integration -> uat\`, a promotion branch merged into its target) is opened up into the first-parent commits it brought in, so each User Story is a candidate of its own instead of the whole sync window being a single row.
46
46
  - The branch is created with \`git checkout -b <name> origin/<target>\`, commits are applied with \`git cherry-pick -x\` (\`-m 1\` for merge commits).
47
47
  - The Pull Request is created through the git provider API (GitHub, GitLab, Azure DevOps, Bitbucket token), or with the \`gh\` CLI on GitHub. The creation is retried a few times: the branch is pushed a fraction of a second before, and a provider that has not indexed the new ref yet answers that the source branch does not exist. Without either, the branch is pushed and the description is saved under \`hardis-report/\` to create the Pull Request by hand, and the message names the reason the provider gave.
48
- - The counter is computed from the existing \`promotion/<source>/<target>/<date>-*\` branches, local and remote.
48
+ - The date and the time are in UTC. The name is checked against every promotion branch of the step that exists or existed: local and remote branches, remote-tracking refs, the merge commits of the target branch and its Pull Requests merged in the last two days. A name already taken gets \`-2\`, \`-3\`..., one more than the highest one found, and the branch creation stops on a name that still exists instead of resuming that branch.
49
49
  </details>
50
50
 
51
51
  ### Agent Mode
@@ -7,5 +7,52 @@ export default class BackpromoteTask extends SfCommand<any> {
7
7
  static flags: any;
8
8
  static requiresProject: boolean;
9
9
  protected static requiresSfdxPlugins: string[];
10
+ private flags;
10
11
  run(): Promise<AnyJson>;
12
+ private listPullRequestsAndHistory;
13
+ /**
14
+ * The files of one Pull Request of a listed merge. A merge that brought a single Pull Request gives
15
+ * it all its files. A merge that brought several (a retrofit of main into integration) gives each
16
+ * one the files of its own merge commit, kept only when the merge on the parent branch changed them
17
+ * too: a file main changed that the parent branch already had is not backpromoted.
18
+ */
19
+ private filesOfPullRequest;
20
+ /** The files a listed merge changed, from the single git call of the listing, or from git for a merge outside it */
21
+ private filesOfGroup;
22
+ /** The number of the start Pull Request (0 for a merge without number), or null when there is no window */
23
+ private chooseStart;
24
+ private computeWindow;
25
+ /** The deployment actions of the given groups, with what already ran in this sandbox */
26
+ private collectActions;
27
+ private readNoOverwrite;
28
+ private compare;
29
+ /**
30
+ * The package-no-overwrite.xml items this run does not deploy: the ones already in the sandbox,
31
+ * unless --include-no-overwrite names them (R22). One absent from the sandbox is deployed like any
32
+ * other item. Needs the comparison.
33
+ */
34
+ private heldNoOverwriteKeys;
35
+ /** Terminal mode: the items, the deletions and the decision for every file that differs */
36
+ private askDecisions;
37
+ private applyDecisions;
38
+ private persistState;
39
+ private switchCheckout;
40
+ /** Write the files marked merge that are not prepared yet, and the coding agent prompt */
41
+ private prepareMerges;
42
+ private waitForMerges;
43
+ private deployAndRecord;
44
+ private writeConfirmedActions;
45
+ private confirmActions;
46
+ private resetBranch;
47
+ private runCommand;
48
+ /**
49
+ * A failed deployment: the components the sandbox refused travel in the result, and the message
50
+ * says what to do with them (fix them on the backpromote branch, or untick them), so that the panel
51
+ * shows the errors themselves instead of pointing at a log it does not display.
52
+ */
53
+ private deployFailure;
54
+ private buildPlan;
55
+ private emptyPlan;
56
+ /** A refusal: exit code 1, the plan in the JSON data so that the panel and an agent read the status */
57
+ private refusal;
11
58
  }