@sentry/craft 2.25.2 → 2.25.4

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 (2) hide show
  1. package/dist/craft +95 -14
  2. package/package.json +3 -2
package/dist/craft CHANGED
@@ -159077,7 +159077,7 @@ var require_package6 = __commonJS({
159077
159077
  "package.json"(exports2, module2) {
159078
159078
  module2.exports = {
159079
159079
  name: "@sentry/craft",
159080
- version: "2.25.2",
159080
+ version: "2.25.4",
159081
159081
  description: "The universal sentry workflow CLI",
159082
159082
  main: "dist/craft",
159083
159083
  repository: "https://github.com/getsentry/craft",
@@ -159184,7 +159184,8 @@ var require_package6 = __commonJS({
159184
159184
  minimatch: "^10.2.1",
159185
159185
  "ajv@<6.14.0": "^6.14.0",
159186
159186
  rollup: "^4.59.0",
159187
- flatted: "^3.4.2"
159187
+ flatted: "^3.4.2",
159188
+ "picomatch@<3": "^2.3.2"
159188
159189
  }
159189
159190
  }
159190
159191
  };
@@ -159248,7 +159249,7 @@ function getPackage() {
159248
159249
  }
159249
159250
  function getPackageVersion() {
159250
159251
  const { version: version2 } = getPackage();
159251
- const buildInfo = "ba01e596c4a4c07692f0de10b0d4fe05f3dd0292";
159252
+ const buildInfo = "97d0c4286f32a80d09c8b89366d762fecc3e27b6";
159252
159253
  return buildInfo ? `${version2} (${buildInfo})` : version2;
159253
159254
  }
159254
159255
  function semVerToString(s6) {
@@ -167312,6 +167313,8 @@ async function runAutomaticVersionBumps(targets, rootDir, newVersion) {
167312
167313
  // src/commands/publish.ts
167313
167314
  var publish_exports = {};
167314
167315
  __export(publish_exports, {
167316
+ MergeConflictError: () => MergeConflictError,
167317
+ PushError: () => PushError,
167315
167318
  aliases: () => aliases,
167316
167319
  builder: () => builder,
167317
167320
  command: () => command2,
@@ -167551,6 +167554,24 @@ async function checkRevisionStatus(statusProvider, revision, skipStatusCheckFlag
167551
167554
  }
167552
167555
  await statusProvider.waitForTheBuildToSucceed(revision);
167553
167556
  }
167557
+ var MergeConflictError = class extends Error {
167558
+ constructor(message, conflictedFiles, diff) {
167559
+ const trueProto = new.target.prototype;
167560
+ super(message);
167561
+ this.conflictedFiles = conflictedFiles;
167562
+ this.diff = diff;
167563
+ this.__proto__ = trueProto;
167564
+ }
167565
+ __proto__;
167566
+ };
167567
+ var PushError = class extends Error {
167568
+ __proto__;
167569
+ constructor(message) {
167570
+ const trueProto = new.target.prototype;
167571
+ super(message);
167572
+ this.__proto__ = trueProto;
167573
+ }
167574
+ };
167554
167575
  async function handleReleaseBranch(git, remoteName, branch, mergeTarget, keepBranch = false) {
167555
167576
  if (!mergeTarget) {
167556
167577
  mergeTarget = await getDefaultBranch(git, remoteName);
@@ -167583,15 +167604,40 @@ async function handleReleaseBranch(git, remoteName, branch, mergeTarget, keepBra
167583
167604
  try {
167584
167605
  await git.merge(["-s", "resolve", "--no-ff", "--no-edit", branch]);
167585
167606
  } catch (resolveError) {
167607
+ let conflictedFiles = [];
167608
+ let conflictDiff = "";
167609
+ try {
167610
+ const status = await git.status();
167611
+ conflictedFiles = status.conflicted;
167612
+ } catch (_statusError) {
167613
+ logger.trace("git status failed while collecting conflict info");
167614
+ }
167615
+ if (conflictedFiles.length > 0) {
167616
+ try {
167617
+ conflictDiff = await git.diff(conflictedFiles);
167618
+ } catch (_diffError) {
167619
+ logger.trace("git diff failed while collecting conflict diff");
167620
+ }
167621
+ }
167586
167622
  try {
167587
167623
  await git.merge(["--abort"]);
167588
167624
  } catch (_abortError) {
167589
167625
  logger.trace("git merge --abort failed after resolve strategy");
167590
167626
  }
167591
- throw resolveError;
167627
+ throw new MergeConflictError(
167628
+ resolveError instanceof Error ? resolveError.message : String(resolveError),
167629
+ conflictedFiles,
167630
+ conflictDiff
167631
+ );
167592
167632
  }
167593
167633
  }
167594
- await git.push(remoteName, mergeTarget);
167634
+ try {
167635
+ await git.push(remoteName, mergeTarget);
167636
+ } catch (pushError) {
167637
+ throw new PushError(
167638
+ pushError instanceof Error ? pushError.message : String(pushError)
167639
+ );
167640
+ }
167595
167641
  if (keepBranch) {
167596
167642
  logger.info("Not deleting the release branch.");
167597
167643
  } else {
@@ -167621,8 +167667,7 @@ async function runPostReleaseCommand(newVersion, postReleaseCommand) {
167621
167667
  logger.info(`Running the post-release command...`);
167622
167668
  await spawnProcess(sysCommand, args, {
167623
167669
  env: {
167624
- CRAFT_NEW_VERSION: newVersion,
167625
- CRAFT_OLD_VERSION: "",
167670
+ CRAFT_RELEASED_VERSION: newVersion,
167626
167671
  PATH: process.env.PATH,
167627
167672
  GITHUB_TOKEN: process.env.GITHUB_TOKEN,
167628
167673
  ...Object.fromEntries(
@@ -167791,19 +167836,55 @@ Original error: ${err instanceof Error ? err.message : String(err)}`;
167791
167836
  );
167792
167837
  } catch (mergeError) {
167793
167838
  captureException(mergeError);
167794
- logger.warn(
167795
- [
167796
- `Failed to merge release branch "${branchName}" into the target branch.`,
167797
- `This is likely due to a merge conflict (e.g., in CHANGELOG.md).`,
167839
+ const lines = [
167840
+ `Failed to merge release branch "${branchName}" into the target branch.`
167841
+ ];
167842
+ if (mergeError instanceof MergeConflictError) {
167843
+ lines.push(`Merge conflict \u2014 both ort and resolve strategies failed.`);
167844
+ if (mergeError.conflictedFiles.length > 0) {
167845
+ lines.push(``);
167846
+ lines.push(`Conflicting files:`);
167847
+ for (const file of mergeError.conflictedFiles) {
167848
+ lines.push(` - ${file}`);
167849
+ }
167850
+ }
167851
+ if (mergeError.diff) {
167852
+ lines.push(``, `Diff:`, mergeError.diff);
167853
+ }
167854
+ lines.push(
167855
+ ``,
167798
167856
  `All publish targets completed successfully \u2014 only the post-publish merge failed.`,
167799
167857
  ``,
167800
167858
  `To resolve manually:`,
167801
167859
  ` 1. Merge the release branch into the target branch, resolving conflicts`,
167802
- ` 2. Delete the release branch: git push ${argv.remote} --delete ${branchName}`,
167860
+ ` 2. Delete the release branch: git push ${argv.remote} --delete ${branchName}`
167861
+ );
167862
+ } else if (mergeError instanceof PushError) {
167863
+ lines.push(
167864
+ `The merge succeeded locally but pushing to the remote failed.`,
167865
+ `This is likely due to an expired authentication token (common for long-running publishes > 1 hour).`,
167803
167866
  ``,
167804
- `Error: ${mergeError instanceof Error ? mergeError.message : String(mergeError)}`
167805
- ].join("\n")
167867
+ `All publish targets completed successfully \u2014 only the post-publish push failed.`,
167868
+ ``,
167869
+ `To resolve manually:`,
167870
+ ` 1. Re-authenticate (e.g., generate a fresh token)`,
167871
+ ` 2. Merge the release branch into the target branch`,
167872
+ ` 3. Delete the release branch: git push ${argv.remote} --delete ${branchName}`
167873
+ );
167874
+ } else {
167875
+ lines.push(
167876
+ `All publish targets completed successfully \u2014 only the post-publish merge failed.`,
167877
+ ``,
167878
+ `To resolve manually:`,
167879
+ ` 1. Merge the release branch into the target branch`,
167880
+ ` 2. Delete the release branch: git push ${argv.remote} --delete ${branchName}`
167881
+ );
167882
+ }
167883
+ lines.push(
167884
+ ``,
167885
+ `Error: ${mergeError instanceof Error ? mergeError.message : String(mergeError)}`
167806
167886
  );
167887
+ logger.warn(lines.join("\n"));
167807
167888
  }
167808
167889
  safeFs.unlink(publishStateFile).catch(
167809
167890
  (err) => logger.trace("Couldn't remove publish state file: ", err)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/craft",
3
- "version": "2.25.2",
3
+ "version": "2.25.4",
4
4
  "description": "The universal sentry workflow CLI",
5
5
  "main": "dist/craft",
6
6
  "repository": "https://github.com/getsentry/craft",
@@ -107,7 +107,8 @@
107
107
  "minimatch": "^10.2.1",
108
108
  "ajv@<6.14.0": "^6.14.0",
109
109
  "rollup": "^4.59.0",
110
- "flatted": "^3.4.2"
110
+ "flatted": "^3.4.2",
111
+ "picomatch@<3": "^2.3.2"
111
112
  }
112
113
  }
113
114
  }