-
Notifications
You must be signed in to change notification settings - Fork 0
feat(fctx-migration): implement context migration and linking #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements the Context Migration & Linking feature, enabling users to save contexts to custom locations, create symlinks to artifacts, and move contexts while automatically updating references. The implementation adds a global configuration registry (~/.first/first.conf) to track context locations outside standard project directories.
Key changes include:
- Global Configuration:
GlobalConfigmanages a central registry of context locations - Custom Save Location:
save --to <path>allows saving contexts anywhere on the filesystem - Linking Support:
save --linkandupdate --linkreplace source files with symlinks to artifacts - Context Migration:
mvcommand moves contexts and updates all workspace symlinks
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/scala/first/config/GlobalConfig.scala | Implements central registry for tracking context locations |
| src/main/scala/first/config/ConfigWriter.scala | Provides HOCON writing utilities for configuration files |
| src/main/scala/first/config/ConfigReader.scala | Enhanced to discover contexts from GlobalConfig registry |
| src/main/scala/first/core/SymlinkManager.scala | Handles safe symlink creation with OS-specific warnings |
| src/main/scala/first/core/Mv.scala | Implements context moving with symlink updating logic |
| src/main/scala/first/core/Save.scala | Extended to support custom paths and linking mode |
| src/main/scala/first/core/Update.scala | Extended to support linking mode for added artifacts |
| src/main/scala/first/cli/MvCommand.scala | CLI interface for mv command |
| src/main/scala/first/cli/SaveCommand.scala | Extended with --to and --link options |
| src/main/scala/first/cli/UpdateCommand.scala | Extended with --link option |
| test_output.txt | Test execution results (should not be in version control) |
| specs/009-fctx-migration/* | Complete feature specification and documentation |
Comments suppressed due to low confidence (1)
src/test/scala/first/core/UpdateTests.scala:1
- The test 'Update works for custom location context' is failing. The test expects the artifact to be created at customDir / 'artifacts' / 'custom.txt', but the assertion fails. This indicates the Update command may not be properly resolving custom context locations from GlobalConfig. Review the Update.run implementation to ensure it correctly handles contexts registered in GlobalConfig.
package first.core
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Implement `GlobalConfig` to track context locations (`~/.first/first.conf`). - Add `save --to <path>` to save contexts to custom locations. - Add `save --link` and `update --link` to replace source files with symlinks. - Add `mv` command to move contexts and update symlinks. - Implement `SymlinkManager` for safe symlink operations. - Update `walkthrough.md` with new features.
6c837b0 to
09a6d84
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 38 out of 38 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dedf38a to
9246532
Compare
This PR implements the Context Migration & Linking feature (
009-fctx-migration).Summary
GlobalConfigto track context locations in~/.first/first.conf.save --to <path>to save contexts to any location.save --linkandupdate --linkto replace source files with symlinks to the artifacts.mvcommand to move contexts and automatically update symlinks.Verification
specs/009-fctx-migration/verify_manual.shpasses.