fix: strip only the legacy prefix from GHA job names - #141
Merged
Conversation
baszalmstra
force-pushed
the
fix/gha-job-names
branch
from
September 1, 2026 08:06
31ddd14 to
3fb8368
Compare
Member
I saw it, thanks! Can you rebase now on the latest master? Thanks! |
get_stage_name dropped the first two dash-separated segments of a package name, which assumed every package is called ros-<distro>-<name>. With package_name_mode: both that assumption breaks for new-scheme names containing a hyphen, so ros2-distro-mutex showed up as 'mutex' and ros2-ament-package as 'package'. Match the ros-<distro>- prefix explicitly and leave anything else alone. Fixes RoboStack#136
baszalmstra
force-pushed
the
fix/gha-job-names
branch
from
September 1, 2026 08:18
3fb8368 to
73d1ac9
Compare
Collaborator
Author
Done! |
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The generated GitHub Actions job names are wrong for any package that isn't named
ros-<distro>-<something>(#136). On ros-rolling the mutex job shows up as mutex andros2-ament-packageshows up as package, which is pretty confusing when you're scanning a workflow run for the job that failed.The cause is
get_stage_name. It shortens names for display by dropping the first two dash-separated segments, but it never checks that those segments are actually theros-<distro>-prefix — it just counts hyphens:That happened to work while every package was
ros-<distro>-<name>. Withpackage_name_mode: bothit doesn't, because new-scheme names areros2-<name>, so the second segment is part of the package name rather than the distro. It only goes wrong when the shortname itself contains a hyphen (i.e. the ROS package has an underscore), which is why two-segment names likeros2-rclcpplooked fine and hid the problem for a while.The fix is to match the prefix instead of counting hyphens.
Before / after
ros-rolling-rclcpprclcpprclcppros-rolling-ament-packageament-packageament-packageros2-rclcppros2-rclcppros2-rclcppros2-ament-packagepackage(wrong)ros2-ament-packageros2-distro-mutexmutex(wrong)ros2-distro-mutexIt's worse than just those two though. Truncating at a fixed offset throws away whatever makes a name unique, so unrelated packages end up sharing a label. A job name is the space-joined list of the packages in its batch, so in the current
linux.ymlonbuildbranch_linuxyou get job names likevendor span cmake-auto coordinator cpp-vendorwith no way to tell which packages are meant. 45 different packages are all displayed asmsgs:I also kept the
ros2-prefix on the new names rather than stripping that too. The issue suggestsdistro-mutex/ament-packageas the nicer option, but inbothmode the compatibility package and the canonical package are separate recipes, so stripping both prefixes makes almost every package collide with its own compat twin: 775 ambiguous labels covering 1550 of the 1551 recipes, which is far worse than what we have now. Five characters of prefix seemed like the better trade. Happy to change it if you'd rather have the shorter names.Testing
I checked this against the real generated pipeline rather than only synthetic input. I took
.github/workflows/linux.ymlfrom ros-rolling'sbuildbranch_linuxand re-derived every job name from theCURRENT_RECIPESenv of each job:To be precise about the scope of that: whole job names were never duplicated, 333 distinct before and after, since a batch of five packages is a unique combination. What changes is that the individual package labels inside a job name now identify the package.
Also added
vinca/test_generate_gha.pywith the cases from the table.I did not re-run the generator end to end, since replaying the committed output covers the part this PR touches. Only linux-64 was checked; the same code path produces the Windows and macOS pipelines.