You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds support for lockless rendering, in a controlled per-component transition.
During the transition, the tool will look for a file named lockless-components.txt in the same dir as the azldev.toml file (i.e., the top dir of the repo). If a component name is found inside this file, the component is considered a 'lockless' component; otherwise, the component is a legacy 'locked' component. Since our repo currently has an empty lockless-components.txt file, all our components are currently considered 'locked', and none of these updates to azldev should have any effect at all on any 'locked' component.
Until all components have been transitioned over, this adds a new command azldev comp make-lockless, which adds the specified component name(s) to the lockless-components.txt file, and runs azldev comp refresh-upstream-commit for them, to generate the component's default upstream-commit toml file. After that, the component's 'lock' file will no longer be used for anything (unless the component is removed from the lockless-components.txt file).
After transitioning all components to lockless, we should remove support for 'locked' files from azldev, and remove the azldev comp make-lockless command; and then we can remove the lockless-components.txt file from our main repo.
Most operations are the same for lockless components, but notably:
render operations should now work correctly, and should update the release value and generate the changelog entry correctly.
render operations are now slightly different, instead of backwards-searching the git commits to try to find text for a changelog entry, azldev will now prompt the user to provide a changelog entry or autorelease git commit message. This may be avoided by providing the message using the new --changelog-comment parameter.
render operations now will git commit the rendered files, unless the --no-git-commit parameter is used.
render operations now require no uncommitted changes in the repo (although uncommitted changes in the specs/ dir other than the rendering component's dist-git dir are ignored). this can be forced with --allow-uncommitted
renders no longer use mock for anything.
renders for autorelease components do not pre-rpmautospec the rendered dist-git dir.
there is a new command azldev comp dist-git-repo which converts the committed dist-git dir for a component into an industry-standard dist-git repo (at the path specified to --output-dir).
Besides those listed above, I have probably forgot some other changes.
Note this is still undergoing copilot testing, and there may be additional changes required; but this should not impact any components that still use 'lock' files, so we can slowly migrate components to lockless one-at-a-time and address any transition issues as we find them.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Skipped local components can still have generated TOML files deleted or flagged as stale, and shared single-branch cloning can break locked renders/builds using valid commits pinned on other branches.
This pull request requires changes. The following issues remain unresolved:
Critical — internal/app/azldev/cmds/component/refreshupstreamcommit.go:173: The orphan pass can delete generated TOML files for configured locked local components, or report them as stale under --check-only. Exempt configured locked components while preserving cleanup for genuinely removed components.
Moderate — internal/app/azldev/cmds/component/query_lockless.go:62: Querying all components serially clones and rewrites the full project history for each lockless component. Reuse shared repository objects or bulk extraction while retaining separate rpmautospec repositories.
Moderate — internal/app/azldev/cmds/component/render_release_carryover.go:39: An autorelease-to-static transition can restore the old %autorelease macro and skip the required static bump. Resolve the previous release to a concrete baseline instead.
Moderate — internal/utils/git/git.go:211: Shared single-branch cloning breaks locked workflows pinned to commits unavailable on the selected branch or through tags. Make this behavior opt-in or fetch the pinned commit before checkout.
Lockless builds pass the raw With, Without, and Defines values to mock without applying Build.Undefines. For example, an inherited defines.dist = ".azl3" with undefines = ["dist"] is correctly omitted from the rendered macros file, but this path reintroduces it through --define dist .azl3 in both SRPM and RPM builds. Filter the options using the same undefine semantics as buildMacrosMap before forwarding them, so transitioning a component does not change its effective build macros.
Fetch pinned commits missing from the single-branch clone
Lockless source preparation fails when an explicit upstream pin is reachable only from another branch and is not fetched through a tag. The single-branch clone omits that commit, and checkoutTargetCommit never fetches it before checkout. Keep a multi-branch clone when effectiveCommit is set, or explicitly fetch the pinned commit.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Critical findings omitted from the published review involve incorrect macro resolution and source retrieval and pinned-commit checkout failures, requiring human assessment.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Unpublished findings identify a critical regression in cross-branch commit pinning and failures on ignored unreadable directories, warranting human assessment.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed to evaluate unpublished findings concerning cross-branch pinned-commit checkout failures and lost error diagnostics when the mock probe fails.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because unpublished findings identify pinned-commit checkout failures and ignored macro undefines that can disrupt source preparation and builds.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because lockless builds forward raw options that can reinstate macros excluded by build.undefines, causing build settings to diverge from the rendered spec.
The emitted agent skills and instructions now describe both workflows
in one catalog:
- locked components use lock files and 'comp update';
- components listed in 'lockless-components.txt' use generated
upstream-commit TOMLs and 'comp refresh-upstream-commit'.
The default catalog adds the refresh-upstream-commit skill, and the
azldev, build-component, comp-toml, remove-component and
update-component content covers selecting lock modes, 'make-lockless',
lockless render, build and query, and 'dist-git-repo'.
'NewCatalog(true)' keeps the all-lockless variant for internal use. The
contributor instructions no longer refer to the removed global flag.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16503351-1bf3-4693-96f1-26283e4fc641
Could we also update withoutlockfile/overlays.md.tmpl and withoutlockfile/add-component.md.tmpl to match the new lockless workflow? I ran into this while transitioning curl and figuring out when to commit its upstream pin and overlays. The updated guide and refresh skill say to commit pin changes before rendering, since render reads the pin from HEAD, and not to amend the input commit to absorb the automatic render commit. But these templates still describe the old render -> commit -> re-render -> amend flow, so an agent following them could get conflicting guidance.
And I found these two cases need a slightly different user operation:
pin changes need a commit before render, so it results in 2 commits.
overlay-only iteration can use --allow-uncommitted during render, and it ends up with one single commit.
can you try this again? the required-commit parts have been removed so this might no longer apply
Rewrite the lock-file-free preview guide around
'lockless-components.txt'. It covers:
- selecting components per mode and converting them with
'comp make-lockless';
- refreshing upstream commits;
- rendering, including how the changelog message is chosen and how
Release is carried over;
- preparing, querying and building from committed dist-git.
The config reference and explanation pages now describe:
- per-component merge semantics;
- 'skip-file-filter' applying only to locked components;
- single-branch upstream clones;
- provenance capture before release bumping.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16503351-1bf3-4693-96f1-26283e4fc641
force-pushed a completely reworked line of commits; copilot redid all of them to try to logically separate things better. the actual code diff is limited to single doc correction. PTAL.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The render workflow differs from the PR description in its input options, commit behavior, and worktree checks, leaving migration users with an unclear contract.
Looking at go-git compatibility with actual git, there is a lot that doesn't work with go-git...are we sure we should actually be using it instead of just calling git directly for operations?
For the code added/changed in this PR, we should be good to use native git to read committed files and build the historical snapshots. We already call git for the history queries, so it'd be more consistent to use it for the file reads too. Also it would avoid the loose-*.pack issue that I had.
Also checked other existing go-git usage, especially the older synthetic-history code and in-memory tests, might be better to keep them for now. That should be a separate change and need more care to preserve the generated history, and some of these logics need to be cleaned up after switching to lockless.
The reason will be displayed to describe this comment to others. Learn more.
If a lockless render can’t infer changelog text, it leaves the old files in place and tells the caller to pass --commit-message. But that error doesn’t match either case here, so the command still exits 0 unless --fail-on-error is set. A CI job that checks only the exit code can then build stale output. Can we return a nonzero exit code for these changelog errors while keeping the existing behavior for locked components?
Lockless 'comp render', 'comp prepare-sources' and 'comp changed' read
committed project trees through go-git. Read them with the system's git
program instead, through a new git.Repo/git.Tree reader in internal/utils/git
built on 'rev-parse', 'ls-tree' and 'cat-file'. Missing paths and paths of the
wrong object type report git.ErrPathNotFound, matching go-git's not-found
errors, so lookups that tolerate absent files behave as before.
This covers the last-render lookup, the committed changelog and render
snapshot, commit-message detection, and the historical project snapshots and
rendered-tree comparisons of lockless 'comp changed'. Locked components keep
their existing go-git code paths unchanged.
Lockless tests now commit their fixtures to an on-disk repository read by the
real git program; locked tests keep the in-memory go-git fixture.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16503351-1bf3-4693-96f1-26283e4fc641
Looking at go-git compatibility with actual git, there is a lot that doesn't work with go-git...are we sure we should actually be using it instead of just calling git directly for operations?
For the code added/changed in this PR, we should be good to use native git to read committed files and build the historical snapshots. We already call git for the history queries, so it'd be more consistent to use it for the file reads too. Also it would avoid the loose-*.pack issue that I had.
Also checked other existing go-git usage, especially the older synthetic-history code and in-memory tests, might be better to keep them for now. That should be a separate change and need more care to preserve the generated history, and some of these logics need to be cleaned up after switching to lockless.
i had copilot add a commit to change all the 'lockless' operations over to use native git command directly, pushed as a new commit.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The PR description contradicts the implemented render workflow by promising unavailable flags, prompting, automatic commits, and clean-tree enforcement, which could mislead migration users.
When a lockless render cannot detect its changelog text, because no
project commit since the last render changed the component or uncommitted
changes alter it, the component keeps its existing output and the error
asks for '--commit-message'. These errors only failed the command with
'--fail-on-error', so a CI job checking the exit status could carry on
with stale output.
Report them regardless of '--fail-on-error', like the existing no-change
and NEVR validation refusals. Both errors are lockless-only, so locked
component renders keep their exit status.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16503351-1bf3-4693-96f1-26283e4fc641
For lockless components, 'comp diff-sources' only preserved 'Release'
formatting, so the source preparer stayed in locked mode and showed build
macros as a generated macros file loaded through 'Source9999' and
'%{load:...}'. Lockless rendering instead prepends inline '%define' lines,
so the displayed spec edits differed from the rendered output.
Select the lockless preparer mode with WithoutLockfileHistory(). It also
preserves 'Release' formatting, and generates no synthetic history because
diff-sources creates no dist-git. Remove the now-unused
WithPreservedReleaseFormatting() preparer option. Locked components keep
their existing options.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16503351-1bf3-4693-96f1-26283e4fc641
A lockless build fetches configured source files from the working TOML, but
only checked that each payload in the committed 'sources' manifest existed.
If a source hash changed in the TOML before the component was rendered and
committed again, the new payload was accepted and the SRPM paired new source
bytes with the old committed packaging.
Validate every payload against its hash in the committed 'sources' manifest
before building, including payloads supplied by the configured origins, and
ask for a render and commit on mismatch. Locked builds do not use this path.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16503351-1bf3-4693-96f1-26283e4fc641
The lockless add-component and overlays skills still described committing,
re-rendering, and amending the commit so %changelog and Release reflect it.
Rendering now reads working-tree inputs, never commits, and takes its
changelog text from project commits or --commit-message, so a single render
followed by a commit of the rendered output is enough.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16503351-1bf3-4693-96f1-26283e4fc641
A lockless build downloaded every missing 'sources' payload from lookaside
using the committed manifest hash. Archives modified by archive overlays are
recorded with their post-overlay hash, which lookaside does not serve, so the
build failed with a 404 (for example stb's repacked tarball).
Fetch the pinned upstream component into a temporary directory, apply the
archive overlays there, and copy the repacked archives into the build's
dist-git checkout before the remaining lookaside downloads. The result is
still checked against the committed manifest. Export ApplyArchiveOverlays
for this; locked builds keep using the source preparer unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16503351-1bf3-4693-96f1-26283e4fc641
Lockless rendering compared the raw Version tag text with the committed
spec. Specs such as alsa-lib ('Version: %{version_alsa_lib}') or pipewire
keep the same tag text when the macro definitions change, so a real version
change was missed and the previous rendered Release was carried over.
When either tag uses macros, expand both with host rpmspec in their own spec
context (the committed spec in a snapshot of its dist-git tree) and compare
the expanded values. Literal Versions are still compared directly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 16503351-1bf3-4693-96f1-26283e4fc641
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The PR description advertises prompts, flags, and automatic commits that the implemented command does not support, leaving users with inaccurate migration instructions.
The reason will be displayed to describe this comment to others. Learn more.
Thanks Dan! This PR looks good; a few docs need to be updated before approval (out of sync with the latest implementation):
The Check links job is failing because components.md:159 points to #render-and-commit-an-upstream-component. The heading is now “Render and Commit a Component,” so the fragment should be #render-and-commit-a-component.
Components reference: still mentions “automatic output commits,” but render no longer commits.
Refresh skill example: shows render-before-commit without --commit-message, which can fail for existing non-autorelease components with uncommitted inputs.
Lockless guide: says render “never checks for uncommitted” files, but changelog-message detection does check relevant inputs.
Default overlay skill: still recommends updating the lock, committing, then re-rendering/amending, without a separate lockless path.
The reason will be displayed to describe this comment to others. Learn more.
The lockless query uses uncommitted TOML defines/with/without here, but build uses the settings embedded in committed rendered packaging. Is this mismatch expected?
For example, pipewire currently has build.without = ["v4l2", "roc"]. Adding "pulse" without rendering and committing would make query omit pipewire-pulseaudio subpackage, but build would still select it using the committed settings.
Should lockless query use the same committed macro settings as build, so it describes what would actually be built?
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
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.
This adds support for lockless rendering, in a controlled per-component transition.
During the transition, the tool will look for a file named
lockless-components.txtin the same dir as theazldev.tomlfile (i.e., the top dir of the repo). If a component name is found inside this file, the component is considered a 'lockless' component; otherwise, the component is a legacy 'locked' component. Since our repo currently has an emptylockless-components.txtfile, all our components are currently considered 'locked', and none of these updates to azldev should have any effect at all on any 'locked' component.Until all components have been transitioned over, this adds a new command
azldev comp make-lockless, which adds the specified component name(s) to thelockless-components.txtfile, and runsazldev comp refresh-upstream-commitfor them, to generate the component's default upstream-commit toml file. After that, the component's 'lock' file will no longer be used for anything (unless the component is removed from thelockless-components.txtfile).After transitioning all components to lockless, we should remove support for 'locked' files from azldev, and remove the
azldev comp make-locklesscommand; and then we can remove thelockless-components.txtfile from our main repo.Most operations are the same for lockless components, but notably:
--changelog-commentparameter.--no-git-commitparameter is used.--allow-uncommittedazldev comp dist-git-repowhich converts the committed dist-git dir for a component into an industry-standard dist-git repo (at the path specified to--output-dir).Besides those listed above, I have probably forgot some other changes.
Note this is still undergoing copilot testing, and there may be additional changes required; but this should not impact any components that still use 'lock' files, so we can slowly migrate components to lockless one-at-a-time and address any transition issues as we find them.