Skip to content

CI: Fix race condition when building with ROS 2 - #15387

Merged
remibettan merged 1 commit into
realsenseai:developmentfrom
rhabacker:fix-15386
Jul 30, 2026
Merged

remibettan merged 1 commit into
realsenseai:developmentfrom
rhabacker:fix-15386

Conversation

@rhabacker

Copy link
Copy Markdown
Contributor

Fixes #15386

@rhabacker
rhabacker force-pushed the fix-15386 branch 2 times, most recently from 18b2361 to 9427e7e Compare July 9, 2026 07:37

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 rs-agentic bot — Synchronize review (commit 18b2361)

✅ Positive change in this push

The author added persist-credentials: false to the checkout step in both workflow files. This directly addresses the Aikido security finding and is the correct hardening approach — well done.


⚠️ Outstanding concern: fetch-depth: 0 (from previous review)

My previous inline comments about fetch-depth: 0 have not been addressed. The code still fetches the full git history in both workflow files:

fetch-depth: 0

The commit message does provide a rationale:

"This ensures the git repository has all commits and refs properly initialized before vcs import tries to access them."

If vcs import (or action-ros-ci internally) genuinely requires full history to resolve refs/tags, then fetch-depth: 0 is justified — however, please explicitly confirm this with one of the following actions:

  1. Add a comment in the YAML explaining why full history is needed, e.g.:
    # fetch-depth: 0 required because action-ros-ci/vcs-import needs full
    # git history to resolve tags used during the build
    fetch-depth: 0
  2. Or change to fetch-depth: 1 if full history is not strictly needed (this is typically sufficient for a CI build).

Until this is clarified/resolved, the fetch-depth: 0 review threads remain open.


This comment was auto-generated by the rs-agentic bot.

@sysrsbuild-gh-agentic

Copy link
Copy Markdown
Collaborator

✅ [rs-agentic bot] change approved

The two previous bot comments flagging fetch-depth: 0 as a performance concern have been addressed in this updated commit:

  • fetch-depth: 1 is now correctly set in both .github/workflows/build-ROS2-package-CI.yaml and .github/workflows/build-ROS2-rolling-CI.yaml — this avoids fetching the entire git history and keeps CI clones fast.
  • submodules: recursive has been added as suggested, ensuring third-party submodules (e.g. third-party/) are checked out properly.
  • persist-credentials: false is a nice additional security hardening.

The fix looks good and correctly resolves the race condition described in #15386 by ensuring the repository checkout step (with submodules) happens before the action-ros-ci build step. No further changes needed on this front.

To resolve the race condition, the source files are
retrieved from the repository in a separate step.

Fixes realsenseai#15386
@sysrsbuild-gh-agentic

Copy link
Copy Markdown
Collaborator

🤖 rs-agentic bot — Synchronize review (commit 9a583da)

✅ change approved

This push is a merge from the development branch (no changes to the workflow YAML files themselves).

Reviewing the outstanding concerns from my previous inline comments:

  • fetch-depth: 0 → fetch-depth: 1: ✅ The author addressed this — both review threads are now resolved. Using fetch-depth: 1 is the correct choice for a standard CI build workflow.
  • persist-credentials: false: ✅ Already added in the prior push (security hardening confirmed).
  • submodules: recursive: ✅ Correctly included to handle third-party submodules.

The PR diff is clean, minimal, and correctly structured. No new issues introduced by this merge commit.


This comment was auto-generated by the rs-agentic bot.

@sysrsbuild-gh-agentic

Copy link
Copy Markdown
Collaborator

change approved

⚠️ [rs-agentic bot] Previous comments regarding fetch-depth: 0 (performance) and missing submodules: recursive have been fully addressed in this push.

The updated checkout step in both .github/workflows/build-ROS2-package-CI.yaml and .github/workflows/build-ROS2-rolling-CI.yaml now correctly uses:

  • fetch-depth: 1 — shallow clone for faster CI builds ✅
  • submodules: recursive — ensures third-party submodules are available ✅
  • persist-credentials: false — good security practice, prevents credential leakage ✅

All prior review concerns have been resolved.

@rhabacker

Copy link
Copy Markdown
Contributor Author

Can someone merge this PR, since other PRs depend on it, to help prevent failed build jobs?

@remibettan
remibettan merged commit 59b227b into realsenseai:development Jul 30, 2026
29 checks passed
@rhabacker
rhabacker deleted the fix-15386 branch August 3, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants