Skip to content

Fix pr num lookup and a couple of other minor issues#82

Merged
colindean merged 6 commits into
mainfrom
fix-pr-num-lookup
Jun 22, 2026
Merged

Fix pr num lookup and a couple of other minor issues#82
colindean merged 6 commits into
mainfrom
fix-pr-num-lookup

Conversation

@banginji

@banginji banginji commented Jun 20, 2026

Copy link
Copy Markdown

Description

The vela route pr_num lookup was customized when github was hosted on prem but now with the migration to github cloud, the pr_num lookup can be simplified which this pr is for

In addition to that, fixed a couple of minor issues to get the tool working with vela:

  • Renamed github.py because of naming collision issue
    Error thrown before renaming:

ImportError: cannot import name 'Auth' from 'github' (consider renaming '/tmp/diff-poetry-lock/diff_poetry_lock/github.py' if it has the same name as a library you intended to import)

  • Fixed auth header for get_file github api helper
  • Fixed a log that was not resolving the number of comments it found in a pr
  • Fixed commit sha resolution; the head ref wasn't getting resolved so updated the graphql lookup to now use the pr_num instead to make it more stable instead of the previously used head and base refs

banginji added 5 commits June 19, 2026 10:09
This was necessary for on site hosted git but now with github migration this is no longer required so aligning it with the github settings route

Signed-off-by: banginji <7316646+banginji@users.noreply.github.com>
This was done because a name collision error started showing up with a github related dependency package in the recent version

Signed-off-by: banginji <7316646+banginji@users.noreply.github.com>
Signed-off-by: banginji <7316646+banginji@users.noreply.github.com>
1- Modified the graphql lookup to now use the pr_num instead of the head and base refs to make it more stable
2- Updated the pr_num lookup to be of type int instead of a str

Signed-off-by: banginji <7316646+banginji@users.noreply.github.com>
Signed-off-by: banginji <7316646+banginji@users.noreply.github.com>
@banginji
banginji requested a review from colindean June 21, 2026 14:41
@banginji

Copy link
Copy Markdown
Author

Preview of the log fix

Before

2026-06-21 14:31:53.314 | DEBUG    | diff_poetry_lock.github_api:list_comments:82 - Fetching comments for PR #2
2026-06-21 14:31:54.413 | DEBUG    | diff_poetry_lock.github_api:list_comments:91 - Found %d comments

After

2026-06-21 14:31:53.314 | DEBUG    | diff_poetry_lock.github_api:list_comments:82 - Fetching comments for PR #2
2026-06-21 14:31:54.413 | DEBUG    | diff_poetry_lock.github_api:list_comments:91 - Found 2 comments

@banginji

Copy link
Copy Markdown
Author

Preview of the sha lookup fix

Before

Diff Summary

Detected 2 changes to dependencies in Poetry lockfile

From base db863c1bc26224db03cc7ede8d720034e6524015 to head refs/pull/2/head:

  • Added loguru (0.7.3)
  • Added win32-setctime (1.2.0)

(2 added, 0 removed, 0 updated, 26 not changed)

Generated by diff-poetry-lock 1.0.1.dev0

After

Diff Summary

Detected 2 changes to dependencies in Poetry lockfile

From base db863c1bc26224db03cc7ede8d720034e6524015 to head 8744fc70cac4f56f2f97a742b26d3f65f759a847:

  • Added loguru (0.7.3)
  • Added win32-setctime (1.2.0)

(2 added, 0 removed, 0 updated, 26 not changed)

Generated by diff-poetry-lock 1.0.1.dev0

@colindean
colindean merged commit 0e310cd into main Jun 22, 2026
1 check passed
@colindean
colindean deleted the fix-pr-num-lookup branch June 22, 2026 21:29
@colindean

Copy link
Copy Markdown
Collaborator

Excellent work! Thank you!

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