Skip to content

fix(release): fall back to gh user search for author usernames#34904

Merged
JamesHenry merged 1 commit intonrwl:masterfrom
AI-JamesHenry-Org:gh-cli-fallback-to-ungh
Mar 23, 2026
Merged

fix(release): fall back to gh user search for author usernames#34904
JamesHenry merged 1 commit intonrwl:masterfrom
AI-JamesHenry-Org:gh-cli-fallback-to-ungh

Conversation

@AI-JamesHenry
Copy link
Copy Markdown
Contributor

Current Behavior

Author username resolution in Nx release only uses ungh.cc after the existing noreply-email handling.

Expected Behavior

Author username resolution falls back to GitHub user search via gh api search/users when ungh.cc cannot resolve the email.

Related Issue(s)

N/A

@AI-JamesHenry AI-JamesHenry requested a review from a team as a code owner March 18, 2026 12:59
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 18, 2026

Deploy Preview for nx-docs canceled.

Name Link
🔨 Latest commit e91a840
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69c112d0075006000882bf55

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 18, 2026

Deploy Preview for nx-dev canceled.

Name Link
🔨 Latest commit e91a840
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69c112d0d25f1c0008c2b679

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud bot commented Mar 18, 2026

View your CI Pipeline Execution ↗ for commit e91a840

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ❌ Failed 51m 8s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 8s View ↗
nx-cloud record -- pnpm nx conformance:check ✅ Succeeded 7s View ↗
nx build workspace-plugin ✅ Succeeded 1m 53s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-23 11:13:17 UTC

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@AI-JamesHenry AI-JamesHenry force-pushed the gh-cli-fallback-to-ungh branch from 9d3fb2e to e91a840 Compare March 23, 2026 10:15
@JamesHenry JamesHenry merged commit 9e5ba41 into nrwl:master Mar 23, 2026
15 of 17 checks passed
@JamesHenry JamesHenry deleted the gh-cli-fallback-to-ungh branch March 23, 2026 12:05
FrozenPandaz pushed a commit that referenced this pull request Mar 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants