Skip to content

chore: consolidate sync directories and triage PRs#785

Open
google-labs-jules[bot] wants to merge 3 commits into
mainfrom
chore/consolidate-sync-and-triage-2216084948325125496
Open

chore: consolidate sync directories and triage PRs#785
google-labs-jules[bot] wants to merge 3 commits into
mainfrom
chore/consolidate-sync-and-triage-2216084948325125496

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

@google-labs-jules google-labs-jules Bot commented Jan 17, 2026

Consolidated the sync architecture by merging repository-files and global-sync into sync-files. This simplifies the repository structure and removes redundancy. Also merged outstanding Dependabot PRs and aligned go.mod version. Verified with make test and scripts/check-workflow-consistency.


PR created automatically by Jules for task 2216084948325125496 started by @jbdevprimary

Summary by CodeRabbit

  • Refactor

    • Consolidated sync sources into a single sync-files structure to simplify repository-wide syncing.
  • Documentation

    • Updated docs and guides to reference the new sync-files layout; many legacy guidance files were removed or reorganized.
  • Chores

    • Removed and consolidated legacy sync/config workflows and templates, and updated CI/workflow triggers and tooling references to the new layout.

✏️ Tip: You can customize this high-level summary in your review settings.

@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 17, 2026

📝 Walkthrough

Walkthrough

This pull request consolidates the repository's file synchronization architecture by merging repository-files/ and global-sync/ directories into a unified sync-files/ structure. It removes legacy configuration files, workflow definitions, and documentation while updating scripts, workflows, and code (notably the GitHub client usage in cmd/sync.go) to reflect the new layout.

Changes

Cohort / File(s) Summary
Directory & doc path updates
\.cursor/rules/00-loader.mdc`, `.github/copilot-instructions.md`, `AGENTS.md`, `CLAUDE.md`, `docs/*``
Replaced references from repository-files//global-sync/sync-files/ and reorganized examples to always-sync/global/ and initial-only/. Textual updates only.
Deleted legacy sync configs
\.github/sync-always.yml`, `.github/sync-initial.yml`, `docs/SYNC-REFACTORING-TODO.md``
Removed old multi-file sync configuration and related refactor roadmap documentation.
Removed large sets of workflows & actions
\global-sync/.github/workflows/`, `global-sync/.github/actions/`, `repository-files/org-control-center/.github/workflows/sync.yml`, `.github/workflows/*` (some files)
Deleted numerous automation workflows and composite actions (triage, review, autoheal, delegator, agentic actions), and removed the cross-repo sync workflow.
Deleted agent docs & metaprompts
\global-sync/.github/agents/`, `global-sync/.github/metaprompts/`, `global-sync/.github/prompts/`, `repository-files/initial-only/.github/agents/``
Removed AI agent instructions, metaprompts, and prompt templates across global and initial-only locations.
Removed language-specific guidance & templates
\repository-files/{python,nodejs,go,rust,terraform}/.cursor/rules/*`, `repository-files/{python,nodejs,go,rust}/.github/copilot-instructions.md``
Deleted per-language Cursor rules, copilot instructions, and many ecosystem docs and templates.
Removed documentation scaffolds & themes
\repository-files//docs/`, `repository-files//docs/_static/`, `repository-files/go/docs/site/`, `repository-files//docs/conf.py``
Deleted Sphinx/TypeDoc/doc2go/rustdoc/Hugo site files, CSS themes, and site templates.
Removed repo templates & config
\repository-files/always-sync/{CONTRIBUTING.md,commitlint.config.js,.pre-commit-config.yaml,.github/{CODEOWNERS,PULL_REQUEST_TEMPLATE.md,dependabot.yml,settings.yml}}`, `repository-files/initial-only/.github/*``
Removed shared PR templates, CODEOWNERS, commitlint, pre-commit config, Dependabot, and repo-wide settings.
Script and workflow trigger updates
\fix_shas.py`, `scripts/check-workflow-consistency`, `scripts/sync-files`, `.github/workflows/jbcom-gardener.yml``
Updated scripts and workflow triggers to point at sync-files/always-sync/global/ and sync-files/** instead of repository-files/**.
New/relocated workflows
\sync-files/always-sync/global/.github/workflows/autoheal.yml`, `sync-files/always-sync/global/.github/workflows/review.yml``
Added/modified workflows in consolidated location with Docker workspace mounts, improved output handling, and a new docker_image_tag input for review workflow.
Go module & client changes
\go.mod`, `cmd/control-center/cmd/sync.go``
Downgraded Go toolchain target (1.24→1.23 variants) and updated go-github client usage from v81 → v60; adjusted CreateRef/UpdateRef, CreateBlob/CreateTree/CreateCommit signatures and tree/entry types to match v60 shapes.
Memory bank / session note
\memory-bank/activeContext.md``
Added session entry documenting consolidation completion and next-step verification instructions.

Sequence Diagram(s)

sequenceDiagram
  participant CC as Control Center (cmd/sync.go)
  participant GH as GitHub API (go-github v60)
  participant Repo as Repository (git refs/trees/commits)
  rect rgba(200,230,255,0.5)
  CC->>GH: CreateBlob(*github.Blob) → blob.SHA
  GH-->>CC: blob.SHA
  CC->>GH: CreateTree([]github.TreeEntry) referencing blob.SHA
  GH-->>CC: tree.SHA
  CC->>GH: CreateCommit(*github.Commit) with tree SHA and Parents
  GH-->>CC: commit.SHA
  CC->>GH: UpdateRef(ref *github.Reference, force bool)
  GH-->>Repo: ref updated → new commit.SHA
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through docs and workflows wide,

Gathered files to one safe side.
repository-files now says goodbye,
sync-files sings beneath the sky —
A tidy burrow, neat and spry. 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description briefly covers the main consolidation work and mentions verification steps, but lacks comprehensive coverage of the detailed changes across numerous files and the required template sections like Type of Change, Testing, and Checklist. Add the Type of Change section, Testing results (with coverage and test command outputs), and Checklist items to align with the template and provide reviewers with complete verification details.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: consolidating sync directories and triaging PRs, which aligns with the core objectives of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

🤖 AI Code Review

Summary

Consolidates repository-files/ and global-sync/ directories into a single sync-files/ directory, updating all references accordingly.

Issues Found

🟡 medium: undefined

  • 💡 Update any remaining documentation that references 'repository-files/' to use 'sync-files/' instead
    🟢 low: undefined
  • 💡 Consider using git mv with --sparse to move entire directory trees in a single operation

Reviewed by Control Center using glm-4.6:cloud

- Merged dependabot PRs #782 and #783.
- Consolidated `repository-files/` and `global-sync/` into `sync-files/` to eliminate redundancy (DRY).
- Deleted obsolete `repository-files/` and `global-sync/` directories.
- Migrated `org-github-repo/settings.yml` to `sync-files/initial-only/org-github-repo/settings.yml`.
- Updated `scripts/sync-files`, `scripts/check-workflow-consistency`, `fix_shas.py`, and `AGENTS.md` to reference `sync-files/`.
- Updated `docs/WORKFLOW-SYNC.md`, `docs/SYNC-ARCHITECTURE.md`, `CLAUDE.md` to reflect the new structure.
- Deleted obsolete config files `.github/sync-always.yml` and `.github/sync-initial.yml`.
- Set `go.mod` to 1.23.4 to match linter and project standards.
- Synced `autoheal.yml` and `review.yml` from `.github/workflows` to `sync-files`.
@jbdevprimary jbdevprimary force-pushed the chore/consolidate-sync-and-triage-2216084948325125496 branch from c30b8d5 to c15782b Compare January 17, 2026 05:22
@jbdevprimary jbdevprimary marked this pull request as ready for review January 17, 2026 05:22
@github-actions
Copy link
Copy Markdown
Contributor

🤖 AI Code Review

Summary

Review completed


Reviewed by Control Center using glm-4.6:cloud

@jbdevprimary
Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 17, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@jbdevprimary
Copy link
Copy Markdown
Collaborator

@jules fix ALL the golang issues ALSO since workflows are currently failing

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@go.mod`:
- Line 3: Run `go mod tidy` with the intended Go toolchain to reconcile module
drift and commit the updated go.mod and go.sum; then replace the current
explicit patch-level directive "go 1.23.4" in go.mod with the idiomatic
minor-version directive "go 1.23" (or add a separate `toolchain go1.23.4`
directive if you must pin a patch) so the go directive follows recommended
conventions and CI stops reporting "updates to go.mod needed".
🧹 Nitpick comments (1)
sync-files/always-sync/global/.github/workflows/review.yml (1)

71-75: JSON extraction may be fragile for multi-line or prefixed output.

The grep -E '^[{[]' pattern only matches lines that start with { or [. If the JSON output is:

  • Indented or prefixed by whitespace
  • Part of a multi-line JSON object (only the first line would match)
  • Preceded by logging on the same line

...the extraction will fail silently, resulting in the placeholder JSON being used.

Consider using a more robust extraction approach:

♻️ Suggested improvement
-          # Extract only the JSON (lines starting with { or [, and until the matching closing brace/bracket)
-          # This filters out log lines like: time="..." level=info msg="..."
-          grep -E '^[{[]' review-output.txt > review-result.json || echo '{"summary":"No review output","issues":[]}' > review-result.json
+          # Extract JSON from output, handling potential log prefixes
+          # Look for JSON object/array patterns anywhere in the output
+          if grep -oE '\{[^}]*"summary"[^}]*\}|\{.*\}$' review-output.txt | head -1 > review-result.json && [ -s review-result.json ]; then
+            echo "Extracted JSON review result"
+          else
+            echo '{"summary":"No review output","issues":[]}' > review-result.json
+            echo "Warning: Could not extract JSON from review output"
+          fi

Alternatively, if the reviewer tool can be configured to output only JSON (without log lines), that would be the cleanest solution.

Comment thread go.mod Outdated
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

@jules fix ALL the golang issues ALSO since workflows are currently failing

I've fixed the Go version mismatch issues. The project dependencies (go-github v81, oauth2 v0.34) required Go 1.24, which conflicted with the linter environment (Go 1.23). I've downgraded go-github to v60 and oauth2 to v0.28.0 and updated the code to match the v60 API. make lint and make test are now passing locally.

- Downgraded `github.com/google/go-github` from v81 to v60 to support Go 1.23.
- Downgraded `golang.org/x/oauth2` from v0.34 to v0.28 to support Go 1.23.
- Refactored `cmd/control-center/cmd/sync.go` to use `go-github` v60 API:
  - Replaced `github.CreateRef` and `github.UpdateRef` structs (v81) with `github.Reference` (v60).
  - Updated `CreateCommit` usage to include `nil` options.
  - Replaced `github.Ptr` helpers with `github.String`, `github.Bool`.
  - Fixed `Blob` creation usage.
- Ensured `go.mod` is set to `go 1.23.4` to match linter environment.
- Verified with `make lint` and `make test`.
@github-actions
Copy link
Copy Markdown
Contributor

🤖 AI Code Review

Summary

Major refactor: Consolidated sync directories and updated sync architecture

Issues Found

🟠 high: undefined

  • 💡 Update go-github library imports to use v60 API signature (reference pointers instead of values)
    🟡 medium: undefined
  • 💡 Ensure all Go code is compatible with 1.23.4 or update to compatible version
    🟠 high: undefined
  • 💡 Fix review-output.txt parsing in review.yml - current grep pattern may miss valid JSON

Reviewed by Control Center using glm-4.6:cloud

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

🤖 AI Code Review

Summary

Review completed


Reviewed by Control Center using glm-4.6:cloud

@jbdevprimary
Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 17, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@jbdevprimary
Copy link
Copy Markdown
Collaborator

@jules In @go.mod:

  • Line 3: Run go mod tidy with the intended Go toolchain to reconcile module
    drift and commit the updated go.mod and go.sum; then replace the current
    explicit patch-level directive "go 1.23.4" in go.mod with the idiomatic
    minor-version directive "go 1.23" (or add a separate toolchain go1.23.4
    directive if you must pin a patch) so the go directive follows recommended
    conventions and CI stops reporting "updates to go.mod needed".

@jbdevprimary
Copy link
Copy Markdown
Collaborator

@jules when you receive feedback from ANY agent regardless of the mention treat it the same as feedback from me

@jbdevprimary
Copy link
Copy Markdown
Collaborator

@jules Workflows are STILL red and failing

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
cmd/control-center/cmd/sync.go (2)

266-266: Fix TreeEntry slice type to value slice in processKillList.

At line 266, treeEntries should be declared as []github.TreeEntry (value slice) instead of []*github.TreeEntry (pointer slice) to match the signature expected by go-github v60's CreateTree method, which accepts []TreeEntry. Line 415 in syncFiles correctly uses the value slice type. Additionally, the append operation at lines 278-284 should be adjusted to append values directly instead of pointers.


472-480: Use org:branchName format for Head filter to match GitHub API requirements.

The Head field in PullRequestListOptions requires the format owner:branch (e.g., org:branchName), not just the branch name alone. Change line 473 from Head: branchName, to Head: fmt.Sprintf("%s:%s", org, branchName), to correctly filter PRs.

🤖 Fix all issues with AI agents
In @.github/workflows/ci.yml:
- Around line 21-24: The workflow's Go version (actions/setup-go with
go-version: '1.24') is inconsistent with go.mod's declared "go 1.23"; either
update all go-version entries in .github/workflows/ci.yml (the actions/setup-go
blocks) to '1.23' to match go.mod, or intentionally bump the module file by
changing the module directive in go.mod from "go 1.23" to "go 1.24" so both
go-version and go.mod align; make the same change for each occurrence of
go-version in the workflow and confirm the choice is intentional.

In `@go.mod`:
- Around line 3-6: Remove the duplicate toolchain directive in go.mod: keep the
toolchain line that matches the PR objective (toolchain go1.23.4) and delete the
other toolchain go1.24.3 entry so only a single toolchain directive remains;
then run `go mod tidy` to update go.mod and go.sum so the module files are
consistent.
🧹 Nitpick comments (2)
go.mod (1)

18-18: Direct dependency in indirect require block.

github.com/google/go-github/v60 is missing the // indirect comment, indicating it's a direct dependency, but it's placed in the indirect require block. Move it to the direct require block for clarity, or run go mod tidy to auto-organize.

♻️ Suggested reorganization
 require (
 	github.com/sirupsen/logrus v1.9.3
 	github.com/spf13/cobra v1.10.2
 	github.com/spf13/viper v1.21.0
 	golang.org/x/oauth2 v0.28.0
+	github.com/google/go-github/v60 v60.0.0
 )

 require (
 	github.com/fsnotify/fsnotify v1.9.0 // indirect
 	github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
-	github.com/google/go-github/v60 v60.0.0
 	github.com/google/go-querystring v1.1.0 // indirect
cmd/control-center/cmd/sync.go (1)

730-734: Off-by-one potential in path calculation.

The check len(itemPath) < len(rootDir)+2 and slice itemPath[len(rootDir)+1:] assumes a path separator exists. If rootDir doesn't end with a separator and itemPath structure varies, this could produce incorrect relative paths or panic. Consider using strings.TrimPrefix or filepath.Rel for safer path manipulation.

♻️ Safer path calculation
-			if len(itemPath) < len(rootDir)+2 {
-				log.WithField("path", itemPath).Warn("Invalid path length")
-				continue
-			}
-			relativePath := itemPath[len(rootDir)+1:]
+			relativePath := strings.TrimPrefix(itemPath, rootDir+"/")
+			if relativePath == itemPath {
+				log.WithField("path", itemPath).Warn("Path does not start with root directory")
+				continue
+			}

Comment thread .github/workflows/ci.yml
Comment on lines +21 to 24
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.0.0
with:
go-version: '1.24'
cache: true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check go.mod for declared Go version
echo "=== go.mod Go version ==="
grep -E "^go " go.mod

# Check ci.yml at the specified lines for go-version
echo ""
echo "=== ci.yml go-version at lines 21-24 ==="
sed -n '21,24p' .github/workflows/ci.yml

echo ""
echo "=== ci.yml go-version at lines 39-42 ==="
sed -n '39,42p' .github/workflows/ci.yml

echo ""
echo "=== ci.yml go-version at lines 60-63 ==="
sed -n '60,63p' .github/workflows/ci.yml

Repository: jbcom/control-center

Length of output: 661


Go version mismatch between workflow and go.mod.

The workflow specifies go-version: '1.24' at lines 21–24, 39–42, and 60–63, but go.mod declares go 1.23. This causes CI to test against a different Go version than the project's declared minimum, risking hidden compatibility issues or build failures in local development. Update either the workflow to use 1.23 or bump go.mod to 1.24, and ensure the choice is intentional.

🤖 Prompt for AI Agents
In @.github/workflows/ci.yml around lines 21 - 24, The workflow's Go version
(actions/setup-go with go-version: '1.24') is inconsistent with go.mod's
declared "go 1.23"; either update all go-version entries in
.github/workflows/ci.yml (the actions/setup-go blocks) to '1.23' to match
go.mod, or intentionally bump the module file by changing the module directive
in go.mod from "go 1.23" to "go 1.24" so both go-version and go.mod align; make
the same change for each occurrence of go-version in the workflow and confirm
the choice is intentional.

Comment thread go.mod
Comment on lines +3 to +6
go 1.23
toolchain go1.23.4

toolchain go1.24.11
toolchain go1.24.3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix duplicate toolchain directive causing CI failure.

The go.mod file has two toolchain directives (lines 4 and 6), which is invalid. The pipeline error confirms: "go.mod:6: repeated toolchain statement". Only one toolchain directive is allowed.

Based on the PR objectives (downgrade to Go 1.23), remove the go1.24.3 toolchain line and keep only go1.23.4:

🐛 Proposed fix
 go 1.23
 toolchain go1.23.4
-
-toolchain go1.24.3

After fixing, run go mod tidy to ensure go.mod and go.sum are consistent.

📝 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.

Suggested change
go 1.23
toolchain go1.23.4
toolchain go1.24.11
toolchain go1.24.3
go 1.23
toolchain go1.23.4
🧰 Tools
🪛 GitHub Actions: Go CI

[error] 6-6: Command: go build -v -o bin/control-center ./cmd/control-center | Error: go: errors parsing go.mod: go.mod:6: repeated toolchain statement

🪛 GitHub Actions: PR `#785`

[error] 6-6: go.mod:6: repeated toolchain statement.

🤖 Prompt for AI Agents
In `@go.mod` around lines 3 - 6, Remove the duplicate toolchain directive in
go.mod: keep the toolchain line that matches the PR objective (toolchain
go1.23.4) and delete the other toolchain go1.24.3 entry so only a single
toolchain directive remains; then run `go mod tidy` to update go.mod and go.sum
so the module files are consistent.

@jbdevprimary
Copy link
Copy Markdown
Collaborator

@jules fix all the CI failures and workflow issues

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