Skip to content

feat: distribute shared/ files across org repos#7

Draft
mogul wants to merge 3 commits into
mainfrom
feat/distribute-shared
Draft

feat: distribute shared/ files across org repos#7
mogul wants to merge 3 commits into
mainfrom
feat/distribute-shared

Conversation

@mogul

@mogul mogul commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a shared/ directory and a workflow_dispatch-only workflow that propagates its contents to every org repo (including .github itself) via scripts/propagate-files.sh.

Included in shared/

File Purpose
CODE_OF_CONDUCT.md Contributor Covenant v2.1 — org-wide standard
CONTRIBUTING.md Org-wide contributing guide (DCO, PR workflow, links to .github docs)
LICENSE.md MIT license for repos that use it
.github/ISSUE_TEMPLATE/config.yml Redirects issue submitters to central feedback repo

⚠️ Known conflicts to discuss:

  • feedBack uses AGPL-3.0, not MIT. Propagating shared/LICENSE.md to feedBack would overwrite its LICENSE file. Options: remove LICENSE from shared/, scope it to plugin repos only, or treat it as a deliberate override.
  • feedBack already has its own CONTRIBUTING.md with AGPL and DCO details. The shared version references the org docs and is compatible in spirit but less specific. Same overwrite concern.
  • The docs/ directory (branching, pipeline, guidelines, plugins) stays in .github only — not copied.

Other changes

  • Fix propagate-files.sh bug: --destination . previously ran rm -rf /tmp/propagate-$repo/. which deleted the entire cloned checkout. Now handles root destination as a special case, copying each item individually.
  • Bumped actions/checkout to v7 to avoid Node 20 deprecation warning.

How to test

  1. Merge this PR
  2. Go to Actions → Distribute shared files → Run workflow
  3. Start with repo_name: community-code-review to verify a single target
  4. Run again with empty repo_name to propagate to all repos

Summary by CodeRabbit

  • New Features

    • Added a manual workflow to sync shared files across repositories, with an option to target one repository or all repositories.
    • Added shared community and project documents, including contribution guidance, code of conduct, and license information.
    • Updated issue templates to reduce blank issues and point people to the right places for help and feedback.
  • Bug Fixes

    • Improved file syncing when updating a repository’s root contents, making shared file distribution safer and more reliable.

- 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)
@mogul
mogul requested a review from OmikronApex July 8, 2026 07:01
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 584db383-c244-405e-8243-81c55184e3bf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds a manually-triggered GitHub Actions workflow (distribute-shared.yml) that propagates a new shared/ directory of org-wide files (issue template config, Code of Conduct, Contributing guide, License) into target repositories via scripts/propagate-files.sh, which is updated to safely handle root-destination copies. A planning document describes the design.

Changes

Shared Files Distribution

Layer / File(s) Summary
Propagation script fix
scripts/propagate-files.sh
Adds special-case handling for --destination . to copy items individually rather than removing/overwriting the destination root.
Distribution workflow
.github/workflows/distribute-shared.yml
New workflow_dispatch workflow with optional repo_name input that checks out .github and runs the propagation script against a single repo or all org repos, using PROPAGATION_TOKEN.
Shared content files
shared/.github/ISSUE_TEMPLATE/config.yml, shared/CODE_OF_CONDUCT.md, shared/CONTRIBUTING.md, shared/LICENSE.md
Adds the issue template redirect config, Contributor Covenant Code of Conduct, contribution guide, and MIT license text to be distributed org-wide.
Distribution plan
PLAN-distribute-files.md
Documents scope, reconciliation with existing .github content, the script fix requirement, workflow design, execution order, and open notes.

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"
Loading

Related Issues: None found

Related PRs: None found

Suggested labels: documentation, ci

Suggested reviewers: None found

🐰 A carrot-shaped workflow, dispatched by hand,
Shares its files across the land,
Code of Conduct, License, and Contributing too,
Copied to every repo, old and new.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: distributing shared files across organization repos.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/distribute-shared

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: 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 win

Preserve 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 win

Page through the org repo list before --all dispatches gh repo list "$ORG" --limit 500 returns 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

📥 Commits

Reviewing files that changed from the base of the PR and between c46bb78 and f293274.

📒 Files selected for processing (7)
  • .github/workflows/distribute-shared.yml
  • PLAN-distribute-files.md
  • scripts/propagate-files.sh
  • shared/.github/ISSUE_TEMPLATE/config.yml
  • shared/CODE_OF_CONDUCT.md
  • shared/CONTRIBUTING.md
  • shared/LICENSE.md

Comment thread .github/workflows/distribute-shared.yml
Comment thread PLAN-distribute-files.md Outdated
Comment thread shared/CONTRIBUTING.md
@mogul
mogul marked this pull request as draft July 8, 2026 07:10
@mogul

mogul commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author
  • feedBack uses AGPL-3.0, not MIT. Propagating shared/LICENSE.md to feedBack would overwrite its LICENSE file. Options: remove LICENSE from shared/, scope it to plugin repos only, or treat it as a deliberate override.

Seeing this I'm thinking we should instead have two shared directories:

  • shared/all-repos for files truly expected to be in all repos (eg GitHub Actions workflows, code of conduct)
  • shared/noncore-repos for files that shouldn't override feedBack and feedBack-desktop specifics; basically, stuff that applies to all plugins.

What do you think @OmikronApex ?

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 2 file(s) based on 3 unresolved review comments.

Files modified:

  • PLAN-distribute-files.md
  • shared/CONTRIBUTING.md

Commit: fe947b38488dc57502b5895bc65cb68d684c6179

The changes have been pushed to the feat/distribute-shared branch.

Time taken: 1m 21s


⚠️ 1 file(s) could not be committed — the agent does not have permission to push to .github/workflows/. Please apply these changes manually:

.github/workflows/distribute-shared.yml — 1 change:

Lines 15–20
     steps:
       - name: Checkout .github
         uses: actions/checkout@v7
+        with:
+          persist-credentials: false
 
       - name: Propagate shared/ to all org repos
         env:

coderabbitai Bot and others added 2 commits July 8, 2026 07:20
Fixed 2 file(s) based on 3 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@mogul
mogul force-pushed the feat/distribute-shared branch from 0d4c5bc to 2a1ce90 Compare July 8, 2026 07:26
Comment thread shared/CONTRIBUTING.md
## Getting started

1. Find the right repo — most issues belong in `got-feedback/feedback`.
Plugin-specific issues go in the plugin's repo.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We should remove this; we want to direct all issues to got-feedback/feedback.

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.

1 participant