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

chore: CI creates lean-pr-testing-NNNN branches at Std too #3200

Merged
merged 9 commits into from
Jan 22, 2024

Conversation

kim-em
Copy link
Collaborator

@kim-em kim-em commented Jan 19, 2024

Currently we create lean-pr-testing-NNNN branches at Mathlib automatically for each Lean PR.

We don't automatically create one at Std; mostly simply because Std fails less often, so it has been okay to do this manually as needed. It is conceptually simpler, however, if this is done uniformly.

This PR:

  • does not proceed with Std/Mathlib CI unless the appropriate nightly-testing-YYYY-MM-DD tag exists at Std (like it already doesn't proceed if that tag is missing at Mathlib)
  • creates lean-pr-testing-NNNN branches at Std
  • when it creates lean-pr-testing-NNNN branches at Mathlib, updates the Std dependency to use the lean-pr-testing-NNNN branch at Std

Note that because most users do not have write access at Std, in order to make updates to lean-pr-testing-NNNN branches there they will need to make PRs. These will be merged with a very low bar, and feel free to ping me for assistance on this. If this is annoying we will automate. Also, frequent contributors to Lean may ask @digama0 or @joehendrix for write access in order to easily work on these branches.

This PR requires that we have a secret here with write access at Std. I'm arranging that on zulip.

I will update the documentation at https://leanprover-community.github.io/contribute/tags_and_branches.html to reflect these changes when they are merged.

@kim-em kim-em added the awaiting-review Waiting for someone to review the PR label Jan 19, 2024
@kim-em kim-em requested a review from nomeata January 19, 2024 01:54
@kim-em kim-em requested a review from Kha as a code owner January 19, 2024 01:54
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 19, 2024 01:57 Inactive
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 19, 2024 02:00 Inactive
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jan 19, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Jan 19, 2024

Mathlib CI status (docs):

  • ❗ Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. (2024-01-19 02:12:56)
  • ✅ Mathlib branch lean-pr-testing-3200 has successfully built against this PR. (2024-01-22 04:31:01) View Log

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 19, 2024 02:35 Inactive
Copy link
Contributor

@nomeata nomeata left a comment

Choose a reason for hiding this comment

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

LGTM. I wonder if the “"This shouldn't be possible” code path should simply error: We expect the tag to exist, so it can just fail and crash if it doesn’t

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc January 22, 2024 02:48 Inactive
@kim-em kim-em enabled auto-merge January 22, 2024 02:53
@kim-em kim-em added this pull request to the merge queue Jan 22, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jan 22, 2024
Merged via the queue into master with commit 5cc9f6f Jan 22, 2024
11 checks passed
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Jan 22, 2024
Comment on lines -251 to +321
git checkout "$BASE"

EXISTS="$(git ls-remote --heads origin lean-pr-testing-${{ steps.workflow-info.outputs.pullRequestNumber }} | wc -l)"
echo "Branch exists: $EXISTS"
if [ "$EXISTS" = "0" ]; then
echo "Branch does not exist, creating it."
git checkout -b lean-pr-testing-${{ steps.workflow-info.outputs.pullRequestNumber }}
git switch -c lean-pr-testing-${{ steps.workflow-info.outputs.pullRequestNumber }} "$BASE"
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm turns out

git switch -c foo base

works if base is a local tag, but not if it is a (remote) branch.

The old code (git checkout base) would work for a (remote) branch, but not for a tag. Kinda annoying.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we need to parse this output to go onto a common path in both cases

$ git ls-remote --heads --tags --exit-code https://github.com/leanprover-community/mathlib4 nightly-testing-2024-01-22
7d803278d1b5978fccc14f992d9ffb692077ed93	refs/heads/nightly-testing-2024-01-22
$ git ls-remote --heads --tags --exit-code https://github.com/leanprover/std4 nightly-testing-2024-01-22
c15b5a8f04e84bc7aab8b1062a4a80de3046865f	refs/tags/nightly-testing-2024-01-22

Alternatively, we can once manually convert all nightly-testing-YYYY-MM-DD branches to tags on mathlib4. Maybe easier.

Copy link
Contributor

Choose a reason for hiding this comment

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

Possible fix in #3208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review Waiting for someone to review the PR builds-mathlib CI has verified that Mathlib builds against this PR toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants