From a662744511edcd0cb11bf98786c2140fcbe8178d Mon Sep 17 00:00:00 2001 From: "Kimberly N. McGuire" Date: Mon, 3 Nov 2025 13:31:29 +0100 Subject: [PATCH 1/5] better pr detection --- .github/workflows/generate-bindings.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-bindings.yml b/.github/workflows/generate-bindings.yml index b3a712eb..76d5f5a4 100644 --- a/.github/workflows/generate-bindings.yml +++ b/.github/workflows/generate-bindings.yml @@ -94,10 +94,12 @@ jobs: git config --global user.name "GitHub Action" git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} git remote update origin - CREATE_PR=0 - if ! git checkout update-bindings-${{ matrix.ros_distribution }}; then + if gh pr list --head "update-bindings-${{ matrix.ros_distribution }}" --state open --json number --jq length | grep -q '^0$'; then + echo "No existing PR found, will create new one" CREATE_PR=1 - git checkout -b update-bindings-${{ matrix.ros_distribution }} + else + echo "PR already exists, will update it" + CREATE_PR=0 fi git add rclrs/src/rcl_bindings_generated_${{ matrix.ros_distribution }}.rs git commit -m "Regenerate bindings for ${{ matrix.ros_distribution }}" From 0611e4b4a1e66b21f0215bf1a175166dc7d70859 Mon Sep 17 00:00:00 2001 From: "Kimberly N. McGuire" Date: Mon, 3 Nov 2025 13:39:25 +0100 Subject: [PATCH 2/5] Update generate-bindings.yml --- .github/workflows/generate-bindings.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generate-bindings.yml b/.github/workflows/generate-bindings.yml index 76d5f5a4..c3d7e0b0 100644 --- a/.github/workflows/generate-bindings.yml +++ b/.github/workflows/generate-bindings.yml @@ -93,7 +93,8 @@ jobs: git config --global user.email "action@github.com" git config --global user.name "GitHub Action" git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} - git remote update origin + git fetch origin + if gh pr list --head "update-bindings-${{ matrix.ros_distribution }}" --state open --json number --jq length | grep -q '^0$'; then echo "No existing PR found, will create new one" CREATE_PR=1 @@ -101,13 +102,16 @@ jobs: echo "PR already exists, will update it" CREATE_PR=0 fi + git add rclrs/src/rcl_bindings_generated_${{ matrix.ros_distribution }}.rs git commit -m "Regenerate bindings for ${{ matrix.ros_distribution }}" - git fetch origin update-bindings-${{ matrix.ros_distribution }} - git rebase origin/update-bindings-${{ matrix.ros_distribution }} - git push -u origin update-bindings-${{ matrix.ros_distribution }} + + git push -f origin HEAD:refs/heads/update-bindings-${{ matrix.ros_distribution }} + if [ $CREATE_PR -eq 1 ]; then gh pr create --base main --head update-bindings-${{ matrix.ros_distribution }} --title "Regenerate bindings for ${{ matrix.ros_distribution }}" --body "This PR regenerates the bindings for ${{ matrix.ros_distribution }}." + else + echo "PR already exists and has been updated with new commit" fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 0152fb54ea0685790230c7b8bd96bb9dca2d4894 Mon Sep 17 00:00:00 2001 From: "Kimberly N. McGuire" Date: Mon, 3 Nov 2025 13:48:44 +0100 Subject: [PATCH 3/5] branch name handling in workflow --- .github/workflows/generate-bindings.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-bindings.yml b/.github/workflows/generate-bindings.yml index c3d7e0b0..c3626468 100644 --- a/.github/workflows/generate-bindings.yml +++ b/.github/workflows/generate-bindings.yml @@ -95,7 +95,8 @@ jobs: git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} git fetch origin - if gh pr list --head "update-bindings-${{ matrix.ros_distribution }}" --state open --json number --jq length | grep -q '^0$'; then + BRANCH_NAME="update-bindings-${{ matrix.ros_distribution }}" + if gh pr list --head "$BRANCH_NAME" --state open --json number --jq length | grep -q '^0$'; then echo "No existing PR found, will create new one" CREATE_PR=1 else @@ -106,10 +107,14 @@ jobs: git add rclrs/src/rcl_bindings_generated_${{ matrix.ros_distribution }}.rs git commit -m "Regenerate bindings for ${{ matrix.ros_distribution }}" - git push -f origin HEAD:refs/heads/update-bindings-${{ matrix.ros_distribution }} + git push -f origin HEAD:refs/heads/$BRANCH_NAME if [ $CREATE_PR -eq 1 ]; then - gh pr create --base main --head update-bindings-${{ matrix.ros_distribution }} --title "Regenerate bindings for ${{ matrix.ros_distribution }}" --body "This PR regenerates the bindings for ${{ matrix.ros_distribution }}." + gh pr create \ + --base main \ + --head "$BRANCH_NAME" \ + --title "Regenerate bindings for ${{ matrix.ros_distribution }}" \ + --body "This PR regenerates the bindings for ${{ matrix.ros_distribution }}." else echo "PR already exists and has been updated with new commit" fi From 1764018b48182d39f7e7d9d4f6cde5c5fed9cc42 Mon Sep 17 00:00:00 2001 From: "Kimberly N. McGuire" Date: Mon, 3 Nov 2025 13:51:17 +0100 Subject: [PATCH 4/5] more echos! --- .github/workflows/generate-bindings.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/generate-bindings.yml b/.github/workflows/generate-bindings.yml index c3626468..6bf08b19 100644 --- a/.github/workflows/generate-bindings.yml +++ b/.github/workflows/generate-bindings.yml @@ -88,13 +88,17 @@ jobs: cd $GITHUB_WORKSPACE git config --global --add safe.directory $GITHUB_WORKSPACE if git diff --exit-code; then + echo "No changes detected, skipping PR creation" exit 0 fi + git config --global user.email "action@github.com" git config --global user.name "GitHub Action" git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} git fetch origin + echo "Github env set and origin is fetched! Now checking if PR exists.." + BRANCH_NAME="update-bindings-${{ matrix.ros_distribution }}" if gh pr list --head "$BRANCH_NAME" --state open --json number --jq length | grep -q '^0$'; then echo "No existing PR found, will create new one" @@ -115,6 +119,7 @@ jobs: --head "$BRANCH_NAME" \ --title "Regenerate bindings for ${{ matrix.ros_distribution }}" \ --body "This PR regenerates the bindings for ${{ matrix.ros_distribution }}." + echo "Created new PR!" else echo "PR already exists and has been updated with new commit" fi From 9f6e0adab70fe8ea700e0b101a917642de873790 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 3 Nov 2025 12:54:42 +0000 Subject: [PATCH 5/5] Regenerate bindings for rolling --- rclrs/src/rcl_bindings_generated_rolling.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rclrs/src/rcl_bindings_generated_rolling.rs b/rclrs/src/rcl_bindings_generated_rolling.rs index a4ed0af9..d0e45811 100644 --- a/rclrs/src/rcl_bindings_generated_rolling.rs +++ b/rclrs/src/rcl_bindings_generated_rolling.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.70.1 */ +/* automatically generated by rust-bindgen 0.72.1 */ pub type rcutils_ret_t = ::std::os::raw::c_int; #[repr(C)] @@ -529,9 +529,6 @@ extern "C" { extern "C" { pub fn rcutils_steady_time_now(now: *mut rcutils_time_point_value_t) -> rcutils_ret_t; } -extern "C" { - pub fn rcutils_raw_steady_time_now(now: *mut rcutils_time_point_value_t) -> rcutils_ret_t; -} extern "C" { pub fn rcutils_time_point_value_as_nanoseconds_string( time_point: *const rcutils_time_point_value_t,