add exclude snapshot repo option to virtual snapshot#10307
Conversation
40c011a to
0c9c773
Compare
|
|
||
| %changelog | ||
| * Thu Aug 29 2024 Sam Meluch <sammeluch@microsoft.com> - 3.5.6-3 | ||
| - Add virtual repo snapshot exclude |
There was a problem hiding this comment.
Is there a reason we want a separate argument for the snapshot instead of relying on the existing --disablerepo and --enablerepo? I'm worried that having two may be confusing when using the snapshot.
There was a problem hiding this comment.
The reason to add a snapshot exclude option is to allow for a repo containing new packages locally built to still be included when building an image, but not from upstream. This is also additional flexibility within the feature for tdnf, not just applicable to our use case for allowing local RPMs from within the toolkit.
| +{ | ||
| + uint32_t dwError = 0; | ||
| + int nIsGlob = 0; | ||
| + if(!pRepos && IsNullOrEmptyString(pszId)) |
There was a problem hiding this comment.
Good catch, this is actually copy paste from upstream, we can likely contribute this small fix upstream if not already present
| " [--enableplugin=<plugin_name>]\n" | ||
| - " [--snapshottime=<POSIX_time>]\n" | ||
| " [--exclude [file1,file2,...]]\n" | ||
| + " [--excludesnapshot=<repoid>]\n" |
There was a problem hiding this comment.
can we rename this to something like --snapshotexclusionrepos so that it sorts with snapshottime. And helps clarify that the snapshot exclusion applies to a repo.
Also...how big of a stretch from here to take a comma separated list of repos (I know we discussed supporting only 1)
There was a problem hiding this comment.
Updated to --snapshotexcluderepos to make the names come together.
I also added the ability to specify multiple repos in one go as a comma separated list in line.
There was a problem hiding this comment.
tested by running the following commands to check if the second repo was snapshot when using the updated tdnf:
tdnf install valgrind --snapshottime=1724119509 --snapshotexcluderepos=azurelinux-official-base
tdnf install valgrind --snapshottime=1724119509 --snapshotexcluderepos=azurelinux-official-base,azurelinux-official-base-debug

f94aa40 to
1430837
Compare
Merge Checklist
All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)
*-staticsubpackages, etc.) have had theirReleasetag incremented../cgmanifest.json,./toolkit/scripts/toolchain/cgmanifest.json,.github/workflows/cgmanifest.json)./LICENSES-AND-NOTICES/SPECS/data/licenses.json,./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md,./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)*.signatures.jsonfilessudo make go-tidy-allandsudo make go-test-coveragepassSummary
What does the PR accomplish, why was it needed?
After discussing snapshot functionality slightly deeper, the ability to exclude a repo from the snapshot is desired and useful. The patch has added --excludesnapshot option for the command line of tdnf
Change Log
Does this affect the toolchain?
YES
Test Methodology