@sentry/craft 3.11.1 → 3.11.2

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 +46 -22
  2. package/package.json +1 -1
package/dist/craft CHANGED
@@ -121861,13 +121861,13 @@ async function fetchPRFiles(prNumber) {
121861
121861
  function authorLogins(nodes = []) {
121862
121862
  return nodes.map((node3) => node3.user?.login).filter((login) => Boolean(login));
121863
121863
  }
121864
- async function fetchPRCoAuthors(prNumber) {
121864
+ async function fetchPRCoAuthors(prNumbers) {
121865
121865
  const { repo, owner } = await getGlobalGitHubConfig();
121866
- try {
121867
- const response = await getGitHubClient().graphql(
121868
- `query($owner: String!, $repo: String!, $number: Int!) {
121869
- repository(owner: $owner, name: $repo) {
121870
- pullRequest(number: $number) {
121866
+ const coAuthors = {};
121867
+ for (let start = 0; start < prNumbers.length; start += MAX_PRS_PER_QUERY) {
121868
+ const subset = prNumbers.slice(start, start + MAX_PRS_PER_QUERY);
121869
+ const prsQuery = subset.map(
121870
+ (number2) => `P${number2}: pullRequest(number: ${Number(number2)}) {
121871
121871
  commits(first: ${MAX_PR_COMMITS}) {
121872
121872
  nodes {
121873
121873
  commit {
@@ -121875,20 +121875,34 @@ async function fetchPRCoAuthors(prNumber) {
121875
121875
  }
121876
121876
  }
121877
121877
  }
121878
+ }`
121879
+ ).join("\n");
121880
+ let response;
121881
+ try {
121882
+ response = await getGitHubClient().graphql(
121883
+ `query($owner: String!, $repo: String!) {
121884
+ repository(owner: $owner, name: $repo) {
121885
+ ${prsQuery}
121878
121886
  }
121879
- }
121880
- }`,
121881
- { owner, repo, number: prNumber }
121882
- );
121883
- return (response?.repository?.pullRequest?.commits.nodes ?? []).flatMap(
121884
- (node3) => authorLogins(node3.commit.authors.nodes)
121885
- );
121886
- } catch (error3) {
121887
- logger.warn(
121888
- `Failed to fetch co-authors for PR #${prNumber}: ${error3.message || error3}`
121889
- );
121890
- return [];
121887
+ }`,
121888
+ { owner, repo }
121889
+ );
121890
+ } catch (error3) {
121891
+ logger.warn(
121892
+ `Failed to fetch co-authors for PRs ${subset.map((n5) => `#${n5}`).join(", ")}: ${error3.message || error3}`
121893
+ );
121894
+ response = error3.data;
121895
+ }
121896
+ for (const number2 of subset) {
121897
+ const pr3 = response?.repository?.[`P${number2}`];
121898
+ if (pr3) {
121899
+ coAuthors[number2] = pr3.commits.nodes.flatMap(
121900
+ (node3) => authorLogins(node3.commit.authors.nodes)
121901
+ );
121902
+ }
121903
+ }
121891
121904
  }
121905
+ return coAuthors;
121892
121906
  }
121893
121907
  function isBumpType(value) {
121894
121908
  return BUMP_TYPES.has(value);
@@ -122563,7 +122577,7 @@ async function generateChangelogWithHighlight(git, rev, currentPRNumber) {
122563
122577
  body: prInfo.body,
122564
122578
  author: prInfo.author,
122565
122579
  authorIsBot: prInfo.authorIsBot,
122566
- coAuthors: await fetchPRCoAuthors(currentPRNumber),
122580
+ coAuthors: (await fetchPRCoAuthors([currentPRStr]))[currentPRStr],
122567
122581
  pr: currentPRStr,
122568
122582
  prTitle: prInfo.title,
122569
122583
  prBody: prInfo.body,
@@ -122639,6 +122653,15 @@ async function fetchRawCommitInfo(git, rev, until) {
122639
122653
  }
122640
122654
  result.push(commit);
122641
122655
  }
122656
+ const withoutCoAuthors = [...seenPRs.values()].filter(
122657
+ (commit) => !commit.coAuthors?.length
122658
+ );
122659
+ const prCoAuthors = await fetchPRCoAuthors(
122660
+ withoutCoAuthors.map((commit) => String(commit.pr))
122661
+ );
122662
+ for (const commit of withoutCoAuthors) {
122663
+ commit.coAuthors = prCoAuthors[String(commit.pr)] ?? commit.coAuthors;
122664
+ }
122642
122665
  return result;
122643
122666
  }
122644
122667
  function categorizeCommits(rawCommits) {
@@ -123061,7 +123084,7 @@ async function getPRAndLabelsFromCommit(hashes) {
123061
123084
  })
123062
123085
  );
123063
123086
  }
123064
- var import_fs12, import_path12, BUMP_TYPES, DEFAULT_CHANGELOG_PATH, DEFAULT_UNRELEASED_TITLE, SKIP_CHANGELOG_MAGIC_WORD, DEFAULT_CHANGESET_BODY, VERSION_HEADER_LEVEL, SUBSECTION_HEADER_LEVEL, SCOPE_HEADER_LEVEL, MAX_COMMITS_PER_QUERY, MAX_PR_COMMITS, MAX_COMMIT_AUTHORS, MAX_CREDITED_AUTHORS, MAX_LEFTOVERS, DEFAULT_RELEASE_CONFIG, releaseConfigCache, SHORT_SHA_LENGTH, changesetCache, rawChangesetCache;
123087
+ var import_fs12, import_path12, BUMP_TYPES, DEFAULT_CHANGELOG_PATH, DEFAULT_UNRELEASED_TITLE, SKIP_CHANGELOG_MAGIC_WORD, DEFAULT_CHANGESET_BODY, VERSION_HEADER_LEVEL, SUBSECTION_HEADER_LEVEL, SCOPE_HEADER_LEVEL, MAX_COMMITS_PER_QUERY, MAX_PR_COMMITS, MAX_PRS_PER_QUERY, MAX_COMMIT_AUTHORS, MAX_CREDITED_AUTHORS, MAX_LEFTOVERS, DEFAULT_RELEASE_CONFIG, releaseConfigCache, SHORT_SHA_LENGTH, changesetCache, rawChangesetCache;
123065
123088
  var init_changelog = __esm({
123066
123089
  "src/utils/changelog.ts"() {
123067
123090
  "use strict";
@@ -123091,6 +123114,7 @@ var init_changelog = __esm({
123091
123114
  SCOPE_HEADER_LEVEL = SUBSECTION_HEADER_LEVEL + 1;
123092
123115
  MAX_COMMITS_PER_QUERY = 50;
123093
123116
  MAX_PR_COMMITS = 100;
123117
+ MAX_PRS_PER_QUERY = 25;
123094
123118
  MAX_COMMIT_AUTHORS = 10;
123095
123119
  MAX_CREDITED_AUTHORS = 3;
123096
123120
  MAX_LEFTOVERS = 24;
@@ -230898,7 +230922,7 @@ var require_package7 = __commonJS({
230898
230922
  "package.json"(exports2, module2) {
230899
230923
  module2.exports = {
230900
230924
  name: "@sentry/craft",
230901
- version: "3.11.1",
230925
+ version: "3.11.2",
230902
230926
  description: "The universal sentry workflow CLI",
230903
230927
  main: "dist/craft",
230904
230928
  repository: "https://github.com/getsentry/craft",
@@ -231106,7 +231130,7 @@ function getPackage() {
231106
231130
  }
231107
231131
  function getPackageVersion3() {
231108
231132
  const { version: version2 } = getPackage();
231109
- const buildInfo = "866c07c3c690f0177fa94f340d24f9bc8f166936";
231133
+ const buildInfo = "9567926a606072678ef367b02445c4f99f374795";
231110
231134
  return buildInfo ? `${version2} (${buildInfo})` : version2;
231111
231135
  }
231112
231136
  function semVerToString(s8) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/craft",
3
- "version": "3.11.1",
3
+ "version": "3.11.2",
4
4
  "description": "The universal sentry workflow CLI",
5
5
  "main": "dist/craft",
6
6
  "repository": "https://github.com/getsentry/craft",