Skip to content

Conversation

@CodeGat
Copy link
Member

@CodeGat CodeGat commented Nov 26, 2025

Closes #330
Will be merged into #326

Background

Root specs are very meaningful in our infrastructure. This comes with a few downsides, mostly in the cases where we have multiple specs in the speclist, or regular users want to use prerelease manifests in their own instances but can't due to prerelease-specific modifications of the root spec.

In this PR, we move away from important information being in the .spack.specs[0] field, and instead use reserved, dummy definitions at the top of the file:

spack:
  definitions:
  - _name: [access-om2]
  - _version: [2025.11.000]
  specs:
  - access-om2
  # ...

This means that speclists can be free from infra-specific information, and they are open to future modification.

The PR

  • Rename the get-spack-root-spec action to the more apt get-spack-manifest
    • Also update the outputs - simplified to deployment-{name|version} outputs, equivalent to .spack.definitions[]._{name|version}[0] fields.
  • Update all usages of the get-spack-root-spec action to get-spack-manifest

Testing

Testing Details in this collapsed section

Unit Tests

Done via pytest, all pass.

MDR Testing

Done for regular MDRs in ACCESS-NRI/ACCESS-TEST#60

Prerelease (Draft)

Success, see https://github.com/ACCESS-NRI/ACCESS-TEST/actions/runs/19916256065

Prerelease (Ready For Review)

Success, see https://github.com/ACCESS-NRI/ACCESS-TEST/actions/runs/20013811438

Prerelease (!redeploy)

Expected failure, since the schema version updates are not yet on the main branch (since comment triggers are technically in the context of the main branch). But, the only points of difference (The status setting in https://github.com/ACCESS-NRI/ACCESS-TEST/actions/runs/20014778511/job/57390074093 and https://github.com/ACCESS-NRI/ACCESS-TEST/actions/runs/20014778511/job/57390091047) succeeded as expected.

Software Deployment Repository Testing

Done for Software Deployment Repostiories in ACCESS-NRI/system-tools#19

Prerelease (Draft)

Succeeded, see https://github.com/ACCESS-NRI/system-tools/actions/runs/20151461268?pr=19

Prerelease (Ready For Review)

Succeeded. see https://github.com/ACCESS-NRI/system-tools/actions/runs/20217336546?pr=19

Prerelease (!redeploy)

Expected failure, since the schema version updates are not yet on the main branch (since comment triggers are technically in the context of the main branch). But, the only points of difference (The status setting in https://github.com/ACCESS-NRI/system-tools/actions/runs/20217823516/job/58033899157 and https://github.com/ACCESS-NRI/system-tools/actions/runs/20217823516/job/58033912451) succeeded as expected.

@CodeGat CodeGat self-assigned this Nov 26, 2025
@CodeGat CodeGat added the type:feature New feature label Nov 26, 2025
@CodeGat CodeGat added priority:high version:MAJOR Requires an update to Model Deployment Repositories CI for:v8 Applies to v8 labels Nov 26, 2025
@CodeGat CodeGat force-pushed the spack-v1-migration-reserved-defs branch from d9694d0 to 857bbd2 Compare November 27, 2025 02:32
@CodeGat CodeGat moved this from New Issues 🌅 to Review 👏 in Spack `0.22` to `1.0` Migration Dec 1, 2025
@CodeGat CodeGat marked this pull request as ready for review December 1, 2025 02:35
@CodeGat
Copy link
Member Author

CodeGat commented Dec 4, 2025

This looks about ready to go!

Copy link
Member

@aidanheerdegen aidanheerdegen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An initial pass, but might need a peer-review to ask some more questions.

# {'something': ['else']}
# ]}
# Into a much easier to parse:
# ['name': 'access-om2', 'version': '2025.02.100']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# ['name': 'access-om2', 'version': '2025.02.100']
# [{'name': 'access-om2'}, {'version': '2025.02.100'}]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking of which, why an array of single key/value dicts, and not just a dict with multiple key/value pairs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, they actually were dict[str, Any] anyway! Done in b60c71d

Comment on lines 55 to 61
# A bit of a strange case, but in future we may want to handle other reserved
# definitions as lists rather than single strings
case "name" | "version" | _:
reserved_definitions[reserved_name_no_underscore] = (
reserved_value_list[0]
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the other case isn't being handled currently why bother with this logic? Could just mention in a comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, done in b60c71d

Comment on lines 238 to 241
if len(package_spec.get("require", {})) != 0 and package_spec["require"][
0
].startswith("@"):
packages_with_versions_defined.append(package_name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if this was an automatice code-formatter, but that is horrendous line breaking.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, black. Done in b60c71d

Comment on lines +8 to 10
- _name: [access-om2]
- _version: [2024.03.0]
specs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has different indentation to the spack.yaml input. Don't know if this is relevant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wouldn't affect the tests, but it's good to be consistent - done in 984b2d3

# add package specs to the `specs` list
definitions:
- _name: ["access-om2"]
- _version: ["2024.03.0"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we support/test for reserved definitions other than than _name and _version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't test for them yet, since _name and _version are the only two I can think of so far.

@CodeGat CodeGat requested a review from harshula as a code owner December 18, 2025 06:04
@CodeGat CodeGat force-pushed the spack-v1-migration-reserved-defs branch from e871355 to db7e3db Compare December 18, 2025 22:41
@CodeGat
Copy link
Member Author

CodeGat commented Dec 19, 2025

After the rebase onto v7, I note that it still works fine 👍 See ACCESS-NRI/ACCESS-TEST#60 (comment)

Update reserved defs getter return value, remove case statement, revert autoformatter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for:v8 Applies to v8 priority:high type:feature New feature version:MAJOR Requires an update to Model Deployment Repositories CI

Projects

Status: Review 👏

Development

Successfully merging this pull request may close these issues.

3 participants