From e584f23c1cb004e41a94b84cf6c1f8b08787ad3d Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Thu, 10 Oct 2024 13:39:56 +0200 Subject: [PATCH 1/5] Add automatic issue creation on failed CI runs --- .github/issue_template_failed_ci.md | 32 +++++++++++++++++++ .github/workflows/humble-binary-main.yml | 1 + .github/workflows/humble-binary-testing.yml | 1 + .github/workflows/humble-semi-binary-main.yml | 1 + .../workflows/humble-semi-binary-testing.yml | 1 + .github/workflows/iron-binary-main.yml | 2 ++ .github/workflows/jazzy-binary-main.yml | 1 + .github/workflows/jazzy-binary-testing.yml | 1 + .github/workflows/jazzy-semi-binary-main.yml | 1 + .../workflows/jazzy-semi-binary-testing.yml | 1 + .github/workflows/reusable_ici.yml | 17 +++++++++- .github/workflows/rolling-binary-main.yml | 1 + .github/workflows/rolling-binary-testing.yml | 1 + .../workflows/rolling-semi-binary-main.yml | 1 + .../workflows/rolling-semi-binary-testing.yml | 1 + 15 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/issue_template_failed_ci.md diff --git a/.github/issue_template_failed_ci.md b/.github/issue_template_failed_ci.md new file mode 100644 index 000000000..8cb1a0f64 --- /dev/null +++ b/.github/issue_template_failed_ci.md @@ -0,0 +1,32 @@ +--- +title: Failed build job {{ env.UPSTREAM_TYPE }} ({{ env.DISTRO }}/{{ env.REPO }}) +labels: CI +--- +The scheduled build for branch `{{ env.REF }}` failed. + +**Upstream build type:** {{ env.UPSTREAM_TYPE }} +**ROS DISTRO:** {{ env.DISTRO }} +**Repo:** {{ env.REPO }} + +Please check the log output for details: {{ env.URL }} + +Please note that this issue has different implications based on the build type. To get an idea of +the complete situation, please have a look at the [current build +status](https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/blob/main/ci_status.md) + +- If the *Upstream build type* is "binary": + - If the *Repo* is "testing", it is well possible that an upstream package did make an + API-breaking change that hasn't been released, yet. If the semi-binary builds are OK, this + package has made the necessary changes, already. It is expected to sort itself out by itself, + once the upstream package has been released. If the semi-binary builds are failing, as well, + this package has to be updated. + - If the *Repo* is "main", but the "testing" builds are green, we are only waiting for a Sync + to happen. +- If the *Upstream build type* is "semi-binary": + - If both, main and testing, are failing, there has been an API-breaking change in an upstream + package. This package should get updated soon. If the upstream package gets released without + updating this package, the "binary / testing" builds will also fail. In this case, this package + needs to get updated and released ASAP. + - If not both, main and testing, are failing, there is an upstream dependency with an API-breaking + change that is not part of the upstream workspace. This should rarely happen and needs action + from the package maintainers. diff --git a/.github/workflows/humble-binary-main.yml b/.github/workflows/humble-binary-main.yml index a3a052d98..bd53edcea 100644 --- a/.github/workflows/humble-binary-main.yml +++ b/.github/workflows/humble-binary-main.yml @@ -11,5 +11,6 @@ jobs: with: ros_distro: humble ros_repo: main + upstream_type: binary upstream_workspace: Universal_Robots_ROS2_Driver-not-released.humble.repos ref_for_scheduled_build: humble diff --git a/.github/workflows/humble-binary-testing.yml b/.github/workflows/humble-binary-testing.yml index 4d8434c6a..0a0b6d3a2 100644 --- a/.github/workflows/humble-binary-testing.yml +++ b/.github/workflows/humble-binary-testing.yml @@ -12,5 +12,6 @@ jobs: with: ros_distro: humble ros_repo: testing + upstream_type: binary upstream_workspace: Universal_Robots_ROS2_Driver-not-released.humble.repos ref_for_scheduled_build: humble diff --git a/.github/workflows/humble-semi-binary-main.yml b/.github/workflows/humble-semi-binary-main.yml index 6ba0af5c7..75a6bb2b6 100644 --- a/.github/workflows/humble-semi-binary-main.yml +++ b/.github/workflows/humble-semi-binary-main.yml @@ -12,5 +12,6 @@ jobs: with: ros_distro: humble ros_repo: main + upstream_type: semi-binary upstream_workspace: Universal_Robots_ROS2_Driver.humble.repos ref_for_scheduled_build: humble diff --git a/.github/workflows/humble-semi-binary-testing.yml b/.github/workflows/humble-semi-binary-testing.yml index 63a1de1ed..be820821c 100644 --- a/.github/workflows/humble-semi-binary-testing.yml +++ b/.github/workflows/humble-semi-binary-testing.yml @@ -12,5 +12,6 @@ jobs: with: ros_distro: humble ros_repo: testing + upstream_type: semi-binary upstream_workspace: Universal_Robots_ROS2_Driver.humble.repos ref_for_scheduled_build: humble diff --git a/.github/workflows/iron-binary-main.yml b/.github/workflows/iron-binary-main.yml index cd70d5602..c12dd85c6 100644 --- a/.github/workflows/iron-binary-main.yml +++ b/.github/workflows/iron-binary-main.yml @@ -17,4 +17,6 @@ jobs: with: ros_distro: iron ros_repo: main + upstream_type: binary + upstream_workspace: Universal_Robots_ROS2_Driver-not-released.iron.repos ref_for_scheduled_build: iron diff --git a/.github/workflows/jazzy-binary-main.yml b/.github/workflows/jazzy-binary-main.yml index 9a5d52e3b..8cc19b466 100644 --- a/.github/workflows/jazzy-binary-main.yml +++ b/.github/workflows/jazzy-binary-main.yml @@ -17,5 +17,6 @@ jobs: with: ros_distro: jazzy ros_repo: main + upstream_type: binary upstream_workspace: Universal_Robots_ROS2_Driver-not-released.jazzy.repos ref_for_scheduled_build: main diff --git a/.github/workflows/jazzy-binary-testing.yml b/.github/workflows/jazzy-binary-testing.yml index e8a0e3a4e..67e7e4eeb 100644 --- a/.github/workflows/jazzy-binary-testing.yml +++ b/.github/workflows/jazzy-binary-testing.yml @@ -17,5 +17,6 @@ jobs: with: ros_distro: jazzy ros_repo: testing + upstream_type: binary upstream_workspace: Universal_Robots_ROS2_Driver-not-released.jazzy.repos ref_for_scheduled_build: main diff --git a/.github/workflows/jazzy-semi-binary-main.yml b/.github/workflows/jazzy-semi-binary-main.yml index 006291bf8..cba8d3d15 100644 --- a/.github/workflows/jazzy-semi-binary-main.yml +++ b/.github/workflows/jazzy-semi-binary-main.yml @@ -17,5 +17,6 @@ jobs: with: ros_distro: jazzy ros_repo: main + upstream_type: semi-binary upstream_workspace: Universal_Robots_ROS2_Driver.jazzy.repos ref_for_scheduled_build: main diff --git a/.github/workflows/jazzy-semi-binary-testing.yml b/.github/workflows/jazzy-semi-binary-testing.yml index b66ce4807..15714d042 100644 --- a/.github/workflows/jazzy-semi-binary-testing.yml +++ b/.github/workflows/jazzy-semi-binary-testing.yml @@ -17,5 +17,6 @@ jobs: with: ros_distro: jazzy ros_repo: testing + upstream_type: semi-binary upstream_workspace: Universal_Robots_ROS2_Driver.jazzy.repos ref_for_scheduled_build: main diff --git a/.github/workflows/reusable_ici.yml b/.github/workflows/reusable_ici.yml index b19f1c433..beabfdd44 100644 --- a/.github/workflows/reusable_ici.yml +++ b/.github/workflows/reusable_ici.yml @@ -9,7 +9,10 @@ on: default: '' required: false type: string - + upstream_type: + description: 'Binary or semi-binary build' + required: true + type: string upstream_workspace: description: 'UPSTREAM_WORKSPACE variable for industrial_ci. Usually path to local .repos file.' required: true @@ -68,3 +71,15 @@ jobs: ROS_REPO: ${{ inputs.ros_repo }} CMAKE_ARGS: -DUR_ROBOT_DRIVER_BUILD_INTEGRATION_TESTS=ON ADDITIONAL_DEBS: docker.io netcat-openbsd # Needed for integration tests + - uses: JasonEtco/create-an-issue@v2 + if: ${{ always() && (steps.ici.outputs.build_target_workspace == '2' || steps.ici.outputs.target_test_results == '1') && github.event_name == 'schedule'}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + UPSTREAM_TYPE: ${{ inputs.upstream_type }} + REF: ${{ inputs.ref_for_scheduled_build }} + DISTRO: ${{ inputs.ros_distro }} + REPO: ${{ inputs.ros_repo }} + URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + with: + update_existing: true + filename: .github/issue_template_failed_ci.md diff --git a/.github/workflows/rolling-binary-main.yml b/.github/workflows/rolling-binary-main.yml index 3ca974841..e14331072 100644 --- a/.github/workflows/rolling-binary-main.yml +++ b/.github/workflows/rolling-binary-main.yml @@ -17,5 +17,6 @@ jobs: with: ros_distro: rolling ros_repo: main + upstream_type: binary upstream_workspace: Universal_Robots_ROS2_Driver-not-released.rolling.repos ref_for_scheduled_build: main diff --git a/.github/workflows/rolling-binary-testing.yml b/.github/workflows/rolling-binary-testing.yml index 0d042012e..a26b58e9a 100644 --- a/.github/workflows/rolling-binary-testing.yml +++ b/.github/workflows/rolling-binary-testing.yml @@ -17,5 +17,6 @@ jobs: with: ros_distro: rolling ros_repo: testing + upstream_type: binary upstream_workspace: Universal_Robots_ROS2_Driver-not-released.rolling.repos ref_for_scheduled_build: main diff --git a/.github/workflows/rolling-semi-binary-main.yml b/.github/workflows/rolling-semi-binary-main.yml index 743918c62..5f856c676 100644 --- a/.github/workflows/rolling-semi-binary-main.yml +++ b/.github/workflows/rolling-semi-binary-main.yml @@ -17,5 +17,6 @@ jobs: with: ros_distro: rolling ros_repo: main + upstream_type: semi-binary upstream_workspace: Universal_Robots_ROS2_Driver.rolling.repos ref_for_scheduled_build: main diff --git a/.github/workflows/rolling-semi-binary-testing.yml b/.github/workflows/rolling-semi-binary-testing.yml index 0c9507809..f29fd34cf 100644 --- a/.github/workflows/rolling-semi-binary-testing.yml +++ b/.github/workflows/rolling-semi-binary-testing.yml @@ -17,5 +17,6 @@ jobs: with: ros_distro: rolling ros_repo: testing + upstream_type: semi-binary upstream_workspace: Universal_Robots_ROS2_Driver.rolling.repos ref_for_scheduled_build: main From 71bdca63467f1b0e190d4d3c88aaab3cefbe8657 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Thu, 10 Oct 2024 13:41:02 +0200 Subject: [PATCH 2/5] REVERT_ME: open issues on any run This should create issues from this PR already --- .github/workflows/reusable_ici.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable_ici.yml b/.github/workflows/reusable_ici.yml index beabfdd44..afbda10cb 100644 --- a/.github/workflows/reusable_ici.yml +++ b/.github/workflows/reusable_ici.yml @@ -72,7 +72,8 @@ jobs: CMAKE_ARGS: -DUR_ROBOT_DRIVER_BUILD_INTEGRATION_TESTS=ON ADDITIONAL_DEBS: docker.io netcat-openbsd # Needed for integration tests - uses: JasonEtco/create-an-issue@v2 - if: ${{ always() && (steps.ici.outputs.build_target_workspace == '2' || steps.ici.outputs.target_test_results == '1') && github.event_name == 'schedule'}} + #if: ${{ always() && (steps.ici.outputs.build_target_workspace == '2' || steps.ici.outputs.target_test_results == '1') && github.event_name == 'schedule'}} + if: ${{ always() && (steps.ici.outputs.build_target_workspace == '2' || steps.ici.outputs.target_test_results == '1') }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} UPSTREAM_TYPE: ${{ inputs.upstream_type }} From 592b29b0fa58552de2a971f37c3a437180b7b159 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Thu, 10 Oct 2024 14:01:26 +0200 Subject: [PATCH 3/5] Add missing ici id --- .github/workflows/reusable_ici.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reusable_ici.yml b/.github/workflows/reusable_ici.yml index afbda10cb..907f94ca2 100644 --- a/.github/workflows/reusable_ici.yml +++ b/.github/workflows/reusable_ici.yml @@ -71,6 +71,7 @@ jobs: ROS_REPO: ${{ inputs.ros_repo }} CMAKE_ARGS: -DUR_ROBOT_DRIVER_BUILD_INTEGRATION_TESTS=ON ADDITIONAL_DEBS: docker.io netcat-openbsd # Needed for integration tests + id: ici - uses: JasonEtco/create-an-issue@v2 #if: ${{ always() && (steps.ici.outputs.build_target_workspace == '2' || steps.ici.outputs.target_test_results == '1') && github.event_name == 'schedule'}} if: ${{ always() && (steps.ici.outputs.build_target_workspace == '2' || steps.ici.outputs.target_test_results == '1') }} From 758bdda663f1b7ec9d6fe9d046eecafe53436eec Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Mon, 17 Feb 2025 15:14:45 +0100 Subject: [PATCH 4/5] add issue write permission --- .github/workflows/reusable_ici.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/reusable_ici.yml b/.github/workflows/reusable_ici.yml index 907f94ca2..53e7b6dd2 100644 --- a/.github/workflows/reusable_ici.yml +++ b/.github/workflows/reusable_ici.yml @@ -41,6 +41,8 @@ jobs: reusable_ici: name: ${{ inputs.ros_distro }} ${{ inputs.ros_repo }} runs-on: ubuntu-latest + permissions: + issues: write env: DOCKER_RUN_OPTS: '-v /var/run/docker.sock:/var/run/docker.sock --network ursim_net' CCACHE_DIR: ${{ github.workspace }}/${{ inputs.ccache_dir }} From 59d55cfcc4eb143403c87cb0d114a2c50df61daf Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Mon, 17 Feb 2025 15:35:47 +0100 Subject: [PATCH 5/5] Add permissions to top-level --- .github/workflows/jazzy-binary-main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/jazzy-binary-main.yml b/.github/workflows/jazzy-binary-main.yml index 8cc19b466..8dac7289f 100644 --- a/.github/workflows/jazzy-binary-main.yml +++ b/.github/workflows/jazzy-binary-main.yml @@ -11,6 +11,10 @@ on: # Run every morning to detect flakiness and broken dependencies - cron: '13 4 * * *' +permissions: + contents: read + issues: write + jobs: jazzy_binary_main: uses: ./.github/workflows/reusable_ici.yml