Skip to content

Add overlap-warning workflow for files shared with moveit_pro_empty_ws#635

Open
JWhitleyWork wants to merge 1 commit into
mainfrom
add-empty-ws-overlap-warning
Open

Add overlap-warning workflow for files shared with moveit_pro_empty_ws#635
JWhitleyWork wants to merge 1 commit into
mainfrom
add-empty-ws-overlap-warning

Conversation

@JWhitleyWork
Copy link
Copy Markdown
Member

Problem

Files that exist in both moveit_pro_empty_ws (parent) and moveit_pro_example_ws (fork) can drift when a change is made only to the fork. Reviewers don't always notice during PR review, and the divergence is usually discovered later during an upstream merge — at which point the fix is much more disruptive.

Alternatives considered

  1. Sync a manifest of upstream paths into this repo via a periodic workflow in moveit_pro_empty_ws. Rejected: introduces another moving part and the manifest goes stale between syncs.
  2. git clone moveit_pro_empty_ws inside the action and diff locally. Rejected: slower, requires auth handling for a private/internal repo, and is overkill — we only need a path list, not file contents.
  3. Chosen: read moveit_pro_empty_ws's tree from the GitHub API at PR time. A single recursive git/trees call returns every path, the data is always current, and no checkout of either repo is needed.

Approach

One actions/github-script@v9.0.0 step. No actions/checkout. The script:

  • Lists PR files via pulls.listFiles (paginated, ignoring deletions).
  • Fetches moveit_pro_empty_ws's default-branch tree via git.getTree with recursive: true.
  • Intersects the two path sets.
  • Posts, updates, or deletes a sticky comment keyed by an HTML marker (<!-- empty-ws-overlap-warning -->), so subsequent pushes update one comment instead of spamming the PR. If a later push removes the overlap entirely, the comment is deleted.
  • Emits a core.warning if the upstream tree response is ever truncated (current size is well under GitHub's ~100k-entry limit, so this is precautionary).

Tradeoffs

  • The warning is advisory only — it never blocks a PR. Sometimes a fork-only change is the correct choice (e.g., example-specific tuning of a shared config), so failing the check would create false-positive friction.
  • Uses the default GITHUB_TOKEN. This works because both repos are in the same org and visible to the workflow. If moveit_pro_empty_ws access ever tightens, the token can be swapped for a fine-grained PAT secret without other changes.
  • Action pins use the actions/checkout@<SHA> # v<version> style used elsewhere in ci.yaml.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JWhitleyWork JWhitleyWork added this to the 9.4.0 milestone May 15, 2026
@JWhitleyWork JWhitleyWork self-assigned this May 15, 2026
@JWhitleyWork JWhitleyWork marked this pull request as ready for review May 15, 2026 21:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new GitHub Actions workflow that warns reviewers when a PR touches files that also exist in the upstream moveit_pro_empty_ws repository, using a sticky PR comment that is created, updated, or deleted on subsequent pushes.

Changes:

  • New workflow warn-empty-ws-overlap.yaml triggered on pull_request events.
  • Uses actions/github-script to list changed files, fetch upstream's recursive tree via the GitHub API, and intersect the two path sets.
  • Manages a single sticky comment keyed by an HTML marker, and emits a core.warning on overlap or on truncated upstream tree responses.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/warn-empty-ws-overlap.yaml
@JWhitleyWork JWhitleyWork enabled auto-merge May 15, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants