ros-controls / ros2_control_ci

This repository holds reusable workflows for CI of the ros2_control framework.
https://control.ros.org
Apache License 2.0
2 stars 1 forks source link

Pre-commit update: Add ref for scheduled build and hint for maintainers #32

Closed christophfroehlich closed 5 months ago

christophfroehlich commented 5 months ago

CI pipeline is not triggered for github-actions bot with GITHUB_TOKEN

When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, will not create a new workflow run.

It can happen now that pre-commit fails after an update, e.g., see here. I don't know how to fix this, we probably would need to create separate tokens for this workflow?

Maintainers can manually run the work due to the workflow-dispatch trigger on the newly created PR, but this won't be listed in the PR. I propose making the PR draft and add a hint for the maintainers to do so.

Furthermore, I added a ref_for_scheduled_build input to make the workflow configurable for other branches than master too.

fmauch commented 5 months ago

I think I don't quite get the problem mentioned above. Sure things can break if the version is updated, this is why we run pre-commit also in the PR updating the hooks, right? https://github.com/ros-controls/ros2_control_demos/pull/462 shows a failed pre-commit run in the checks. I guess at that point we should just not just merge it, but address upcoming problems exactly as you did in https://github.com/ros-controls/ros2_controllers/pull/1073. What am I missing here?

+1 for using the ref for scheduled build.

christophfroehlich commented 5 months ago

The event is not triggered by default (see the github docs above), but only if something changes in the PR: In your linked PR I rebased it on top of the master, this is why the workflow got started. See this PR as an example where it didn't. Bence merged it without noticing that the pre-commit will fail in future. btw: Setting it draft and reopening it does not trigger the workflow.