-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
fix(436): Fix Missing/wrong pull requests for github commits #831
base: main
Are you sure you want to change the base?
Conversation
7f85647
to
18754e2
Compare
Signed-off-by: dark0dave <[email protected]>
let pull_request = pull_requests | ||
.iter() | ||
.find(|pr| pr.merge_commit() == Some(v.id().clone())); | ||
debug!("-------------------------"); |
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.
these will be removed don't worry
Looks good, do we need to remove the macro after this? Or what is in your mind? Also, let me know if it is ready for testing 🙂 |
For now keep the macro, whats on my mind currently is do we want to mark all the commits in a pr as contributors? Example:
Should I be a contributor as well as you? Currently I am just taking the commit before the merge commit ( ie in the above example you would be the contributor). We don't need the to poll the api to get the pr commit history. The parent commits of the pr allow us to work backwards via the tree and discover the other relevant commits for that pr. |
Yes, I think that's reasonable.
Hmm, interesting. So we don't need to send 2 requests? Can you show me an example? |
Let me clarify: We do need to list PRs and commits. We do not need to send a request for each prs commit history. The github commit object exposes a parents field: https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commits We can use this parents field to traverse the commit history, git history is after all a tree. "parents": [
{
"url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
}
] Ie the above example with Alice, you and I. The Alice's merge commits parents are:
Your commit's parent are:
My commit parent are:
|
wait, we don't do that already. We only fetch all the commits and PRs & try to link between them using the available fields (
I see, I think it would be better to talk over the implementation :) Let me know when this is ready for review. |
ping :) |
@orhun so sorry I have been traveling for work. I'll ping you in a bit. |
Description
fixes #436
Motivation and Context
How Has This Been Tested?
Screenshots / Logs (if applicable)
Types of Changes
Checklist: