Skip to content

OSAC-1739: extend mono-repo tooling to osac-csi-driver cutover - #183

Merged
openshift-merge-bot[bot] merged 3 commits into
osac-project:mainfrom
tchughesiv:OSAC-1739-csi-driver-cutover
Aug 3, 2026
Merged

OSAC-1739: extend mono-repo tooling to osac-csi-driver cutover#183
openshift-merge-bot[bot] merged 3 commits into
osac-project:mainfrom
tchughesiv:OSAC-1739-csi-driver-cutover

Conversation

@tchughesiv

@tchughesiv tchughesiv commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

OSAC-1739: Extend mono-repo tooling to osac-csi-driver cutover

Jira: https://redhat.atlassian.net/browse/OSAC-1739

Summary

Fourth increment under OSAC-1739. osac-csi-driver has since cut over from a git submodule to a full osac-project/osac subdirectory (OSAC-3530), joining fulfillment-service/osac-operator/osac-aap from increment 1 (#179) and osac-installer/bare-metal-fulfillment-operator from increment 2 (#181). Increment 3 (#182) was an unrelated post-merge documentation audit. This PR extends the same established treatment to osac-csi-driver — every osac-workspace doc/rule/skill/script now treats all 6 mono-repo components uniformly as osac/<component>/ subdirectories.

Changes

  • bootstrap.sh — removed osac-csi-driver from REPOS, added it to MERGED_COMPONENTS so it's quarantined to .legacy-repos/ instead of cloned independently. Verified live, end-to-end, against this machine's real standalone osac-csi-driver clone: quarantine preserves the untracked working tree, prints the expected banner, is idempotent on re-run, and doesn't disturb the 5 already-quarantined components.
  • Root docs (AGENTS.md, README.md) — added osac-csi-driver's previously-missing Repository Structure and Build/Test rows, extended the merge-history note and Cross-Component Changes list, and rewrote the Deployment Coordination bullet to drop the stale "one remaining git submodule" framing (confirmed zero submodules remain in osac) while accurately flagging that sync-image-tags.sh doesn't cover its image tag yet — a real upstream gap, documented rather than papered over.
  • .claude/rules/cross-repo-workflow.md — added its CLAUDE.md routing row (with a "no CLAUDE.md yet" caveat, since none exists upstream) and bumped "all five" → "all six" component counts.
  • .skillsaw.yaml / .gitignore — folded osac-csi-driver into the same migration-window exclude/ignore blocks as the other 5 components.
  • skills/create-pr/SKILL.md — extended the mono-repo detection regex and File Classification table, and added an osac-csi-driver validation block. A full-branch self-review caught two gaps here, both fixed: the new block was initially missing the make fmt && git diff --exit-code drift gate every other Go component's block runs first (its Makefile has build/test silently depend on fmt), and the osac-installer block still referenced git submodule update --init --recursive, which this PR's own "zero submodules remain" claim made stale.
  • reference/STRUCTURE.md / CONVENTIONS.md — hand-corrected (no repo-intel regeneration tool exists) to nest osac-csi-driver under osac/ and fold it into the sync-image-tags.sh coverage row instead of a standalone submodule row. While in STRUCTURE.md, discovered none of the other 5 mono-repo components were actually nested under an osac/ node in the tree diagram either — restructured the full tree for consistency, not just osac-csi-driver's entry.

Non-goals (left untouched, tracked elsewhere): skills/osac-release/ (OSAC-3396); fixing sync-image-tags.sh or adding AGENTS.md/CLAUDE.md to osac/osac-csi-driver/ upstream (gaps in the osac repo, not osac-workspace); archiving the old standalone osac-csi-driver repo (OSAC-1737).

Testing

  • Unit tests: N/A — no automated test suite for this repo's content (shell/Markdown/YAML tooling only), same as prior increments.
  • Integration tests: N/A, same reason.
  • Coverage: N/A for this repo type. Verification was functional/scripted: make skillsaw (0 errors/warnings, Grade A both before and after fixes), a live bootstrap.sh --no-fork run against a real standalone osac-csi-driver clone (quarantine + idempotency + no regression to the other 5 components confirmed), shellcheck (no new findings), and a manual markdown link review. An independent subagent also ran a full-branch self-review against the real osac/osac-csi-driver clone's actual Makefile targets and Chart.yaml — 2 MEDIUM findings (no CRITICAL/HIGH), both fixed and re-verified. Full details: .artifacts/implement/OSAC-1739/05-validation-report.md.

Acceptance Criteria

  • AC-1: bootstrap.sh quarantines stale osac-csi-driver standalone clones, stops cloning it independently
  • AC-2: Root docs (AGENTS.md, README.md) document osac-csi-driver under osac/, including previously-missing rows, and accurately describe the submodule removal + sync-image-tags.sh gap
  • AC-3: .claude/rules/cross-repo-workflow.md routing/counts updated
  • AC-4: .skillsaw.yaml excludes match new layout
  • AC-5: .gitignore grouping consistent with .skillsaw.yaml
  • AC-6: create-pr skill detects/validates osac-csi-driver
  • AC-7: Auto-generated reference docs hand-corrected for osac-csi-driver
  • AC-8: Non-goals untouched (skills/osac-release/, upstream osac repo gaps, archival, osac-ui/osac-test-infra/enhancement-proposals/docs)

Summary by CodeRabbit

  • Documentation

    • Documented the CSI storage driver as part of the OSAC monorepository.
    • Updated repository structure, workflows, build, testing, deployment, and dependency guidance.
    • Clarified that driver image tags require manual updates.
  • Chores

    • Updated workspace and bootstrap handling for the integrated driver component.
    • Added driver validation, formatting, linting, build, and test guidance.
    • Adjusted repository exclusions and migration safeguards.

Fourth increment under OSAC-1739. osac-csi-driver cut over from a git
submodule to a full osac-project/osac subdirectory (OSAC-3530),
leaving it the last standalone/submodule component still described
that way across osac-workspace's docs, scripts, and skills. Applies
the same treatment already used for the other 5 merged components
(fulfillment-service, osac-operator, osac-aap, osac-installer,
bare-metal-fulfillment-operator):

- bootstrap.sh: remove osac-csi-driver from REPOS, add it to
  MERGED_COMPONENTS so quarantine_merged_component() picks up any
  pre-existing standalone clone automatically.
- AGENTS.md / README.md: add osac/osac-csi-driver's Repository
  Structure and Build/Test rows (previously undocumented even
  pre-merge), extend the merge-history note and Cross-Component
  Changes list, and rewrite the Deployment Coordination bullet to
  drop the stale "one remaining git submodule" framing (zero
  submodules remain in osac) while flagging that sync-image-tags.sh
  doesn't cover its image tag yet -- a real upstream gap, not papered
  over.
- .claude/rules/cross-repo-workflow.md: add its CLAUDE.md routing row
  (with a "no CLAUDE.md yet" caveat, since none exists upstream) and
  bump "all five" -> "all six" component counts.
- .skillsaw.yaml / .gitignore: fold osac-csi-driver into the same
  migration-window exclude/ignore blocks as the other 5 components.
- skills/create-pr/SKILL.md: extend the mono-repo detection regex and
  File Classification table, and add an osac-csi-driver validation
  block. Full-branch self-review caught two gaps here, both fixed:
  the new block was missing the make fmt && git diff --exit-code
  drift gate every other Go component's block runs first (its
  Makefile has build/test silently depend on fmt), and the
  osac-installer block still referenced git submodule update --init
  --recursive, which this change's own "zero submodules remain" claim
  made stale.
- reference/STRUCTURE.md / CONVENTIONS.md: hand-corrected (no
  repo-intel regeneration tool exists) to nest osac-csi-driver under
  osac/ and fold it into the sync-image-tags.sh coverage row instead
  of a standalone submodule row. While in STRUCTURE.md, discovered
  none of the other 5 mono-repo components were correctly nested
  under an osac/ node either -- restructured the full tree diagram
  for consistency, not just osac-csi-driver's entry.

Non-goals (left untouched, tracked elsewhere): skills/osac-release/
(OSAC-3396), fixing sync-image-tags.sh or adding AGENTS.md/CLAUDE.md
to osac/osac-csi-driver/ upstream (osac repo gaps, not osac-workspace
bugs), and archiving the old standalone osac-csi-driver repo
(OSAC-1737).

Validated: make skillsaw clean (Grade A, 0 errors/warnings); live
end-to-end bootstrap.sh --no-fork run against this machine's real
standalone osac-csi-driver clone confirmed quarantine + idempotency
+ no regression to the 5 prior components; shellcheck clean (no new
findings); independent full-branch self-review PASS after fixes.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Tommy Hughes <tohughes@redhat.com>
@openshift-ci-robot

openshift-ci-robot commented Aug 2, 2026

Copy link
Copy Markdown

@tchughesiv: This pull request references OSAC-1739 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

OSAC-1739: Extend mono-repo tooling to osac-csi-driver cutover

Jira: https://redhat.atlassian.net/browse/OSAC-1739

Summary

Fourth increment under OSAC-1739. osac-csi-driver has since cut over from a git submodule to a full osac-project/osac subdirectory (OSAC-3530), joining fulfillment-service/osac-operator/osac-aap from increment 1 (#179) and osac-installer/bare-metal-fulfillment-operator from increment 2 (#181). Increment 3 (#182) was an unrelated post-merge documentation audit. This PR extends the same established treatment to osac-csi-driver — every osac-workspace doc/rule/skill/script now treats all 6 mono-repo components uniformly as osac/<component>/ subdirectories.

Changes

  • bootstrap.sh — removed osac-csi-driver from REPOS, added it to MERGED_COMPONENTS so it's quarantined to .legacy-repos/ instead of cloned independently. Verified live, end-to-end, against this machine's real standalone osac-csi-driver clone: quarantine preserves the untracked working tree, prints the expected banner, is idempotent on re-run, and doesn't disturb the 5 already-quarantined components.
  • Root docs (AGENTS.md, README.md) — added osac-csi-driver's previously-missing Repository Structure and Build/Test rows, extended the merge-history note and Cross-Component Changes list, and rewrote the Deployment Coordination bullet to drop the stale "one remaining git submodule" framing (confirmed zero submodules remain in osac) while accurately flagging that sync-image-tags.sh doesn't cover its image tag yet — a real upstream gap, documented rather than papered over.
  • .claude/rules/cross-repo-workflow.md — added its CLAUDE.md routing row (with a "no CLAUDE.md yet" caveat, since none exists upstream) and bumped "all five" → "all six" component counts.
  • .skillsaw.yaml / .gitignore — folded osac-csi-driver into the same migration-window exclude/ignore blocks as the other 5 components.
  • skills/create-pr/SKILL.md — extended the mono-repo detection regex and File Classification table, and added an osac-csi-driver validation block. A full-branch self-review caught two gaps here, both fixed: the new block was initially missing the make fmt && git diff --exit-code drift gate every other Go component's block runs first (its Makefile has build/test silently depend on fmt), and the osac-installer block still referenced git submodule update --init --recursive, which this PR's own "zero submodules remain" claim made stale.
  • reference/STRUCTURE.md / CONVENTIONS.md — hand-corrected (no repo-intel regeneration tool exists) to nest osac-csi-driver under osac/ and fold it into the sync-image-tags.sh coverage row instead of a standalone submodule row. While in STRUCTURE.md, discovered none of the other 5 mono-repo components were actually nested under an osac/ node in the tree diagram either — restructured the full tree for consistency, not just osac-csi-driver's entry.

Non-goals (left untouched, tracked elsewhere): skills/osac-release/ (OSAC-3396); fixing sync-image-tags.sh or adding AGENTS.md/CLAUDE.md to osac/osac-csi-driver/ upstream (gaps in the osac repo, not osac-workspace); archiving the old standalone osac-csi-driver repo (OSAC-1737).

Testing

  • Unit tests: N/A — no automated test suite for this repo's content (shell/Markdown/YAML tooling only), same as prior increments.
  • Integration tests: N/A, same reason.
  • Coverage: N/A for this repo type. Verification was functional/scripted: make skillsaw (0 errors/warnings, Grade A both before and after fixes), a live bootstrap.sh --no-fork run against a real standalone osac-csi-driver clone (quarantine + idempotency + no regression to the other 5 components confirmed), shellcheck (no new findings), and a manual markdown link review. An independent subagent also ran a full-branch self-review against the real osac/osac-csi-driver clone's actual Makefile targets and Chart.yaml — 2 MEDIUM findings (no CRITICAL/HIGH), both fixed and re-verified. Full details: .artifacts/implement/OSAC-1739/05-validation-report.md.

Acceptance Criteria

  • AC-1: bootstrap.sh quarantines stale osac-csi-driver standalone clones, stops cloning it independently
  • AC-2: Root docs (AGENTS.md, README.md) document osac-csi-driver under osac/, including previously-missing rows, and accurately describe the submodule removal + sync-image-tags.sh gap
  • AC-3: .claude/rules/cross-repo-workflow.md routing/counts updated
  • AC-4: .skillsaw.yaml excludes match new layout
  • AC-5: .gitignore grouping consistent with .skillsaw.yaml
  • AC-6: create-pr skill detects/validates osac-csi-driver
  • AC-7: Auto-generated reference docs hand-corrected for osac-csi-driver
  • AC-8: Non-goals untouched (skills/osac-release/, upstream osac repo gaps, archival, osac-ui/osac-test-infra/enhancement-proposals/docs)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Aug 2, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tchughesiv

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Changes

The PR integrates osac-csi-driver into the osac monorepository. It updates bootstrap handling, workspace structure, workflow documentation, image-tag guidance, Skillsaw exclusions, and create-pr validation.

CSI driver monorepo integration

Layer / File(s) Summary
Repository migration and workspace layout
.gitignore, .skillsaw.yaml, bootstrap.sh, reference/STRUCTURE.md
Bootstrap treats osac-csi-driver as a merged component. Ignore rules and Skillsaw exclusions cover its standalone clone path. The documented workspace layout places it under osac/.
Component workflow and architecture documentation
AGENTS.md, README.md, .claude/rules/cross-repo-workflow.md, reference/CONVENTIONS.md
Documentation identifies the CSI driver as an osac component, adds its commands and architecture role, and replaces submodule synchronization with manual image-tag updates.
Create-PR detection and validation
skills/create-pr/SKILL.md
The create-pr skill resolves the repository from the upstream remote, detects the CSI driver, includes it in six-component workflows, defines Go validation and file classification rules, and removes installer submodule checks.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: eliorerz, itzikezra-rh, eranco74, rccrdpccl


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (2 errors)

Check name Status Explanation Resolution
No-Injection-Vectors ❌ Error New workflow steps eval resolver output derived from mutable Git remote names in .git/config; this is eval on repository-controlled data, with five added consumers. Replace eval with strict parsing of the two expected assignment lines, or return validated remote names through a non-code interface and pass them as quoted arguments.
No-Sensitive-Data-In-Logs ❌ Error New diagnostics print remote URLs: bootstrap.sh logs raw old_url/upstream_url/fork_url, and resolve-remotes.sh only masks userinfo, not URL query/path tokens or internal hosts. Redact remote URLs before every log. Remove credentials, query/fragment secrets, and internal host details, or log only remote names and repository names.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the mono-repo tooling changes for the osac-csi-driver cutover.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed Changed files contain no hardcoded API keys, tokens, passwords, private keys, embedded-credential URLs, or long base64/hex blobs; credential references are placeholders or command substitutions.
No-Weak-Crypto ✅ Passed The 17-file patch adds no MD5, SHA1, DES, RC4, Blowfish, ECB, crypto API, custom crypto, or secret/token comparison usage.
Container-Privileges ✅ Passed The contributor diff adds no container/Kubernetes manifest or Dockerfile and no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or privilege-escalation settings.
Ai-Attribution ✅ Passed The PR description mentions an independent subagent, and both feature commits carry Assisted-by: Claude Code; neither feature commit uses an AI Co-Authored-By trailer.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@AGENTS.md`:
- Around line 44-54: Update the osac/osac-csi-driver row in the component table
to reference its README.md as the documentation fallback, since that component
has no AGENTS.md or CLAUDE.md. Keep the existing common documentation-discovery
rule unchanged.

In `@reference/STRUCTURE.md`:
- Around line 8-36: Update the Directory Purposes section in STRUCTURE.md so its
component paths are explicitly relative to the project root osac-workspace/,
adding the osac/ prefix to entries such as fulfillment-service/cmd and
osac-operator/cmd. Apply this consistently to all listed component paths while
preserving the existing directory descriptions.

In `@skills/create-pr/SKILL.md`:
- Line 146: Update the `--fix` documentation in the image-tag synchronization
guidance to explicitly exclude `osac-csi-driver` and require manually verifying
and updating its `csiDriver` and `csiBackends` tags, or add an equivalent
CSI-specific check/reminder. Preserve the automatic synchronization guidance for
supported components and state that manual updates remain required until
`sync-image-tags.sh` supports the CSI driver.
- Around line 40-43: Update the repository-name detection in the workflow to
derive the name from Git metadata, preferably remote.origin.url, rather than the
worktree directory basename. Ensure the osac mono-repository detection and
component validation still run for worktrees such as osac-feature-branch,
preserving support for branches that touch multiple component directories.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 95c15edb-c645-4114-8a92-b0958ed29bb1

📥 Commits

Reviewing files that changed from the base of the PR and between 43c34a8 and ce471a5.

📒 Files selected for processing (9)
  • .claude/rules/cross-repo-workflow.md
  • .gitignore
  • .skillsaw.yaml
  • AGENTS.md
  • README.md
  • bootstrap.sh
  • reference/CONVENTIONS.md
  • reference/STRUCTURE.md
  • skills/create-pr/SKILL.md

Comment thread AGENTS.md Outdated
Comment thread reference/STRUCTURE.md
Comment thread skills/create-pr/SKILL.md
Comment thread skills/create-pr/SKILL.md Outdated
CodeRabbit review, round 1 (4 actionable comments), all fixed:

- AGENTS.md: point osac-csi-driver's AGENTS.md column to its README.md
  as a fallback, matching cross-repo-workflow.md's routing table,
  which already had this caveat for the same doc-less-component gap.
- reference/STRUCTURE.md: add a scoping note clarifying that
  component-relative paths in Directory Purposes (e.g.
  fulfillment-service/cmd) are relative to osac/ -- resolves the
  ambiguity without a large, error-prone rename of the ~35 headers
  and dozens of body-text path mentions throughout the file that
  predate this PR.
- skills/create-pr/SKILL.md: fix REPO_NAME=$(basename "$REPO_DIR"),
  which silently breaks mono-repo component detection for any
  worktree-based change (worktree dirs are named e.g.
  ../osac-feature-branch per cross-repo-workflow.md, not "osac").
  Derive from remote.origin.url instead -- verified correct against
  the real osac clone from both its main checkout and a real
  worktree. Pre-existing bug, broader than osac-csi-driver, but
  small/safe/high-impact enough to fix here rather than defer.
- skills/create-pr/SKILL.md: add a manual-verification reminder for
  osac-csi-driver's csiDriver/csiBackends image tags next to the
  sync-image-tags.sh guidance, since that script doesn't cover them
  yet (a gap this PR already documents elsewhere).

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Tommy Hughes <tohughes@redhat.com>
…r-cutover

Resolves a conflict in skills/create-pr/SKILL.md between this branch's
osac-csi-driver additions and upstream's new tools/resolve-remotes.sh
dynamic remote detection (PR osac-project#147). Also updates the REPO_NAME
derivation added during /respond to use $UPSTREAM_REMOTE (resolved by
resolve-remotes.sh) instead of a hardcoded remote.origin.url guess,
since the whole point of resolve-remotes.sh is to not assume which
remote name is upstream.

Signed-off-by: Tommy Hughes <tohughes@redhat.com>
@tchughesiv tchughesiv added the lgtm label Aug 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
.claude/rules/cross-repo-workflow.md (1)

61-61: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a blank line after the heading.

markdownlint-cli2 reports MD022 because ### Pushing and PR Submission is immediately followed by a list item. Add one blank line after the heading.

Proposed fix
 ### Pushing and PR Submission
+
 - **Always push to `$PUSH_REMOTE`**, never to `$UPSTREAM_REMOTE`
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/rules/cross-repo-workflow.md at line 61, Add one blank line
immediately after the “Pushing and PR Submission” heading before the following
list item to satisfy Markdown heading-spacing requirements.

Source: Linters/SAST tools

bootstrap.sh (2)

183-195: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Avoid returning origin when the expected upstream URL is missing.

find_upstream_remote returns origin when no remote URL matches ${GITHUB_ORG}/${repo}, and callers use that value for git fetch "$upstream_remote" / git rebase "$upstream_remote/main" or as upstream_remote in remote get-url $upstream_remote. A clone can have origin point to a fork or unrelated repo, or origin can be missing entirely. Return failure when no matching URL is found, and stop or request confirmation in the callers.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bootstrap.sh` around lines 183 - 195, Update find_upstream_remote so it
returns a failure status instead of echoing origin when no remote URL matches
expected_suffix. Modify every caller that uses upstream_remote for git fetch,
git rebase, or remote get-url to detect this failure and stop safely or
explicitly request confirmation before continuing.

Source: Coding guidelines


252-256: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Validate the fork URL with an exact repository match.

The condition at Line 254 accepts any URL that contains ${GH_USER}/${repo}. For repo=osac, ${GH_USER}/osac-csi-driver matches and can be kept as the push remote. The condition also ignores FORK_OVERRIDES[$repo], although ensure_fork_remote uses it at Line 90. Bootstrap can push commits to an unintended repository.

Compare the normalized URL suffix with ${GH_USER}/${FORK_OVERRIDES[$repo]:-$repo}. Support both / and : URL separators.

Proposed fix
+fork_url_matches() {
+  local url="${1%.git}" expected="$2"
+  [[ "$url" == *"/${expected}" || "$url" == *":${expected}" ]]
+}
+
+      expected_fork_repo="${FORK_OVERRIDES[$repo]:-$repo}"
       existing_url=$(git -C "$dir" remote get-url "$FORK_REMOTE_NAME" 2>/dev/null) || existing_url=""
-      if [ -z "$existing_url" ] || [[ "${existing_url%.git}" != *"${GH_USER}/${repo}"* ]]; then
+      if [ -z "$existing_url" ] ||
+         ! fork_url_matches "$existing_url" "${GH_USER}/${expected_fork_repo}"; then

As per coding guidelines, the push target must be the developer fork and remote roles must be resolved from URLs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bootstrap.sh` around lines 252 - 256, Update the fork URL validation in the
NO_FORK block to compare the normalized remote URL against the exact developer
repository suffix `${GH_USER}/${FORK_OVERRIDES[$repo]:-$repo}`, rather than
using a substring match. Normalize both URL forms so repository paths using
either `/` or `:` separators are accepted, while preserving the existing
behavior of calling ensure_fork_remote when the remote is missing or mismatched.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.claude/rules/cross-repo-workflow.md:
- Line 61: Add one blank line immediately after the “Pushing and PR Submission”
heading before the following list item to satisfy Markdown heading-spacing
requirements.

In `@bootstrap.sh`:
- Around line 183-195: Update find_upstream_remote so it returns a failure
status instead of echoing origin when no remote URL matches expected_suffix.
Modify every caller that uses upstream_remote for git fetch, git rebase, or
remote get-url to detect this failure and stop safely or explicitly request
confirmation before continuing.
- Around line 252-256: Update the fork URL validation in the NO_FORK block to
compare the normalized remote URL against the exact developer repository suffix
`${GH_USER}/${FORK_OVERRIDES[$repo]:-$repo}`, rather than using a substring
match. Normalize both URL forms so repository paths using either `/` or `:`
separators are accepted, while preserving the existing behavior of calling
ensure_fork_remote when the remote is missing or mismatched.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: dde03512-aabf-4360-a5fe-84d8f2e43bcc

📥 Commits

Reviewing files that changed from the base of the PR and between bc103f1 and 5b57f02.

📒 Files selected for processing (5)
  • .claude/rules/cross-repo-workflow.md
  • AGENTS.md
  • README.md
  • bootstrap.sh
  • skills/create-pr/SKILL.md

@openshift-merge-bot
openshift-merge-bot Bot merged commit 205bbf6 into osac-project:main Aug 3, 2026
4 checks passed
@tchughesiv

Copy link
Copy Markdown
Contributor Author

Thanks for the follow-up review on the merge commit — all 3 "outside diff range" findings here are legitimate (verified each against the actual code), but they're in bootstrap.sh/cross-repo-workflow.md code introduced by #147 (tools/resolve-remotes.sh), not by this PR's osac-csi-driver work. This PR merged before I could apply fixes, so they're addressed in a follow-up instead: #185.

  • find_upstream_remote's silent origin fallback — confirmed 2 of 3 call sites were already unreachable (guarded by is_expected_clone's identical match logic first), but the third (the "Available repos" summary) was genuinely reachable and now shows "unknown" instead of guessing.
  • The fork-URL substring match — confirmed real, including the FORK_OVERRIDES inconsistency with ensure_fork_remote. Fixed with an end-anchored match consistent with is_expected_clone's existing pattern.
  • The MD022 blank-line issue — fixed, plus two more headings in the same section with the identical pattern for consistency.

See #185 for the fixes, verification, and test plan.

openshift-merge-bot Bot pushed a commit that referenced this pull request Aug 5, 2026
CodeRabbit's review of PR #183's merge commit (which pulled in
tools/resolve-remotes.sh from #147) flagged three issues in code that
PR #147 introduced. PR #183 merged before these could be addressed, so
fixing them here instead:

- find_upstream_remote() silently returned "origin" when no remote
  matched osac-project/<repo>, which could be wrong or missing. Now
  returns failure instead; all three call sites handle it explicitly
  (two were already unreachable in practice since is_expected_clone
  guards them with the same match logic, but are now guarded
  defensively; the third, the "Available repos" summary, was genuinely
  unguarded and now shows "unknown" instead of guessing).
- The existing-fork-remote check used an unanchored substring match
  (*"$GH_USER/$repo"*), so a fork URL for a longer repo name sharing a
  prefix (e.g. osac-csi-driver) would false-positive as a match for
  "osac". It also ignored FORK_OVERRIDES, unlike ensure_fork_remote's
  own use of it. Fixed to an end-anchored, FORK_OVERRIDES-aware match,
  consistent with is_expected_clone's existing pattern.
- Added a missing blank line after three "###" headings in
  cross-repo-workflow.md for markdownlint MD022 (one flagged directly,
  two more with the identical pattern fixed for consistency).

Verified: live bootstrap.sh runs in both --no-fork and default (fork)
modes, isolated bash tests reproducing both the substring-match and
FORK_OVERRIDES bugs against the old vs. new logic, shellcheck, and
make skillsaw.

Signed-off-by: Tommy Hughes <tohughes@redhat.com>
openshift-merge-bot Bot added a commit that referenced this pull request Aug 5, 2026
…n-bugs

NO-ISSUE: Fix bootstrap.sh remote-detection bugs found in PR #183 review
openshift-merge-bot Bot pushed a commit that referenced this pull request Aug 5, 2026
Re-checked osac-project/osac's commit history for drift since the
csi-driver cutover (PR #183/#185). Two real components were found
migrated/removed further (osac-metering created in-repo, kind-dev
migrated from this workspace) -- osac-metering is intentionally not
onboarded here since it was never a standalone repo to migrate, but the
following stale references were fixed:

- scripts/sync-image-tags.sh was deleted upstream (OSAC-3367, which
  dropped image-tag pinning entirely for mono-repo-resident
  components -- values/*/values.yaml now use unpinned `latest`, and
  real release tags are set automatically by osac's own CI). Removed
  now-false guidance to run it from AGENTS.md, reference/CONVENTIONS.md,
  and skills/create-pr/SKILL.md.
- Leftover `git submodule update --init --recursive` calls in
  skills/osac-cluster/SKILL.md, skills/osac-cluster/references/refresh.md,
  and kind-dev/setup.sh -- no .gitmodules exists anywhere in osac
  anymore (confirmed against current origin/main), so these were dead
  no-ops left over from the pre-mono-repo layout.
- Documented (AGENTS.md) that osac now ships its own root
  AGENTS.md/tools/bootstrap.sh (OSAC-3557) for standalone use outside
  this workspace -- warns against running it from within
  osac-workspace, which would install a second, out-of-sync
  .ai-workflows clone alongside this workspace's own.

Confirmed osac-workspace/kind-dev/ and osac/kind-dev/ are NOT
duplicates despite the migration: each is adapted for its own
directory depth (osac-workspace's copy reaches through `osac/`, the
migrated copy reaches its mono-repo siblings directly) -- left both in
place.

Verified: skillsaw lint (full repo + osac-cluster/create-pr scoped
runs) A grade, 0 errors/warnings; bash -n and shellcheck on the
modified shell scripts; full-repo grep confirms no remaining live-doc
references to sync-image-tags.sh or git submodule (only historical
.artifacts/, quarantined .legacy-repos/, and osac's own files still
mention them, which is expected).

Part of OSAC-1739.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Tommy Hughes <tohughes@redhat.com>
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.

2 participants