[vcpkg] Add commands to maintain and verify versions db integrity#14999
Merged
ras0219-msft merged 61 commits intomicrosoft:masterfrom Jan 8, 2021
Merged
[vcpkg] Add commands to maintain and verify versions db integrity#14999ras0219-msft merged 61 commits intomicrosoft:masterfrom
ras0219-msft merged 61 commits intomicrosoft:masterfrom
Conversation
BillyONeal
reviewed
Dec 8, 2020
Member
Author
|
We now check that local git-tree objects match those in the db files. |
…nerator much faster
vicroms
commented
Dec 9, 2020
ras0219
reviewed
Jan 5, 2021
| baseline_identifier); | ||
| } | ||
|
|
||
| // attempt to check out the baseline: |
Contributor
There was a problem hiding this comment.
I may be missing some subtleties w.r.t. the interesting return value from load_baseline_versions() and I haven't looked at the consumers of this function yet, however:
Why does the processing of port_versions/baseline.json potentially cause this section to be short-circuited? It seems that this function should:
- if
baseline_identifieris empty, return{} - if
baseline_identifieris"default", parse the builtin baseline json and return that (or fail) - otherwise, try to check out
baseline_identifierand parse from that.
If so, I'd expect a top-level if() to make that clearer.
Member
Author
There was a problem hiding this comment.
I'm not sure what is the actual use case for empty baseline_identifier. I just tried to preserve existing behavior.
ras0219-msft
approved these changes
Jan 8, 2021
strega-nil
pushed a commit
to strega-nil/vcpkg
that referenced
this pull request
May 5, 2021
* [vcpkg] Refactor end-to-end tests * [vcpkg] Cherry-pick x-builtin-ports-root from microsoft#14999 * [vcpkg] Move create test from unit tests to e2e Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
strega-nil
pushed a commit
to strega-nil/vcpkg
that referenced
this pull request
May 5, 2021
…crosoft#14999) * [vcpkg] Add x-ci-verify-versions command * Code cleanup * Remove port version splitting from x-history * Fix wrong message on success * Parallelize versions file generator * Use cpu_count()/2 to avoid crashes * Check db SHA against local SHA * Check baseline version with x-ci-verify-versions and make baseline generator much faster * Implement x-add-version to update version db files * Better checks for x-add-info and make x-ci-verify-versions silent on success * Use find() instead of [] on maps * Create version file if does not exist * Allow redirection of ports/ and port_versions/ * add test ports * WIP end-to-end tests * Change pats in e2e tests * Fix e2e args * e2e once more * Pass �ersions feature flag to e2e * Exit with code 1 if there are errors * Files to test for failure cases * Update test files * Add test for x-add-version * fix redirected ports in last test * Add CI check (use dummy data) * Add feature-flags=versions * Ignore subdirectories inside ports * Add --verify-git-trees switch * [vcpkg] Fix build breaks * [x-ci-verify-versions] PR comments * [x-add-version] PR comments * Fix merge conflicts * Modify tests and pipeline * Baselines should only have version-string * Refactor x-add-version * [vcpkg] Fix help message * [vcpkg] Fix minor warnings * `x-add-version --all` doesn't stop on first failure and reduced default verbosity * [vcpkg] Fix default-baseline * Load file instead of using paths provider * Format * Remove ci test * Add fish port for testing * Update version files * Update fish port to cause SHA discrepancy * Test for discrepancy between local SHA and declared SHA * Missing = operator * Check for error message since x-add-version exits with code 0 * Make x-add-version fail with non-zero exit code if not run with --all Co-authored-by: Robert Schumacher <roschuma@microsoft.com> Co-authored-by: Robert Schumacher <ras0219@outlook.com>
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.
This PR will add new commands to help maintain the version files up-to-date.
$x-default-baselineto"builtin-baseline"and check it is not used without the versions feature enabled"baseline"versions/directory inName of commands is up for discussion.
vcpkg x-ci-verify-versionsThis command verifies that each port:
${VCPKG_ROOT}/port_versions/${prefix}-/${port_name}.jsonversionsarray.versionsarray matches the current version of the port.git-treeproperty.This command will run as part of CI once the
port_versionsfiles have been merged.vcpkg x-add-version ${port name}Sets the current version in
baseline.jsonto the version of the port in the ports directory; also adds the version to the corresponding versions file.Drive-by changes:
BaselineDeserializerVersionTtoSchemedVersion. This is necessary for updating the baseline file correctly withx-add-version.x-history:--output.generatePortVersions.py:GIT_OPTIONAL_LOCKS=0to avoid crashes.baseline.jsongeneration.generateBaseline.py:port_versionssince callingx-package-infois infinitely slow.