Skip to content

Stop reading from users.gh_login - #14764

Merged
Turbo87 merged 2 commits into
mainfrom
stop-reading-from-users-gh-login
Sep 28, 2026
Merged

Turbo87 merged 2 commits into
mainfrom
stop-reading-from-users-gh-login

Conversation

@carols10cents

@carols10cents carols10cents commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Instead join to oauth_github.login, which may not exist if there isn't an oauth_github record for that user.

If there is no oauth_github record, that means the GitHub user has been deleted. We were previously setting the url field in user json to https://github.com/{gh_login}, but that can't possibly be correct if the GitHub user has been deleted.

We marked the url field as deprecated in #14537.

Rather than setting the deprecated field to an incorrect URL, this PR sets the deprecated field to text that isn't a URL but instead issues a deprecation message pointing to the new linked_accounts json instead.

There are other solutions to the url field problem I considered:

  • Set url to empty string rather than something that isn't a URL
  • Always set url to a deprecation message or empty string, rather than only when there isn't a GitHub user, to direct more consumers of this API to move off the url field
  • Set url to their crates.io user page URL instead

and there are probably other ideas. Open to thoughts and changes on that and any other aspect of this PR!

Extracted from #14575.

Connects to #13772.

Comment thread crates/crates_io_api_types/src/lib.rs Outdated
@carols10cents
carols10cents force-pushed the stop-reading-from-users-gh-login branch from 98b59bd to 46e4a68 Compare September 24, 2026 15:50
@rustbot

This comment has been minimized.

Instead join to `oauth_github.login`, which may not exist if there isn't
an `oauth_github` record for that user.

If there is no `oauth_github` record, that means the GitHub user has
been deleted. We were previously setting the `url` field in user json to
`https://github.com/{gh_login}`, but that can't possibly be correct if
the GitHub user has been deleted.

We marked the `url` field as deprecated in
<#14537>.

Rather than setting the deprecated field to an incorrect URL, this
PR sets the deprecated field to text that isn't a URL but instead issues
a deprecation message pointing to the new linked_accounts json instead.
This preserves the current behavior of the deprecated `url` fields when
possible, but uses a valid URL (that goes to the user's crates.io page)
when their GitHub account has been deleted.
@Turbo87
Turbo87 force-pushed the stop-reading-from-users-gh-login branch from 46e4a68 to b4090f0 Compare September 28, 2026 08:34
@rustbot

rustbot commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Turbo87
Turbo87 merged commit d497946 into main Sep 28, 2026
12 checks passed
@Turbo87
Turbo87 deleted the stop-reading-from-users-gh-login branch September 28, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants