feat: add config init scaffolding and shared config file writer#35
Merged
feat: add config init scaffolding and shared config file writer#35
Conversation
There was a problem hiding this comment.
2 issues found across 7 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="internal/config/config_file.go">
<violation number="1" location="internal/config/config_file.go:30">
P2: Filesystem config serialization drops AllowRead/AllowExecute/DefaultDenyRead/WSLInterop, so writing a config will silently lose these settings. Include these fields in the clean filesystem struct and update the empty-check logic to preserve them.</violation>
<violation number="2" location="internal/config/config_file.go:45">
P2: SSH configuration is never serialized, so any SSH rules in a config are silently lost when writing the file. Add a clean SSH struct and include cfg.SSH in MarshalConfigJSON/empty checks.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
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 a first-class
fence config initflow to bootstrap usable config files and refactor config JSON/file rendering intointernal/configso both init and import share the same writer primitives while preserving import-specific output behavior.Resolves #34.
Changes
fence config initwith support for--template,--minimal,--output,--force, and--print.--scaffoldmode to generate properly indented JSON with empty hint arrays for editable sections.config init.internal/config/config_file.govia shared APIs (MarshalConfigJSON,FormatConfigForFile,WriteConfigFile).fence importbehavior stable by retaining importer wrappers and import-specific header comments while delegating rendering/writing tointernal/config.cmd/fence/main_test.goand newinternal/config/config_file_test.go; update docs inREADME.mdanddocs/quickstart.md.