Skip to content

Allow Rebases to Model Deployment PRs #141

@CodeGat

Description

@CodeGat

Background

As per a conversation with @aidanheerdegen:

Model deployment repositories aren't able to rebase their pull request branches because the workflow makes use of the number of commits on a branch as the name of the spack environment (like <MODEL>-pr<PR NUMBER>-<COMMIT NUMBER>, eg. access-om3-pr12-2), see

- name: Generate Versions
id: version
# This step generates the release and prerelease version numbers.
# The release is a general version number from the spack.yaml, looking the
# same as a regular release build. Ex. '[email protected]' -> '2024.01.1'
# The prerelease looks like: `pr<pull request number>-<number of commits on this branch>`.
# Ex. Pull Request #12 with 2 commits on branch -> `pr12-2`.
run: |
echo "release=$(yq '${{ env.SPACK_YAML_MODEL_YQ }} | split("@git.") | .[1]' spack.yaml)" >> $GITHUB_OUTPUT
number_of_commits=$(git rev-list --count ${{ github.event.pull_request.base.sha }}..HEAD)
echo "prerelease=pr${{ github.event.pull_request.number }}-${number_of_commits}" >> $GITHUB_OUTPUT

Since it is a requirement for now that users can't rebase, make this explicit in both the documentation, and in the workflow itself.

Update

We are now allowing PRs to rebase because we are using the deployment number + 1 instead of commit number

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions