Generalize ccc-dev/ into multi-repo fork management tool#20
Conversation
Summary of ChangesHello @phroi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the project's ability to manage external repository forks by generalizing the previously hardcoded CCC-specific logic. It introduces a flexible, multi-repository fork management system, allowing for easier integration and development with various external projects. The changes streamline the development workflow by providing a unified set of tools and configurations for handling cloned repositories, their dependencies, and local modifications. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully generalizes the fork management system from a single-repo setup (ccc-dev/) to a more flexible multi-repo one (fork-scripts/ and *-fork/). The changes are extensive, touching configuration files, build scripts, and documentation. The new shell scripts in fork-scripts/ are well-structured and robust, especially the deterministic replay and conflict resolution mechanisms. However, I've identified a few areas for improvement: a potential for silent failures in the Vite configuration, inconsistencies in the README.md documentation regarding the new script commands, and a discrepancy between the stated goal of dynamic workspace inclusion and the hardcoded implementation in pnpm-workspace.yaml.
b6c9a7c to
5cf39e1
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is an excellent and significant refactoring that successfully generalizes the CCC-specific fork management into a generic, multi-repo tool. The new fork-scripts/ and *-fork/ structure is well-designed. The shell scripts are robust, with great attention to detail for ensuring deterministic builds, especially in the record.sh and replay.sh scripts. The dynamic discovery of forks in .pnpmfile.cjs and the centralized logic in tsgo-filter.sh are major improvements that simplify package configurations. My main feedback is a suggestion to further improve maintainability by automating the updates to pnpm-workspace.yaml.
Introduce fork-scripts/ with shared tooling for managing external repo forks via a deterministic record/replay mechanism: - lib.sh: shared functions (config parsing, safety checks, git helpers) - record.sh / replay.sh: capture and reproduce merge + resolution state - save.sh: persist local work as patches in pins/ - status.sh / status-all.sh: check fork clone state against pins - clean.sh / clean-all.sh: remove fork clones safely - reset.sh: wipe and rebuild a fork clone from pins - push.sh: cherry-pick local commits onto a PR branch - patch.sh: rewrite fork package exports to .ts source - tsgo-filter.sh: suppress fork diagnostics from tsgo output
Set up ccc-fork/ as the first consumer of the fork-scripts/ framework:
- config.json: upstream/fork URLs, merge refs (PR #316, #328), clone dir
- pins/manifest: base SHA + merge refs for deterministic replay
- pins/HEAD: expected final SHA after full replay
- pins/res-{2,4}.resolution: counted conflict resolutions for merge steps
- .gitignore: exclude the ccc/ clone directory
- README.md: usage documentation for the CCC fork workflow
Update .pnpmfile.cjs to scan all *-fork/config.json directories and silently rewrite matching dependencies to workspace:* when clones exist. Update pnpm-workspace.yaml with fork workspace entries derived from ccc-fork/config.json (cloneDir + workspace include/exclude).
- Root package.json: add fork:* scripts that accept any fork directory - Per-package build scripts: use fork-scripts/tsgo-filter.sh - apps/interface/vite.config.ts: update fork path references - Regenerate pnpm-lock.yaml
- AGENTS.md: document fork-scripts/ workflow and per-fork structure - README.md: update developer script examples for fork:* format - Delete ccc-dev/: replaced by fork-scripts/ + ccc-fork/
5cf39e1 to
8b6d680
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request successfully generalizes the ccc-dev/ directory into a multi-repo fork management tool. The new fork-scripts/ and *-fork/ structure is well-designed and allows managing multiple external repositories with the same deterministic record/replay mechanism. The changes are extensive, touching configuration, scripts, and documentation, and they are all consistent with the goal of generalization. The new shell scripts are robust, with features like tiered AI-assisted conflict resolution, deterministic builds, and dynamic workspace configuration. I have one suggestion to improve maintainability by reducing code duplication.
|
LGTM Phroi %393 |
Why
The
ccc-dev/directory hardcoded CCC-specific logic into the fork management scripts, making it impossible to fork additional external repos without duplicating the entire setup. This extracts generic fork management intofork-scripts/so any external repo can be forked using the same deterministic record/replay mechanism.Changes
fork-scripts/: generic framework with sharedlib.sh, record/replay/save/status/clean/reset/push/patch/tsgo-filter scriptsccc-fork/: CCC-specificconfig.jsonand pins (manifest + counted conflict resolutions).pnpmfile.cjs: auto-detects*-fork/config.jsonfor workspace dependency rewiringpnpm-workspace.yaml: dynamic fork workspace inclusionpackage.json:fork:*scripts accept any fork directory as argumentfork-scripts/tsgo-filter.shccc-dev/directory