Skip to content
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

Draft PRs disable schema and package projection checks #244

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

CodeGat
Copy link
Member

@CodeGat CodeGat commented Mar 7, 2025

Closes #237

Background

Prereleases have evolved - sometimes they are used not to create a Release, but to have a sharable location to test out various builds. This means that the schema (and some of the checks) are unnessecarily restrictive. This PR removes schema checks and package projection checks for Draft PRs in Model Deployment Repositories.

Open Questions

Wouldn't mind @aidanheerdegen and @harshula s opinions on these questions:

  • Say we have an environment that installs mom5@development with spack package hash abcdefg. If we create another environment that reuses this package and therefore it's hash, will we have a modulefile clash even with a modulefile name {name}/development-{hash:7 (resolves to mom5/development-abcdefg)?
    • And is this actually a problem? The packages are identical - it's not like the earlier case where we had {name}/development clashing the other, non-identical builds of mom5@development.

Testing

Using ACCESS-TEST with branch 237-skip-check-spack-yaml-check-on-draft_TEST (which is the PR branch with all access-nri workflow refs replaced with the above branch). Did this with sed -E 's|uses: access-nri/build-cd/(.+)@v4|uses: access-nri/build-cd/$1@237-skip-check-spack-yaml-check-on-draft_TEST|g' -i .github/workflows/*

See ACCESS-NRI/ACCESS-TEST#31 - this contains a run of tests that validate:

  • Commit-invoked Draft PRs skip schema and package projection checks ✔️
  • !redeploy-invoked Draft PRs skip schema and package projection checks ✔️
  • Commit-invoked Non Draft PRs do NOT skip schema and package projection checks (and !bump continues to work) ✔️
  • !redeploy-invoked Non Draft PRs do NOT skip schema and package projection checks ✔️

This verifies that this PR is working as expected.

…n draft PRs

Split projection checks into root spec and packages
@CodeGat CodeGat added the type:enhancement Improvements to existing features label Mar 7, 2025
@CodeGat CodeGat linked an issue Mar 7, 2025 that may be closed by this pull request
@CodeGat CodeGat added priority:high version:MINOR Doesn't require update to Model Deployment Repositories for:v4 Applies to `v4` labels Mar 7, 2025
@CodeGat CodeGat self-assigned this Mar 7, 2025
@aidanheerdegen
Copy link
Member

  • And is this actually a problem?

What happens when a PR is closed or merged? Will the module file be deleted by one environment while it is still being used by another?

@CodeGat
Copy link
Member Author

CodeGat commented Mar 7, 2025

No, I've found out that modulefiles aren't handled by spack outside of creating them...gotta remove them ourselves!

@CodeGat CodeGat marked this pull request as ready for review March 11, 2025 00:13
@CodeGat
Copy link
Member Author

CodeGat commented Mar 11, 2025

I've verified that this PR works as it stands currently, so I'm setting it to Ready for Review - test details are in the PR description.

@aidanheerdegen
Copy link
Member

What happens with !bump in a draft PR?

@CodeGat
Copy link
Member Author

CodeGat commented Mar 11, 2025

It'd still bump the version. It doesn't care what state the PR is in

@aidanheerdegen
Copy link
Member

It'd still bump the version. It doesn't care what state the PR is in

Does that make sense for a draft PR which isn't checking the version stuff?

@aidanheerdegen
Copy link
Member

will we have a modulefile clash even with a modulefile name? And is this actually a problem?

Yes, and given we're going to have to create logic to remove the module files it is a problem if we remove a modulefile that is being used by another PR build.

So we should probably prepend the PR namespace to the module file projection automagically so we can easily and safely clean them up when the pre-release is cleaned up.

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.

LGTM

@CodeGat
Copy link
Member Author

CodeGat commented Mar 12, 2025

It'd still bump the version. It doesn't care what state the PR is in

Does that make sense for a draft PR which isn't checking the version stuff?

I mean, not really. But it'd have to be a conscious choice to !bump the version in a Draft, which I think we should keep as functionality. Maybe someone wants to draft the PR as it's not ready to merge (yet) and wanted to bump the version anyway.

So we should probably prepend the PR namespace to the module file projection automagically so we can easily and safely clean them up when the pre-release is cleaned up.

I think this should be a separate issue, because it might have implications for users outside of this PR.

@CodeGat CodeGat merged commit ebd6f55 into v4 Mar 12, 2025
5 checks passed
@CodeGat CodeGat deleted the 237-skip-check-spack-yaml-check-on-draft branch March 12, 2025 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for:v4 Applies to `v4` priority:high type:enhancement Improvements to existing features version:MINOR Doesn't require update to Model Deployment Repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove schema checks on Draft
2 participants