-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Implement contributors graph #25439
Implement contributors graph #25439
Conversation
It would be nice to get some feedback and help about how to handle the issues I mentioned. |
Looks cool! A little thing about the new Tab: We already have a few Tabs for the Repo, depending n what is activated. It might be a good Idea, to add a new Insights Tab like GitHub, where we put this and other stats, that may be added in the future, in. The ACtivity could also be moved in the Insights Tab. |
Thank you for your contributions. It's amazing. Since it sums per day, so we can run the cron job per day and store the result in some table. Then all the performance problems will disappear. Another possible improvement is to retrieve the data via AJAX so the UI will not be blocked to wait data. |
@JakobDev yeah I agree. I didn't want to do that in this PR because it is out of scope and I was not sure if I can do it without breaking something :D With the changes in this PR, it is possible to create Code Frequency graph very easily. So someone might do that after creating Insights tab. @lunny Actually, it doesn't sum per day but per week. The structure is very similar to Github's mentioned in here. Still we can set up a cron job to run per day for big repositories though. I have implemented an endpoint to get commit data but then deleted it because I couldn't find a way to use it :D Retrieving the data with an AJAX call makes sense. I will try that. |
please dont forcepush it make's it hard to review :/ we do squashmerge in the end anyway |
Based on the demo video, the graphs seem a bit too high. Should probably reduce their height to 50-70% of what they currently have. |
Not sure I can help on the backend topics, but I will definitely help one the frontend ones. |
@lunny Did you have a chance to look at this again? I am waiting for reviews from maintainers. |
I will do it in following week. |
tested it and it looks like the template did fall apart a bit - as the menues do not have text anymore :/ |
Yeah, I just realized it. It looks like it happened after #27856. |
Will check this out in a few days. |
I'm sorry I destroyed the PR by pushing my main branch onto it accidentially and we can not revive this PR now. Let's continue in #27880. Lesson for me: use |
Can't I force push my branch and continue to this as if nothing happened?
Duly noted. |
Yes, try that. I was unable to force-push your branch again as the PR got closed and I lost push permission with the closure, but you should be able to. I can then push my last commit onto that. |
@silverwind I force pushed but I don't see my commits in this PR. Maybe it needs to be re-opened by maintainers if that's possible. |
According to this it should be possible to reopen but I don't know if did the right thing. I just did Edit: reading that again, it should be possible to reopen this now. I just don't have the permission to do that. |
If you like, push to a new branch name and make the PR from that, than I will close my new one. |
Ok, I opened a new PR (#27882) with a new branch. You can close yours @silverwind. |
Update: Unfortunately, this PR got closed by a mistake and can't be reopened. We are continuing discussion in #27882.
Overview
This is the implementation of a requested feature: Contributors graph (#847)
It makes Activity page a multi-tab page and adds a new tab called contributors. Contributors tab shows the contribution graphs over time since the repository existed. It also shows per user contribution graphs for top 100 contributors. Top 100 is calculated based on the selected contribution type (commits, additions or deletions).
Demo
Screen.Recording.2023-07-11.at.10.51.37.mov
Features:
Benchmarks:
Here are the loading time of the Contributors page for some repositories:
Issues to consider before merging
When contribution type is changed by user, whole page is re-rendered causing fetching the same data again which is unnecessary. This can be easily avoided by passing only the selected option to Vue. But I don't know how to do it so I need help here.(this is fixed 🥳)When contribution type is changed by user, we probably need to sort per user graphs based on the selected contribution type and not commits (which is default).When user zooms or pans the graphs, we need to update title of the page to show correct dates. Currently this is hard-coded. (From repository start date - To current date)When user zooms or pans the graphs, we probably need to update statistics on per user graphs (x commits, y additions, z deletions) to account only commits from the selected date range. Currently, they are calculated from start date to end date and sorted by total commits.iDontCareAboutErrors, _ := someFunc()
while reviewing the code :D We probably need to handle them correctly so please point me in the right direction.