Repository navigation
OSAC-3557: Add AI-assisted development infrastructure to mono-repo - #104
openshift-merge-bot[bot] merged 2 commits into
Conversation
|
@eranco74: This pull request references OSAC-3557 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. DetailsIn response to this:
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. |
|
Warning Review limit reached
Next review available in: 20 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
WalkthroughAdded Claude session hooks, workflow bootstrap configuration, repository synchronization status reporting, and OSAC development guidance. ChangesAI workflow integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Claude
participant update-ai-context.sh
participant ProjectRepository
participant AIWorkflows
Claude->>update-ai-context.sh: Start session
update-ai-context.sh->>ProjectRepository: Fetch and rebase eligible branch
update-ai-context.sh->>AIWorkflows: Fetch and rebase main branch
update-ai-context.sh-->>Claude: Report synchronization status
Possibly related PRs
Suggested reviewers: Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (10 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
|
||
| ## Git Workflow | ||
|
|
||
| - **Fork-based**: push to `fork` remote, never to `origin`. PRs go from `fork/<branch>` to `origin/main` |
There was a problem hiding this comment.
Same comment as in the previous PR.
These are per developer configurations, no need to include it.
Or, since we have a chance now, consider adopting a more common pattern:
origin= forkupstream= the main repo
This is the convention I've personally always used, and it is also what github documents for example.
This way the rule will not be needed as well
Always push to fork, never to origin
because you can push to origin normally.
But I don't think the agents.md should assume the dev's configuration and/or dictate it.
|
|
||
| PRD and design workflows publish to the separate `enhancement-proposals` repo (clone as sibling at `../enhancement-proposals/`). Feature directory: `enhancements/<jira-key>-<feature-slug>/` with `prd.md` and `design.md`. Push to `fork` remote. | ||
|
|
||
| ## Jira Conventions |
There was a problem hiding this comment.
We don't need references to jira in the upstream repo
There was a problem hiding this comment.
I don't mind starting without it.
Note that claude won't know how to access jira or what's the jira project without it.
We can call it "upstream repo", The osac team is using Jira for task management; it makes sense to allow the AI tools to know how to access it
There was a problem hiding this comment.
It is usually defined in the skill being used, or it's enough to just say "use jira cli" - that works for me as well. For example report-bug covers it, and I think some others as well
| - **AI attribution**: `Assisted-by: Claude Code <noreply@anthropic.com>` — never `Co-Authored-By` for AI tools (Red Hat attribution standard) | ||
| - **Commit message**: `OSAC-XXXXX: description` (Jira key) or `NO-ISSUE: description` | ||
|
|
||
| ## Deployment Coordination |
There was a problem hiding this comment.
I think we need a separate file for deployment concerns. It doesn't have to be loaded on every session
| - OSAC uses Jira **Tasks** (not Stories) for implementation work | ||
| - Use `jira` CLI for Jira access (e.g., `jira issue view OSAC-1234 --plain`), not Jira MCP | ||
|
|
||
| ## AI-Assisted Workflows |
There was a problem hiding this comment.
One time operation, I don't think we need this on every session start as well
| | `bare-metal-fulfillment-operator/` | Kubernetes operator for bare-metal host pools | | ||
| | `osac-csi-driver/` | CSI meta-driver aggregating vendor storage drivers | | ||
|
|
||
| External repos (clone as siblings for cross-repo workflows): |
There was a problem hiding this comment.
It would be nice to add a few words about what these repos are and when they are needed. Similar to the components section
There was a problem hiding this comment.
You can send a follow-up PR adding a few nice words about these repos, I want to get us going.
|
|
||
| OSAC (Open Sovereign AI Cloud) is a fulfillment system for provisioning Kubernetes clusters, compute instances, bare-metal hosts, and networking. This mono-repo contains six components, each with its own `CLAUDE.md`/`AGENTS.md` — **read the component's docs before making changes in it** (progressive disclosure). | ||
|
|
||
| ## Components |
|
|
||
| ## Enhancement Proposals | ||
|
|
||
| PRD and design workflows publish to the separate `enhancement-proposals` repo (clone as sibling at `../enhancement-proposals/`). Feature directory: `enhancements/<jira-key>-<feature-slug>/` with `prd.md` and `design.md`. Push to `fork` remote. |
There was a problem hiding this comment.
| trap - INT TERM | ||
| } | ||
|
|
||
| fetch_and_rebase "$REPO_DIR" "osac" true |
There was a problem hiding this comment.
So this will run each time I'm on main and start a claude session? I don’t think that’s always desirable assuming it touches local files
There was a problem hiding this comment.
You are right, we needed that when we had the meta repo.
I'll update it
6242f28 to
ad969c7
Compare
ad969c7 to
f05c650
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 @.claude/hooks/update-ai-context.sh:
- Around line 50-51: Update the fetch_and_rebase invocation for
"${HOME}/.ai-workflows" to pass the only_on_main argument as true, matching the
existing osac call so feature branches are not force-rebased. If rebasing every
branch is intentional instead, document that behavior in the hook’s existing
comment.
In `@tools/bootstrap.sh`:
- Line 22: Update the AI_WORKFLOWS_DIR assignment in bootstrap.sh to use
realpath instead of readlink -f, matching the existing SCRIPT_DIR and
PROJECT_ROOT path-resolution commands.
- Around line 21-42: Extract the repeated fetch-and-rebase sequence from the two
ai-workflows branches into a parameterized function, following the existing
fetch_and_rebase pattern in update-ai-context.sh. Have the function accept the
workflow directory and context-specific log text, preserve fetch failure, rebase
failure with abort, manual recovery guidance, and success messages, then call it
from both branches.
🪄 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: 178c61b3-34a4-402a-abb3-a10e6b1155c5
📒 Files selected for processing (11)
.claude/hooks/statusline.sh.claude/hooks/update-ai-context.sh.claude/rules/architecture-patterns.md.claude/rules/cli-ux.md.claude/rules/networking-design-alignment.md.claude/rules/request-path-tracing.md.claude/settings.json.gitignoreAGENTS.mdCLAUDE.mdtools/bootstrap.sh
| fetch_and_rebase "$REPO_DIR" "osac" true | ||
| fetch_and_rebase "${HOME}/.ai-workflows" "ai-workflows" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Ai-workflows checkout is always force-rebased, even on non-main branches.
Line 50 passes true for only_on_main, so osac is only rebased when the branch is main; on other branches it only reports divergence. Line 51 omits this argument for ai-workflows, so only_on_main defaults to false and the guard at line 14 never applies.
As a result, if a developer checks out a feature branch inside ~/.ai-workflows (for example, to test or contribute a change), this SessionStart hook silently rebases that branch onto origin/main on every session start, rewriting local commit history. This does not match the safety behavior already established for osac.
🔧 Proposed fix
-fetch_and_rebase "${HOME}/.ai-workflows" "ai-workflows"
+fetch_and_rebase "${HOME}/.ai-workflows" "ai-workflows" true📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fetch_and_rebase "$REPO_DIR" "osac" true | |
| fetch_and_rebase "${HOME}/.ai-workflows" "ai-workflows" | |
| fetch_and_rebase "$REPO_DIR" "osac" true | |
| fetch_and_rebase "${HOME}/.ai-workflows" "ai-workflows" true |
🤖 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/hooks/update-ai-context.sh around lines 50 - 51, Update the
fetch_and_rebase invocation for "${HOME}/.ai-workflows" to pass the only_on_main
argument as true, matching the existing osac call so feature branches are not
force-rebased. If rebasing every branch is intentional instead, document that
behavior in the hook’s existing comment.
| # --- ai-workflows (flightctl) --- | ||
|
|
||
| if [[ -d "${HOME}/.ai-workflows" ]]; then | ||
| AI_WORKFLOWS_DIR="$(readlink -f "${HOME}/.ai-workflows")" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔵 Trivial | 💤 Low value
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Repo files matching bootstrap:\n'
fd -a 'bootstrap\.sh$' . | sed 's#^\./##'
printf '\nGit diff/stat if available:\n'
git diff --stat || true
printf '\ntools/bootstrap.sh outline and relevant lines:\n'
if [ -f tools/bootstrap.sh ]; then
wc -l tools/bootstrap.sh
sed -n '1,60p' tools/bootstrap.sh | cat -n
printf '\nOccurrences of readlink/realpath in tools/bootstrap.sh:\n'
rg -n 'readlink|realpath|AI_WORKFLOWS_DIR|AI_PROJECTS_DIR' tools/bootstrap.sh || true
fi
printf '\nSystem command availability/docs:\n'
command -v realpath || true
command -v readlink || true
( [ -x "$(command -v realpath)" ] && realpath --version 2>&1 | head -5 ) || true
( [ -x "$(command -v readlink)" ] && readlink --help 2>/dev/null | sed -n '1,12p' ) || trueRepository: osac-project/osac
Length of output: 4823
Use realpath here for consistency.
tools/bootstrap.sh already resolves SCRIPT_DIR and PROJECT_ROOT with realpath; use the same command for AI_WORKFLOWS_DIR instead of mixing in readlink -f.
🤖 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 `@tools/bootstrap.sh` at line 22, Update the AI_WORKFLOWS_DIR assignment in
bootstrap.sh to use realpath instead of readlink -f, matching the existing
SCRIPT_DIR and PROJECT_ROOT path-resolution commands.
f05c650 to
498ac36
Compare
Add root CLAUDE.md/AGENTS.md with cross-cutting project coordination (component table, change order, git workflow, deployment, enhancement proposals, Jira conventions). Add .claude/ infrastructure (settings, 4 auto-loaded rules, session hooks) and tools/bootstrap.sh to install flightctl/ai-workflows. OSAC-specific skills will be installed from a separate repo. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Eran Cohen <eranco@redhat.com>
498ac36 to
a364589
Compare
…ange order only Remove git workflow, Jira conventions, deployment coordination, enhancement proposals, and bootstrap instructions. Add descriptions to external repos table. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Eran Cohen <eranco@redhat.com>
a364589 to
131809c
Compare
amito
left a comment
There was a problem hiding this comment.
/lgtm
Small comment on duplication that can be deferred to separate PR, does not block approval.
| echo " ai-workflows up to date" | ||
| fi | ||
| elif [[ -d "${PROJECT_ROOT}/.ai-workflows" ]]; then | ||
| AI_WORKFLOWS_DIR="${PROJECT_ROOT}/.ai-workflows" |
There was a problem hiding this comment.
That's pretty much the same code as in lines 22-31, only with a different path.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amito, eranco74 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
NO-ISSUE: add Playwright e2e harness for manual verification against a live cluster
Summary
CLAUDE.md/AGENTS.mdwith cross-cutting project coordination (component table, change order, git workflow, deployment, enhancement proposals, Jira conventions).claude/infrastructure:settings.json(permissions, SessionStart hook, statusline), 4 auto-loaded rules, session hookstools/bootstrap.shto install flightctl/ai-workflows (bugfix, implement, prd, design, e2e)No content is duplicated from component-level AGENTS.md files — the root docs cover only cross-component coordination that no single component doc has.
Jira
https://redhat.atlassian.net/browse/OSAC-3557
What's included
CLAUDE.md@AGENTS.mdAGENTS.md.claude/settings.json.claude/rules/(4 files).claude/hooks/(2 files)tools/bootstrap.sh.gitignoreTest plan
tools/bootstrap.shinstalls ai-workflowsAssisted-by: Claude Code noreply@anthropic.com
Summary by CodeRabbit
New Features
Documentation
Chores