New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vcpkg] Add commands to maintain and verify versions db integrity #14999
[vcpkg] Add commands to maintain and verify versions db integrity #14999
Conversation
We now check that local git-tree objects match those in the db files.
|
…nerator much faster
"Couldn't find explicitly specified baseline `\"default\"` in the baseline file.", | ||
baseline_identifier); | ||
return Strings::format("Couldn't find explicitly specified baseline `\"default\"` in the baseline file.", | ||
baseline_identifier); | ||
} | ||
|
||
// attempt to check out the baseline: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_identifier
is empty, return{}
- if
baseline_identifier
is"default"
, parse the builtin baseline json and return that (or fail) - otherwise, try to check out
baseline_identifier
and parse from that.
If so, I'd expect a top-level if()
to make that clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what is the actual use case for empty baseline_identifier. I just tried to preserve existing behavior.
* [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>
…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 PR will add new commands to help maintain the version files up-to-date.
$x-default-baseline
to"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-versions
This command verifies that each port:
${VCPKG_ROOT}/port_versions/${prefix}-/${port_name}.json
versions
array.versions
array matches the current version of the port.git-tree
property.This command will run as part of CI once the
port_versions
files have been merged.vcpkg x-add-version ${port name}
Sets the current version in
baseline.json
to the version of the port in the ports directory; also adds the version to the corresponding versions file.Drive-by changes:
BaselineDeserializer
VersionT
toSchemedVersion
. This is necessary for updating the baseline file correctly withx-add-version
.x-history
:--output
.generatePortVersions.py
:GIT_OPTIONAL_LOCKS=0
to avoid crashes.baseline.json
generation.generateBaseline.py
:port_versions
since callingx-package-info
is infinitely slow.