feat: distribute shared/ files across org repos#7
Conversation
- New shared/ directory with org-wide files: CODE_OF_CONDUCT.md, CONTRIBUTING.md, LICENSE.md, and ISSUE_TEMPLATE/config.yml - distribute-shared.yml workflow (workflow_dispatch only, pushes to main) - Fix --destination . bug in propagate-files.sh (rm -rf . would delete the entire cloned checkout)
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR adds a manually-triggered GitHub Actions workflow ( ChangesShared Files Distribution
Estimated code review effort: 2 (Simple) | ~12 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant GitHubActions as distribute-shared.yml
participant Script as propagate-files.sh
participant TargetRepo
User->>GitHubActions: trigger workflow_dispatch (optional repo_name)
GitHubActions->>GitHubActions: checkout .github repo
GitHubActions->>Script: run with --source shared/ --destination .
alt repo_name provided
Script->>TargetRepo: copy shared/ into single repo
else no repo_name
Script->>TargetRepo: copy shared/ into all org repos
end
Script-->>GitHubActions: commit "Sync shared files from .github"
Related Issues: None found Related PRs: None found Suggested labels: documentation, ci Suggested reviewers: None found 🐰 A carrot-shaped workflow, dispatched by hand, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
scripts/propagate-files.sh (2)
96-107: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPreserve file-source behavior for
DEST=".".This branch only copies directory contents; a supported
--source <file> --destination .invocation now becomes a silent no-op. Split the root case by source type so file sources still copy into the repo root.Proposed fix
- if [ "$DEST" = "." ]; then + if [ "$DEST" = "." ] && [ -d "$ROOT/$SOURCE" ]; then # Destination is the repo root — copy items individually to avoid rm -rf . for item in "$ROOT/$SOURCE"/* "$ROOT/$SOURCE"/.[!.]*; do [ -e "$item" ] || continue cp -r "$item" "$TARGET/" done + elif [ "$DEST" = "." ]; then + cp "$ROOT/$SOURCE" "$TARGET/" elif [ -d "$ROOT/$SOURCE" ]; then🤖 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 `@scripts/propagate-files.sh` around lines 96 - 107, The DEST="." branch in propagate-files.sh currently only iterates directory contents, so a file source passed to the repo root is skipped. Update the DEST root handling to distinguish files from directories in the ROOT/SOURCE path, and when the source is a file, copy that file directly into TARGET instead of iterating. Keep the existing directory-content copy behavior for directories, using the same propagate-files.sh flow around DEST, SOURCE, and TARGET.
58-67: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winPage through the org repo list before
--alldispatchesgh repo list "$ORG" --limit 500returns at most 500 repos total, so larger orgs will be skipped silently. Use pagination over the full repo set before syncing.🤖 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 `@scripts/propagate-files.sh` around lines 58 - 67, The TARGET_ALL branch in propagate-files.sh only pulls up to 500 repos via gh repo list, so larger orgs will be missed; update the repo collection logic to paginate through the full organization repo set before building REPOS. Keep the fix localized to the --all path and preserve the existing TARGET_REPO behavior.
🤖 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 @.github/workflows/distribute-shared.yml:
- Around line 16-17: The checkout step in the distribute-shared workflow
persists credentials unnecessarily; update the actions/checkout usage in the
Checkout .github step to disable persisted token credentials so later steps
cannot reuse the default token. Keep the fix localized to that checkout
configuration and preserve the rest of the job behavior.
In `@PLAN-distribute-files.md`:
- Around line 16-24: The directory sketch in the plan document uses an unlabeled
fenced code block, which will trigger markdownlint MD040. Update the fence
around the shared/ tree example to include a language label such as text,
keeping the existing content and closing fence intact; the fix is in the
markdown section containing the shared/ directory sketch.
In `@shared/CONTRIBUTING.md`:
- Around line 27-31: The sign-off example in CONTRIBUTING.md uses an unlabeled
fenced code block, which can trigger markdownlint MD040 in strict repos. Update
the example fence around the Signed-off-by snippet to use a language label such
as text, keeping the example content the same and ensuring the fenced block is
explicitly labeled.
---
Outside diff comments:
In `@scripts/propagate-files.sh`:
- Around line 96-107: The DEST="." branch in propagate-files.sh currently only
iterates directory contents, so a file source passed to the repo root is
skipped. Update the DEST root handling to distinguish files from directories in
the ROOT/SOURCE path, and when the source is a file, copy that file directly
into TARGET instead of iterating. Keep the existing directory-content copy
behavior for directories, using the same propagate-files.sh flow around DEST,
SOURCE, and TARGET.
- Around line 58-67: The TARGET_ALL branch in propagate-files.sh only pulls up
to 500 repos via gh repo list, so larger orgs will be missed; update the repo
collection logic to paginate through the full organization repo set before
building REPOS. Keep the fix localized to the --all path and preserve the
existing TARGET_REPO behavior.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 35932ce2-d894-4dc7-b6d7-663848297cce
📒 Files selected for processing (7)
.github/workflows/distribute-shared.ymlPLAN-distribute-files.mdscripts/propagate-files.shshared/.github/ISSUE_TEMPLATE/config.ymlshared/CODE_OF_CONDUCT.mdshared/CONTRIBUTING.mdshared/LICENSE.md
Seeing this I'm thinking we should instead have two shared directories:
What do you think @OmikronApex ? |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 2 file(s) based on 3 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken:
Lines 15–20 steps:
- name: Checkout .github
uses: actions/checkout@v7
+ with:
+ persist-credentials: false
- name: Propagate shared/ to all org repos
env: |
Fixed 2 file(s) based on 3 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
0d4c5bc to
2a1ce90
Compare
| ## Getting started | ||
|
|
||
| 1. Find the right repo — most issues belong in `got-feedback/feedback`. | ||
| Plugin-specific issues go in the plugin's repo. |
There was a problem hiding this comment.
We should remove this; we want to direct all issues to got-feedback/feedback.
Summary
Adds a
shared/directory and aworkflow_dispatch-only workflow that propagates its contents to every org repo (including.githubitself) viascripts/propagate-files.sh.Included in
shared/CODE_OF_CONDUCT.mdCONTRIBUTING.mdLICENSE.md.github/ISSUE_TEMPLATE/config.ymlfeedbackrepofeedBackuses AGPL-3.0, not MIT. Propagatingshared/LICENSE.mdtofeedBackwould overwrite itsLICENSEfile. Options: remove LICENSE fromshared/, scope it to plugin repos only, or treat it as a deliberate override.feedBackalready has its ownCONTRIBUTING.mdwith AGPL and DCO details. The shared version references the org docs and is compatible in spirit but less specific. Same overwrite concern.docs/directory (branching, pipeline, guidelines, plugins) stays in.githubonly — not copied.Other changes
propagate-files.shbug:--destination .previously ranrm -rf /tmp/propagate-$repo/.which deleted the entire cloned checkout. Now handles root destination as a special case, copying each item individually.actions/checkoutto v7 to avoid Node 20 deprecation warning.How to test
repo_name: community-code-reviewto verify a single targetrepo_nameto propagate to all reposSummary by CodeRabbit
New Features
Bug Fixes