Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Bitbucket PR author login #326

Merged
merged 10 commits into from
Nov 19, 2024
Merged

Update Bitbucket PR author login #326

merged 10 commits into from
Nov 19, 2024

Conversation

atefehmohseni
Copy link
Contributor

Currently Bitbucket PR author login field uses user's nickname which is not unique. I suggest to use accountID or UUID instead as explained here:
https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/

Copy link
Member

@bradrydzewski bradrydzewski left a comment

Choose a reason for hiding this comment

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

We have an ID field that is meant to hold the unique identifier. Let's use this instead for the author account id.

	User struct {
		ID      string
		Login   string
		Name    string
		Email   string
		Avatar  string
		Created time.Time
		Updated time.Time
	}
		Author: scm.User{
+			ID:     from.Author.AccountID,
			Login:  from.Author.Nickname,
			Name:   from.Author.DisplayName,
			Avatar: from.Author.Links.Avatar.Href,
		},

EDIT as an aside, the Login is currently being set to the Nickname. The Login field should only be set to the username, and if no username is available, it should be empty. We should probably revert this because it will result in a bug for anyone that uses it.

		Author: scm.User{
-			Login:  from.Author.Nickname,
			Name:   from.Author.DisplayName,
			Avatar: from.Author.Links.Avatar.Href,
		},

@atefehmohseni
Copy link
Contributor Author

Done.

@bradrydzewski bradrydzewski merged commit 7dc2e34 into master Nov 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants