refactor(apply): move document model to internal/asset - #255
Open
mmanciop wants to merge 1 commit into
Open
Conversation
Extract assetDocument and its reading/parsing helpers (readMultiDocumentYAML, parseMultiDocumentYAML, readDirectory, discoverFiles, parseDocumentHeader, formatNameAndId, pluralize) out of internal/apply into internal/asset as exported Document/ReadMultiDocumentYAML/etc. apply is the only current caller, but the upcoming diff command needs the same document discovery and parsing without apply's write-path baggage, and project convention already places logic shared across apply and per-asset commands in internal/asset.
9 tasks
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
assetDocumentand its reading/parsing helpers (readMultiDocumentYAML,parseMultiDocumentYAML,readDirectory,discoverFiles,parseDocumentHeader,formatNameAndId,pluralize) out ofinternal/applyintointernal/assetas exportedDocument/ReadMultiDocumentYAML/etc.applyis updated to use the new exported types/functions, and the corresponding tests moved tointernal/asset/document_test.go.dash0 diffcommand (stacked on top of this branch), which needs the same document discovery/parsing but must not depend onapply's write-path logic.Why this is stacked
This PR targets
feat/sync-action(notmain), since it builds on theapply --since/--forcework in #253. Thediffcommand PR will stack on top of this one.Test plan
go build ./...go vet ./...go test ./...go test -tags=integration ./...make lint