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

Add GitHub issue data and connect with user profiles #3266

Merged
merged 3 commits into from
Jan 29, 2025

Conversation

SahilDhillon21
Copy link
Contributor

@SahilDhillon21 SahilDhillon21 commented Jan 24, 2025

Fixes #3265
image

Extended the handle_pull_request_event function to also add the pull request data to the database

Could you please verify if the webhook is working? Since on the site the pull request badges are not being assigned automatically despite having added the GitHub URL to the profile

@SahilDhillon21 SahilDhillon21 marked this pull request as ready for review January 24, 2025 14:37
@SahilDhillon21 SahilDhillon21 changed the title Webhook to add pull requests to user profiles Webhook to add pull request data to user profiles Jan 24, 2025
Copy link
Collaborator

@DonnieBLT DonnieBLT left a comment

Choose a reason for hiding this comment

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

This looks great thank you! Can you please make a model GitHubIssues and store them there instead? Also check the first pr badge logic to only trigger on the first. Also please add a count in the profile.

@SahilDhillon21
Copy link
Contributor Author

This looks great thank you! Can you please make a model GitHubIssues and store them there instead? Also check the first pr badge logic to only trigger on the first. Also please add a count in the profile.

Did you mean GithubPullRequests instead of issues, or do we want to store them both? Also, in that case, would it be better to use a scheduled command to fetch pr data regularly or the webhook only?

@DonnieBLT
Copy link
Collaborator

This looks great thank you! Can you please make a model GitHubIssues and store them there instead? Also check the first pr badge logic to only trigger on the first. Also please add a count in the profile.

Did you mean GithubPullRequests instead of issues, or do we want to store them both? Also, in that case, would it be better to use a scheduled command to fetch pr data regularly or the webhook only?

GitHub issues and pull requests are the same structure in their back end. We want to have GitHub issues along with pull requests so I think we could use one table.

@DonnieBLT
Copy link
Collaborator

I also think it will be good to have them be 1 line each so we can see many at one time, and have the counts up top merged, open, closed and rank compare to others merged pull requests

@DonnieBLT
Copy link
Collaborator

And group by organization / repository

@SahilDhillon21
Copy link
Contributor Author

Understood!

@DonnieBLT
Copy link
Collaborator

Thank you!

@SahilDhillon21
Copy link
Contributor Author

In progress

@SahilDhillon21 SahilDhillon21 marked this pull request as draft January 28, 2025 09:29
@SahilDhillon21
Copy link
Contributor Author

In the GitHubIssue model, do we intend to store issue data of all existing repositories in the database
Or should we follow a user-centric approach where we fetch pull request data of only registered users who have added github_url in their profiles?

@DonnieBLT
Copy link
Collaborator

github_url sounds good!

@SahilDhillon21 SahilDhillon21 changed the title Webhook to add pull request data to user profiles Add GitHub issue data and connect with user profiles Jan 29, 2025
@SahilDhillon21 SahilDhillon21 marked this pull request as ready for review January 29, 2025 22:11
@SahilDhillon21
Copy link
Contributor Author

SahilDhillon21 commented Jan 29, 2025

Overall look:

image

Summary

  1. Updated UI for PR list, grouped by repo
  2. Management command to fetch and update PR data from GitHub API
  3. GitHubIssue model to store issue details
  4. Added logic to rank users based on merged PRs and store contribution ranks.

@DonnieBLT @tsu-ki please take a look

@tsu-ki
Copy link
Contributor

tsu-ki commented Jan 29, 2025

Overall look:

image

Summary

  1. Updated UI for PR list, grouped by repo
  2. Management command to fetch and update PR data from GitHub API
  3. GitHubIssue model to store issue details
  4. Added logic to rank users based on merged PRs and store contribution ranks.

@DonnieBLT @tsu-ki please take a look

looks amazing, great work man! Just a small suggestion, rather than displaying PRs from all repos, can we add a dropdown list and add repos to that list, so user can select which repo they want to view.
I made this suggestion because, I'll be adding the PR review section below this, and i'm unsure if it would fit within the page layout or not.

@DonnieBLT DonnieBLT merged commit a7ba012 into OWASP-BLT:main Jan 29, 2025
9 checks passed
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.

When someone does a pull request, make sure it shows up on their BLT profile
3 participants