feat: support single-repo profiles via raid.yaml (closes #52)#79
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #79 +/- ##
==========================================
+ Coverage 91.11% 91.13% +0.02%
==========================================
Files 33 33
Lines 2915 2978 +63
==========================================
+ Hits 2656 2714 +58
- Misses 169 171 +2
- Partials 90 93 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds “repo-as-a-profile” support so a standalone raid.yaml can be registered and used directly as a single-repo profile, without requiring a wrapping profile.raid.yml/*.raid.yaml profile file. This extends Raid’s profile loading/doctor flows to recognize single-repo mode and exposes repo-defined environments/commands at the profile level so existing CLI commands continue to work.
Changes:
- Allow
raid profile add ./raid.yamlto validate against the repo schema and register it as a synthesized single-repo profile (named fromraid.yaml:name). - Extend load + doctor paths to detect single-repo profiles and switch schema validation/pipeline behavior accordingly (including promoting repo environments to profile environments).
- Update docs/README and repo configuration to dogfood the feature (remove committed
profile.raid.yml, add.gitignoreentries, update release notes).
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/resources/app.properties | Version bump to 0.12.0-beta. |
| src/raid/profile/profile.go | Adds public wrappers for repo-config validation and single-repo profile synthesis. |
| src/raid/profile/profile_test.go | Adds tests for the new wrapper functions. |
| src/internal/lib/profile.go | Implements single-repo detection + synthetic profile builder; branches build pipeline. |
| src/internal/lib/profile_test.go | Adds unit/integration tests for single-repo profiles and load behavior. |
| src/internal/lib/lib.go | Promotes repo environments to profile level in single-repo mode. |
| src/internal/lib/doctor.go | Adds doctor support for validating single-repo profiles via repo schema and checking the synthesized repo. |
| src/internal/lib/doctor_test.go | Adds tests for doctor behavior in single-repo mode. |
| src/cmd/profile/profile_test.go | Adds CLI-level tests for adding raid.yaml as a profile. |
| src/cmd/profile/add.go | Adds repo-schema fallback path to raid profile add for local raid.yaml. |
| site/docs/whats-new.mdx | Documents the upcoming 0.12.0 feature. |
| site/docs/usage/profile.mdx | Documents raid profile add ./raid.yaml single-repo usage. |
| site/docs/features/profiles.mdx | Adds “Single-repo profiles” section and examples. |
| README.md | Updates monorepo guidance to reflect single-repo profile registration. |
| profile.raid.yml | Removes committed dev profile (repo now uses raid.yaml directly). |
| llms.txt | Updates documentation index blurb to mention single-repo raid.yaml support. |
| CLAUDE.md | Updates developer notes to reflect dogfooding single-repo-profile mode and .gitignore behavior. |
| .gitignore | Ignores local profile.raid.yml/profile.raid.yaml so dev profiles aren’t committed. |
| var profiles []pro.Profile | ||
| if err := proValidate(path); err != nil { | ||
| fmt.Printf("Invalid Profile: %v\n", err) | ||
| return 1 | ||
| } | ||
|
|
||
| profiles, err := proUnmarshal(path) | ||
| if err != nil { | ||
| fmt.Printf("Failed to extract profiles: %v\n", err) | ||
| return 1 | ||
| // Fall back to repo-schema validation so users can run | ||
| // `raid profile add ./raid.yaml` directly on a repo config. | ||
| if rerr := proValidateRepo(path); rerr == nil { | ||
| single, serr := proSynthesizeRepo(path) | ||
| if serr != nil { | ||
| fmt.Printf("Invalid Repo Config: %v\n", serr) | ||
| return 1 | ||
| } | ||
| profiles = []pro.Profile{single} | ||
| } else { | ||
| fmt.Printf("Invalid Profile: %v\n", err) | ||
| return 1 | ||
| } |
| // Fall back to repo-schema validation so users can run | ||
| // `raid profile add ./raid.yaml` directly on a repo config. | ||
| if rerr := proValidateRepo(path); rerr == nil { | ||
| single, serr := proSynthesizeRepo(path) | ||
| if serr != nil { | ||
| fmt.Printf("Invalid Repo Config: %v\n", serr) | ||
| return 1 | ||
| } | ||
| profiles = []pro.Profile{single} | ||
| } else { | ||
| fmt.Printf("Invalid Profile: %v\n", err) | ||
| return 1 | ||
| } |
| repoDir := filepath.Dir(path) | ||
| repo, err := ExtractRepo(repoDir) | ||
| if err != nil { | ||
| return Profile{}, err | ||
| } |
| return Profile{}, fmt.Errorf("profile file not found at %s", profile.Path) | ||
| } | ||
| if profile.IsSingleRepo() { | ||
| return BuildSingleRepoProfile(profile.Path) |
| return Profile{}, err | ||
| } | ||
| if repo.Name == "" { | ||
| return Profile{}, fmt.Errorf("raid.yaml at %s has no name field", path) |
- Detect raid.yaml by basename and validate against the repo schema directly, so a missing `branch` surfaces as "Invalid raid.yaml" instead of a misleading "Invalid Profile" message. - Drop the redundant ValidateRepoConfig call; SynthesizeFromRepoConfig already validates, so the previous flow validated repo configs twice (loading embedded schemas on each call). - Keep a non-raid.yaml fallback path so renamed repo configs still work. Co-Authored-By: Copilot <copilot@github.com>
- Enforce that BuildSingleRepoProfile's path argument is named raid.yaml up front. ExtractRepo reads <dir>/raid.yaml unconditionally, so a caller passing a renamed or symlinked file would otherwise validate one file and load another. - In buildProfile, refuse to load a single-repo profile whose registered name no longer matches the raid.yaml's current `name:` field. Active- profile detection compares against the registered key, so silently swapping in a different name breaks `profile list` and friends. - Reword the empty-name error to "missing or empty name" since the check fires on `name: ""` as well as a missing key. Co-Authored-By: Copilot <copilot@github.com>
Exercises the new code paths added in the previous two Copilot-fix commits: - BuildSingleRepoProfile rejects a non-raid.yaml basename. - buildProfile rejects (and accepts) registered-name vs current-name in single-repo mode. - runAddProfile reports "Invalid raid.yaml" when a raid.yaml fails the repo schema. - runAddProfile falls through to "Invalid Profile" when a renamed file fails profile validation and also fails the basename guard.
|
Auto-review by meeseeks Updates pushed: 3 commits
Copilot comments addressed: 5 of 5
Skipped: 0 |
Summary
raid profile add ./raid.yamlnow registers a repo config directly as a single-repo profile — no wrapping profile file required. Profile is named after the raid.yaml'snamefield, activates viaraid profile <name>like any other profile.raid.yaml);Profile.IsSingleRepo()switches the load and doctor paths to repo-schema validation.environmentsare surfaced at profile level soraid env/raid env listwork without a wrapping profile YAML.profile.raid.ymlremoved; raid.yaml is registered directly.Test plan
go test ./...all greenExtractReporacenpm run buildin site/ succeeds (no broken docsite links)raid profile add,raid <command>,raid doctor(reportsvalid (single-repo)), andraid context --jsonall behave correctlyraid profile add ./raid.yaml;raid doctorreports all green locally🤖 Generated with Claude Code