Add reserved commit variant to preserve data#48702
Conversation
0aba4db to
257a9a1
Compare
59ab524 to
ab1b64d
Compare
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fix==> Running style checks on spack
selected: import, isort, black, flake8, mypy
==> Modified files
lib/spack/spack/fetch_strategy.py
lib/spack/spack/solver/asp.py
lib/spack/spack/spec.py
lib/spack/spack/test/concretization/core.py
lib/spack/spack/test/conftest.py
lib/spack/spack/test/git_fetch.py
lib/spack/spack/test/versions.py
lib/spack/spack/variant.py
lib/spack/spack/version/version_types.py
var/spack/repos/builtin.mock/packages/git-ref-package/package.py
==> Running import checks
import checks were clean
==> Running isort checks
isort checks were clean
==> Running black checks
reformatted lib/spack/spack/solver/asp.py
All done! ✨ 🍰 ✨
1 file reformatted, 9 files left unchanged.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> Running mypy checks
Success: no issues found in 637 source files
mypy checks were clean
==> spack style checks were clean
I've updated the branch with style fixes. |
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fix==> Running style checks on spack
selected: import, isort, black, flake8, mypy
==> Modified files
lib/spack/llnl/util/lock.py
lib/spack/spack/detection/common.py
lib/spack/spack/directives.py
lib/spack/spack/fetch_strategy.py
lib/spack/spack/package_base.py
lib/spack/spack/solver/asp.py
lib/spack/spack/spec.py
lib/spack/spack/test/concretization/core.py
lib/spack/spack/test/conftest.py
lib/spack/spack/test/git_fetch.py
lib/spack/spack/test/versions.py
lib/spack/spack/variant.py
lib/spack/spack/version/version_types.py
var/spack/repos/builtin.mock/packages/git-ref-package/package.py
==> Running import checks
import checks were clean
==> Running isort checks
isort checks were clean
==> Running black checks
reformatted lib/spack/spack/detection/common.py
reformatted lib/spack/llnl/util/lock.py
reformatted lib/spack/spack/directives.py
reformatted lib/spack/spack/spec.py
All done! ✨ 🍰 ✨
4 files reformatted, 10 files left unchanged.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> Running mypy checks
Success: no issues found in 637 source files
mypy checks were clean
==> spack style checks were clean
I've updated the branch with style fixes. |
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fix==> Running style checks on spack
selected: import, isort, black, flake8, mypy
==> Modified files
lib/spack/spack/fetch_strategy.py
lib/spack/spack/package_base.py
lib/spack/spack/solver/asp.py
lib/spack/spack/spec.py
lib/spack/spack/test/concretization/core.py
lib/spack/spack/test/conftest.py
lib/spack/spack/test/git_fetch.py
lib/spack/spack/test/versions.py
lib/spack/spack/variant.py
lib/spack/spack/version/__init__.py
lib/spack/spack/version/common.py
lib/spack/spack/version/version_types.py
var/spack/repos/builtin.mock/packages/git-ref-package/package.py
==> Running import checks
import checks were clean
==> Running isort checks
isort checks were clean
==> Running black checks
reformatted lib/spack/spack/version/common.py
All done! ✨ 🍰 ✨
1 file reformatted, 12 files left unchanged.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> Running mypy checks
Success: no issues found in 637 source files
mypy checks were clean
==> spack style checks were clean
I've updated the branch with style fixes. |
|
Following on to our conversation today, some things we need to check:
If there is no reuse, that should concretize to
Future PR will parse them, and will remove the
@psakievich am I missing anything from our conversation? |
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fix==> Running style checks on spack
selected: import, isort, black, flake8, mypy
==> Modified files
lib/spack/spack/fetch_strategy.py
lib/spack/spack/package_base.py
lib/spack/spack/solver/asp.py
lib/spack/spack/spec.py
lib/spack/spack/test/cmd/find.py
lib/spack/spack/test/concretization/core.py
lib/spack/spack/test/conftest.py
lib/spack/spack/test/git_fetch.py
lib/spack/spack/test/packages.py
lib/spack/spack/test/versions.py
lib/spack/spack/variant.py
lib/spack/spack/version/__init__.py
lib/spack/spack/version/common.py
lib/spack/spack/version/version_types.py
var/spack/test_repos/spack_repo/builtin_mock/packages/git_ref_commit_dep/package.py
var/spack/test_repos/spack_repo/builtin_mock/packages/git_ref_package/package.py
var/spack/test_repos/spack_repo/builtin_mock/packages/git_test_commit/package.py
==> Running import checks
import checks were clean
==> Running isort checks
Fixing /tmp/tmp2pw76zj9/spack/var/spack/test_repos/spack_repo/builtin_mock/packages/git_ref_commit_dep/package.py
isort checks were clean
==> Running black checks
All done! ✨ 🍰 ✨
17 files left unchanged.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> Running mypy checks
Success: no issues found in 611 source files
mypy checks were clean
==> spack style checks were clean
I've updated the branch with style fixes. |
becker33
left a comment
There was a problem hiding this comment.
Ok I tried to be as thorough as possible here so we don't have to go back and forth more than necessary, hopefully this all makes sense and is easy to address.
* Define components for GitVersion provenance Adding binary provenance requires we track the commit. Typically this has been an optional form for the encompassing git ref. Moving towards always defining a commit means we need to have space to store a user requested ref that will then be paired with a commit sha. * Convert internal members to new names * Style fixes * Update lib/spack/spack/spec.py * Update lib/spack/spack/spec.py * commit variant concretizes and check is commit * Add tests * Add version attribute restrictions for commit variant * dev_path and commit mutually exclusive * Have fetcher respect the commit variant Ensure that if a commit variant is on the spec fetch operations use the commit * Add package class hook for SNL work * Fix commit check * Add a more specific function for shas * Handler for overlapping attributes * Fix tests * Add additional reserved variants * Add unit-tests to verify requirements * Write tests and stub out core changes * Attempt to add solver constraint * Fix lp constraint * First new unit test passes * Review fixes * WIP: refactor test * Add lookup check tests * Add package tests * New test on version satisfaction * Rework test * Fix problem * Revert random style changes * Style * Rework concretizer rules still not passing * WIP: More rules * Ideas for facts that will close the loop * Style and fixes * Disable failing tests * Update core.py * Update packages.py * Fix tests and test reuse * Remove Philter * Add docs * Relocate test package * Okay dir * Move test package * Use underscores * Fix package * [@spackbot] updating style on behalf of psakievich * Update path * Respond to review comments * Fix test --------- Co-authored-by: psakievich <[email protected]>
As noted in #48121 when we move to always having commit sha's paired to
GitVersionsthe optional user supplied git ref can get lost. This PR is intended to make space for storing all three components of aGitVersionWe've opted for the following syntax. When a spec has a commit assigned it will go into a reserved variant
GitVersion syntax is then unchanged, but a commit will get added based on the user ref.
This PR also ensures that the fetcher will respect a commit variant. After doing this work I'm not totally sure we need to convert
StandardVersionsusingbranchortagattributes toGitVersions. It's not clear to me what the additional utility that provides over just accounting for the commit sha as a variant.Using the commit as a proper variant mostly resolves the concerns regarding projections and use inside a package class outlined in #48121. We essentially side step the issue by not changing versions and making commits node attributes rather than version attributes. I believe this eliminates, or at least alleviates, most of the need for using
GitVersionsin production systemsI will add docs once the basic design is approved.