Skip to content

feat: support single-repo profiles via raid.yaml (closes #52)#79

Merged
8bitAlex merged 4 commits into
mainfrom
feat/issue-52-single-repo-profile
May 11, 2026
Merged

feat: support single-repo profiles via raid.yaml (closes #52)#79
8bitAlex merged 4 commits into
mainfrom
feat/issue-52-single-repo-profile

Conversation

@8bitAlex
Copy link
Copy Markdown
Owner

Summary

  • raid profile add ./raid.yaml now registers a repo config directly as a single-repo profile — no wrapping profile file required. Profile is named after the raid.yaml's name field, activates via raid profile <name> like any other profile.
  • Existing multi-repo profiles continue to work unchanged. Detection is by registered path basename (raid.yaml); Profile.IsSingleRepo() switches the load and doctor paths to repo-schema validation.
  • In single-repo mode the repo's environments are surfaced at profile level so raid env / raid env list work without a wrapping profile YAML.
  • This repo dogfoods the feature: profile.raid.yml removed; raid.yaml is registered directly.

Test plan

  • go test ./... all green
  • Coverage 94.5% overall; new code paths fully covered except one unreachable ExtractRepo race
  • npm run build in site/ succeeds (no broken docsite links)
  • Manual smoke test: registered a temp raid.yaml, verified raid profile add, raid <command>, raid doctor (reports valid (single-repo)), and raid context --json all behave correctly
  • Dogfooded: this repo now self-registers via raid profile add ./raid.yaml; raid doctor reports all green locally

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 11, 2026 23:31
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.13%. Comparing base (ff29f6e) to head (da3d53e).

Files with missing lines Patch % Lines
src/cmd/profile/add.go 84.21% 1 Missing and 2 partials ⚠️
src/internal/lib/profile.go 93.75% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

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 “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.yaml to validate against the repo schema and register it as a synthesized single-repo profile (named from raid.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 .gitignore entries, 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.

Comment thread src/cmd/profile/add.go
Comment on lines +66 to +80
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
}
Comment thread src/cmd/profile/add.go Outdated
Comment on lines +68 to +80
// 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
}
Comment on lines +350 to +354
repoDir := filepath.Dir(path)
repo, err := ExtractRepo(repoDir)
if err != nil {
return Profile{}, err
}
Comment thread src/internal/lib/profile.go Outdated
return Profile{}, fmt.Errorf("profile file not found at %s", profile.Path)
}
if profile.IsSingleRepo() {
return BuildSingleRepoProfile(profile.Path)
Comment thread src/internal/lib/profile.go Outdated
return Profile{}, err
}
if repo.Name == "" {
return Profile{}, fmt.Errorf("raid.yaml at %s has no name field", path)
meeseeks-bot and others added 3 commits May 11, 2026 16:40
- 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.
@8bitAlex
Copy link
Copy Markdown
Owner Author

Auto-review by meeseeks

Updates pushed: 3 commits

  • 27e159b fix: address Copilot review — repo-config detection in profile add
  • 16fd541 fix: address Copilot review — BuildSingleRepoProfile path + name guards
  • da3d53e test: cover lines flagged by Codecov patch check

Copilot comments addressed: 5 of 5

  • add.go misleading error: detect raid.yaml by basename and surface the repo-schema error as "Invalid raid.yaml" instead of "Invalid Profile".
  • add.go double-validation: removed redundant ValidateRepoConfig call; SynthesizeFromRepoConfig already validates, so repo configs are now parsed/validated once.
  • BuildSingleRepoProfile filename drift: enforce filepath.Base(path) == RaidConfigFileName up front so we can't validate one file and load another.
  • buildProfile name divergence: refuse to load a single-repo profile whose registered key differs from the raid.yaml's current name:; error tells the user to re-run raid profile add.
  • Empty-name message: now reads "missing or empty name field" since the check also fires on name: "".

Skipped: 0
Codecov patch: 92.85% (project 91.13%) — pass
Other CI: green

@8bitAlex 8bitAlex merged commit 8357916 into main May 11, 2026
13 checks passed
@8bitAlex 8bitAlex deleted the feat/issue-52-single-repo-profile branch May 11, 2026 23:59
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