feat(render): add --allow-dirty flag for uncommitted lock state#181
Open
dmcilvaney wants to merge 5 commits into
Open
feat(render): add --allow-dirty flag for uncommitted lock state#181dmcilvaney wants to merge 5 commits into
dmcilvaney wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an --allow-dirty (-d) flag to component build, render, and prepare-sources to control whether uncommitted lock-file state (and fingerprint mismatches vs HEAD) can be used during synthetic history generation.
Changes:
- Add
--allow-dirtyto build/render/prepare-sources and plumb it into synthetic history creation. - Extend synthetic history generation to (optionally) fall back to on-disk lock state when no committed lock exists at HEAD, and to return caller-facing “hints”.
- Scenario harness updates to support running pre-script lines and committing locks during scenario build tests; regenerate CLI docs.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| scenario/internal/projecttest/projecttest.go | Adds WithPreScript support to run raw shell lines before the main scenario command. |
| scenario/component_build_test.go | Commits generated locks before building so synthetic history can read committed lock state. |
| internal/app/azldev/core/sources/synthistory.go | Implements allowDirty/hint plumbing, missing-HEAD-lock handling, and dirty-state handling for synthetic history. |
| internal/app/azldev/core/sources/synthistory_internal_test.go | Adds unit tests for the new synthetic-history helper behaviors. |
| internal/app/azldev/core/sources/sourceprep.go | Adds Hints() to SourcePreparer and threads hint collection into synthetic history preparation. |
| internal/app/azldev/cmds/component/render.go | Adds --allow-dirty flag, passes it into preparation, and attempts to surface preparer hints. |
| internal/app/azldev/cmds/component/preparesources.go | Adds --allow-dirty flag and gates dirty detection accordingly. |
| internal/app/azldev/cmds/component/build.go | Adds --allow-dirty flag and gates dirty detection accordingly. |
| docs/user/reference/cli/azldev_component_render.md | Regenerated CLI docs reflecting --allow-dirty. |
| docs/user/reference/cli/azldev_component_prepare-sources.md | Regenerated CLI docs reflecting --allow-dirty. |
| docs/user/reference/cli/azldev_component_build.md | Regenerated CLI docs reflecting --allow-dirty. |
Comments suppressed due to low confidence (1)
internal/app/azldev/core/sources/synthistory.go:711
- This hint also says "to render" even though the synthetic-history code is used by multiple commands. Please make the hint command-agnostic (or mention all relevant commands) so users running build/prepare-sources aren't confused.
*hints = append(*hints,
"use '--allow-dirty' ('-d') to render with uncommitted lock files")
dc9d162 to
49c12ae
Compare
924394d to
169bb59
Compare
169bb59 to
ad4fc7b
Compare
Add --allow-dirty to build, render, and prepare-sources commands to control how uncommitted lock file changes are handled during synthetic history generation. When --allow-dirty is set, uncommitted lock data is used as a fallback when no committed lock exists at HEAD, and fingerprint mismatches produce dirty synthetic entries. When unset, uncommitted state produces errors with hints suggesting --allow-dirty. - Add allowDirty + hints plumbing through buildSyntheticCommits - Extract handleMissingHeadLock and handleDirtyState helpers - Add Hints() to SourcePreparer interface for caller-facing suggestions - Always compute fingerprints (local I/O only, no network) - Add WithPreScript option to scenario ProjectTest - Scenario build test commits locks before building - Regenerate CLI docs
73ef837 to
54b8bf1
Compare
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.
Add --allow-dirty to build, render, and prepare-sources commands to
control how uncommitted lock file changes are handled during synthetic
history generation.
When --allow-dirty is set, uncommitted lock data is used as a fallback
when no committed lock exists at HEAD, and fingerprint mismatches
produce dirty synthetic entries. When unset, uncommitted state produces
errors with hints suggesting --allow-dirty.