Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
| Info | Please fill out this column |
| ------ | ----------- |
| Ticket(s) this addresses | (add tickets here #1) |
| Documentation | (link to docs PR, pending, or N/A) | <!-- New features, parameter changes, and default value changes must be documented -->
| Primary OS tested on | (Ubuntu, MacOS, Windows) |
| Robotic platform tested on | (Steve's Robot, gazebo simulation of Tally, hardware turtlebot) |
| Does this PR contain AI generated software? | (No; Yes and it is marked inline in the code) |
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/autotag_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Label docs PRs for backports
on:
pull_request:
branches:
- humble
- jazzy
- kilted

jobs:
label-docs:
runs-on: ubuntu-latest
steps:
- name: Process docs PRs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get PR numbers from commits
prs=$(gh api repos/ros-navigation/navigation2/pulls/${{ github.event.number }}/commits \
--jq '.[].commit.message' | grep -o '#[0-9]\+' | tr -d '#' | sort -u)

# Find and label docs PRs
docs_pr_found=false
label="backport-${{ github.event.pull_request.base.ref }}"

for pr in $prs; do

# Get cross-referenced events
docs_pr=$(gh api repos/ros-navigation/navigation2/issues/$pr/timeline \
--jq '.[] | select(.event == "cross-referenced" and .source.issue.repository.name == "docs.nav2.org") | .source.issue.number' \
2>/dev/null | head -1)

if [ -n "$docs_pr" ]; then
echo "Labeling docs PR #$docs_pr with '$label'"
gh pr edit $docs_pr --repo ros-navigation/docs.nav2.org --add-label "$label"
docs_pr_found=true
else
echo "No cross-referenced docs PR found for navigation2 PR #$pr"
Copy link
Member

Choose a reason for hiding this comment

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

If we know a PR is a backport and we don't find a docs PR, I think that's a legit reason to fail. We can then handle the failures on a case-by-case (i.e. no docs needed), but that way we know something was missed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a conditional that now fails, if the entire backport collection of PRs do not have any docs PRs associated with them at all.

fi
done

# Fail if no docs PRs were found
if [ "$docs_pr_found" = false ]; then
echo "ERROR: No docs PRs found for this backport"
exit 1
fi
Loading