Skip to content

3di | Fix the Enhance job for pull requests coming from forks - #7294

Merged
christophebedard merged 2 commits into
ros2:rollingfrom
kacperbojakowski-3di:enhance-checker-hotfix
Oct 15, 2026
Merged

christophebedard merged 2 commits into
ros2:rollingfrom
kacperbojakowski-3di:enhance-checker-hotfix

Conversation

@kacperbojakowski-3di

Copy link
Copy Markdown
Contributor

Another small hotfix to the enhancement checker. The previous fix got the check running, but it still fell over on a pull request opened from a fork because a few steps were talking to the fork checkout instead of the base repository, and the metadata parser mishandled empty optional fields. This change addresses those cases so that the check behaviour for fork PRs is the same as for branch PRs.

@gbiggs @tfoote FYI this is the hotfix Denise mentioned in the latest email. I'll address all the comments and reviews in the other PRs as soon as I can. Thank you for your patience.

What I changed

  • Fetch the diff base from the trusted repository – Under pull_request_target the working copy is the PR head checkout, so on a fork its origin remote points at the fork, which doesn't have the base commit. The fetch now targets the base repo explicitly by URL (https://github.com/${BASE_REPO}.git) so the diff against rolling can always be computed.

  • Stop metadata field values at the end of the line – The parser used \s* for the value, which crosses line breaks, so an empty optional field such as :experience: would eat up the next line and hide :area:. The pattern now uses [ \t]* and anchors to end of the line, so a blank field stays blank and the following field is read correctly. Also added a regression test for the empty-field case, just in case.

  • Post the review comment on the base repository – gh pr review inferred the repo from the fork checkout, so it tried to review the wrong repository. It now passes --repo explicitly. The comment body is also written to a file and passed with --body-file instead of inline, so the multiline Markdown summary can't be broken by shell quoting.

  • Don't let the advisory comment fail the check – Posting that comment is informational, so it now runs with continue-on-error: true. The real gate is still the "Enforce required enhancements" step, which fails only when error-level enhancements are missing.

The job already checks out fork files as data and runs the checker from
rolling. This change finishes that design.

Field values in `.. meta::` now stop at the end of the line so a blank
`:experience:` does not hide `:area:`. The job fetches the pull
request base from ros2/ros2_documentation and posts the review there
too. Both of those steps were talking to the fork checkout.
@christophebedard

Copy link
Copy Markdown
Member

Based on the workflow configuration (branches: - rolling), we shouldn't backport this to other distro branches, right?

@christophebedard
christophebedard merged commit 829377a into ros2:rolling Oct 15, 2026
7 checks passed
@fujitatomoya

Copy link
Copy Markdown
Collaborator

@christophebedard

for the perspective of github workflow, i agree with you, this is no need to backport.

but tools/rst_utils.py on lyrical still has the old \s* regex, and the regression test is missing.
that bug is live on lyrical, any .trusted-base checkout at a lyrical base SHA, or a local make test-tools, uses the broken parser. this part should be backported.

after all, i believe that this needs to be backported to lyrical.

fujitatomoya added a commit that referenced this pull request Oct 24, 2026
…7328)

The job already checks out fork files as data and runs the checker from
rolling. This change finishes that design.

Field values in `.. meta::` now stop at the end of the line so a blank
`:experience:` does not hide `:area:`. The job fetches the pull
request base from ros2/ros2_documentation and posts the review there
too. Both of those steps were talking to the fork checkout.

(cherry picked from commit 829377a)

Co-authored-by: Kacper Bojakowski <[email protected]>
Co-authored-by: Tomoya Fujita <[email protected]>
@christophebedard

Copy link
Copy Markdown
Member

that makes sense

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.

3 participants