Conversation
There was a problem hiding this comment.
1 issue found across 10 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/config/config.go">
<violation number="1" location="internal/config/config.go:279">
P2: Nearest-config discovery should ignore directories named `fence.json`; otherwise CLI config resolution can fail on `os.ReadFile` with "is a directory".</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Collaborator
|
I would have expected the local config to be named .fence.json - to not clutter up the default dev folder as much in every ls. Did you have a specific reason to make it visible by default? Later on I would love to support configuration in something like pyproject.toml for eve less clutter, but that's far in the future |
Contributor
Author
|
I'm leaning towards it being
Project directory cleanliness is also valid but might be secondary here. What do you think? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add first-class per-project config support by auto-discovering the nearest
fence.jsonwhen--settingsis not provided, and add a reserved@baseextends target so repo configs can layer on top of each developer's normal Fence config. This also moves extends resolution intointernal/configand hardens cycle detection with canonical IDs for templates, files, and@base.Resolves #42.
Changes
internal/config/resolve.goso config inheritance lives with config loading instead of insideinternal/templates@baseas a reserved extends target that resolves through Fence's default user config path and falls back to built-in defaults when no home config exists, add testsfence.jsonbefore falling back to the default home config path when--settingsis omitted@base, including symlink-aware file identityDeveloper Experience
Per-user config:
Recall that the
codetemplate allowsapi.openai.com.Per-project config:
CLI usage with no explicit
--settings:This works because Fence now discovers
./fence.json, resolves@baseagainst the user's normal config, and applies the project override automatically.Future PRs
fence config init --currentto scaffold a fence config in the current directory (extending@baseif exists), whilefence config initstill does it for the home directory.