Skip to content

gh-145000: Find correct merge base in reusable-check-html-ids.yml workflow - #147975

Merged
StanFromIreland merged 5 commits into
python:mainfrom
StanFromIreland:fix-checck-html
Apr 4, 2026
Merged

gh-145000: Find correct merge base in reusable-check-html-ids.yml workflow#147975
StanFromIreland merged 5 commits into
python:mainfrom
StanFromIreland:fix-checck-html

Conversation

@StanFromIreland

@StanFromIrelandStanFromIreland commented Apr 1, 2026

Copy link
Copy Markdown
Member

github.event.pull_request.base.sha is not the same as the git merge-base, per https://github.com/orgs/community/discussions/39880. Instead compare the commits and use merge_base_commit (this also however has quite sparse docs :-( at https://docs.github.com/en/rest/commits/commits?apiVersion=2026-03-10&versionId=free-pro-team%40latest&category=commits&subcategory=commits#compare-two-commits).

@StanFromIrelandStanFromIreland changed the title gh-146488: find correct merge base in check-html-idsgh-145000: find correct merge base in check-html-idsApr 1, 2026
@bedevere-appbedevere-appBot mentioned this pull request Apr 1, 2026
@webknjaz

webknjaz commented Apr 2, 2026

Copy link
Copy Markdown
Member

I'm not sure what GH puts into that response object.. But here's something I've been playing with on the Git level for gradually fetching older commits given a shallow clone, if you'd like to experiment with that: https://github.com/ansible/ansible/pull/84375/changes#diff-dfbae2cdf0eee1583a3eea53c82843bb9d1dfde27e6a3832e4ee48ab8aa2a1d3R226-R294.


Instead of having two git checkout steps, I'd go with one, then load more commits gradually until enough of the Git tree is in cache and use a git worktree to produce the second folder with older files. I'd maybe also factor-in the number of commits in the PR (as returned by the API) to start with.


Though, your solution might be functional, I don't have any experience with this specific API response key. I don't know if they'll produce different responses when there's multiple commits merging main into the topic branch.

@StanFromIreland

Copy link
Copy Markdown
MemberAuthor

@StanFromIreland

StanFromIreland commented Apr 2, 2026

Copy link
Copy Markdown
MemberAuthor

It calculated the correct merge base :-)

MERGE_BASE: 9e5b8383724211d14165a32c0e7682e56e13843a

Edit: And it also calculated it correctly after updating the PR.

@StanFromIreland

Copy link
Copy Markdown
MemberAuthor

The update confirms for a third time it calculated correctly, fbdbea9 (and not b1d2d98).

@StanFromIrelandStanFromIreland changed the title gh-145000: find correct merge base in check-html-idsgh-145000: Find correct merge base in check-html-idsApr 4, 2026
@StanFromIrelandStanFromIreland changed the title gh-145000: Find correct merge base in check-html-idsgh-145000: Find correct merge base in reusable-check-html-ids.yml workflowApr 4, 2026
@StanFromIreland
StanFromIreland merged commit c43b490 into python:mainApr 4, 2026
104 checks passed
@StanFromIreland
StanFromIreland deleted the fix-checck-html branch April 4, 2026 19:47
@StanFromIreland

Copy link
Copy Markdown
MemberAuthor

Thanks for the reviews!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@StanFromIreland@webknjaz@hugovk