Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add "n commits" link to contributors in contributors graph page #29429
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
Add "n commits" link to contributors in contributors graph page #29429
Changes from 3 commits
071184c
dc8533f
f20cd38
abdb275
d26364f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to
encodeURIComponent(this.repoBranch)
? Try with a branch name that contains a space character.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup.
Actually
this.repoBranch
might need to use path segment escape.The
q
parameter also needs to be escaped (encodeURIComponent)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no path escape function in JS, I think
encodeURIComponent
is suitable for alle cases, path or search params.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess "org/repo/branch/feature%2Fbranch" doesn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can not pass
/
toencodeURIComponent
if it's part of the path, it's meant for individual path segments or search param values.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, it looks really weird to construct the search query like this.
Wouldn't it make more sense to have
?after=…&before=…&author=…
?And is all that functionality already supported?
I would have guessed that you need to add it yourself…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should use
URLSearchParams
to construct search params:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it would. But I can't do that way because it is not something I decided. Gitea currently works the other way.
Yes. And it won't work if I accept your code suggestion. The spaces are important. As I said, this is how it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's existing API, I guess this weird format is okay, otherwise it would be a breaking change. Still we should ensure the individual paramters and path segments are encoded correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about users having multiple emails?
For those, only the primary email will be counted if I see that correctly…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All email addresses of a user are mapped to their primary email address in backend. See:
gitea/services/repository/contributors_graph.go
Lines 250 to 254 in 324626a
If I don't do that, we will see same user multiple times in the contributor graphs page (for multiple emails). And problem you mentioned will be fixed.
But I would prefer it this way as it looks cleaner. I guess it doesn't have to be perfect all the times. If you really want it to be perfect, you may modify the backend code to include commits of a user with their other email addresses when queried (maybe it already works this way, I didn't check)