fix(release): fall back to gh user search for author usernames#34904
fix(release): fall back to gh user search for author usernames#34904JamesHenry merged 1 commit intonrwl:masterfrom
Conversation
✅ Deploy Preview for nx-docs canceled.
|
✅ Deploy Preview for nx-dev canceled.
|
|
View your CI Pipeline Execution ↗ for commit e91a840
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud is proposing a fix for your failed CI:
We added explicit generic type annotations (Map<string, { email: Set<string>; username?: string }>) to all four authors map declarations in the new test file. Without these annotations, TypeScript inferred the narrow type { email: Set<string> } from the literal values, causing TS2339 errors when tests accessed .username. This fix allows the test suite to compile and correctly verify the applyUsernameToAuthors fallback behavior introduced by the PR.
Note
⏳ We are verifying this fix by re-running nx:test.
Suggested Fix changes
diff --git a/packages/nx/src/command-line/release/utils/remote-release-clients/github.spec.ts b/packages/nx/src/command-line/release/utils/remote-release-clients/github.spec.ts
index 01c8ded824..c72a598f25 100644
--- a/packages/nx/src/command-line/release/utils/remote-release-clients/github.spec.ts
+++ b/packages/nx/src/command-line/release/utils/remote-release-clients/github.spec.ts
@@ -31,7 +31,7 @@ describe('GithubRemoteReleaseClient', () => {
},
},
});
- const authors = new Map([
+ const authors = new Map<string, { email: Set<string>; username?: string }>([
['Test User', { email: new Set(['test@example.com']) }],
]);
@@ -52,7 +52,7 @@ describe('GithubRemoteReleaseClient', () => {
items: [{ login: 'from-gh' }],
})
);
- const authors = new Map([
+ const authors = new Map<string, { email: Set<string>; username?: string }>([
['Test User', { email: new Set(['test@example.com']) }],
]);
@@ -86,7 +86,7 @@ describe('GithubRemoteReleaseClient', () => {
items: [{ login: 'from-gh' }],
})
);
- const authors = new Map([
+ const authors = new Map<string, { email: Set<string>; username?: string }>([
['Test User', { email: new Set(['test@example.com']) }],
]);
@@ -100,7 +100,7 @@ describe('GithubRemoteReleaseClient', () => {
execFileSyncSpy.mockImplementation(() => {
throw new Error('gh unavailable');
});
- const authors = new Map([
+ const authors = new Map<string, { email: Set<string>; username?: string }>([
['Test User', { email: new Set(['test@example.com']) }],
]);
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
Because this branch comes from a fork, it is not possible for us to apply fixes directly, but you can apply the changes locally using the available options below.
Apply changes locally with:
npx nx-cloud apply-locally cFhM-kkvy
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
9d3fb2e to
e91a840
Compare
(cherry picked from commit 9e5ba41)
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Author username resolution in Nx release only uses
ungh.ccafter the existing noreply-email handling.Expected Behavior
Author username resolution falls back to GitHub user search via
gh api search/userswhenungh.cccannot resolve the email.Related Issue(s)
N/A