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

Integrate build_msi into main CI workflow #121778

Merged

Conversation

webknjaz
Copy link
Contributor

Previously, this workflow would run on related file changes and not contribute the the overall outcome of the CI run. This patch turns it into a reusable workflow, integrating it closer with the rest of the setup. It remains non-voting and skips or failures will not block the CI, just as before.

@webknjaz webknjaz force-pushed the maintenance/gha-win-msi-reusable-collapse branch 2 times, most recently from 85bb8b4 to a607b3d Compare July 14, 2024 23:09
@webknjaz
Copy link
Contributor Author

Since the workflow is failing on main, it's not a blocker for merging this PR, as shown in this run that you @hugovk triggered: https://github.com/python/cpython/actions/runs/9934791196. The most obvious difference between the last failing and this runs is that the successful one uses Python 3.11 and the recent failure is hitting 3.12.

@webknjaz
Copy link
Contributor Author

@hugovk could you set the labels?

@webknjaz webknjaz force-pushed the maintenance/gha-win-msi-reusable-collapse branch from a607b3d to 662c1a5 Compare July 16, 2024 22:25
@webknjaz
Copy link
Contributor Author

I made a rebase. But FTR, the CI failure is still caused by #121879, not changes here.

@zooba
Copy link
Member

zooba commented Jul 17, 2024

I'm not really a fan of just adding more and more checks to every PR. There's really no need to run this one without changes unless something external has changed, and the only thing that's external is blurb (and I'm now tempted to pin the version, so then a change would trigger these runs).

@webknjaz
Copy link
Contributor Author

I'm not really a fan of just adding more and more checks to every PR. There's really no need to run this one without changes unless something external has changed,

@zooba this keeps the conditionals you have already, that doesn't change. It'll get skipped the same way.

@webknjaz
Copy link
Contributor Author

One of the reasons, I'm making this series of updates is that the workflows are a bit disorganized and I want to improve that.

@webknjaz
Copy link
Contributor Author

and the only thing that's external is blurb

I identified two things that are external, though — the second one is the VM+CPython that GH ships in it. It's *-latest and unpinned, as a result. My first impression was that the problem was caused by the Python 3.11->3.12 update. It took some time to notice the blurb bit too.

@webknjaz webknjaz force-pushed the maintenance/gha-win-msi-reusable-collapse branch from 662c1a5 to df78d34 Compare July 18, 2024 00:08
@zooba
Copy link
Member

zooba commented Jul 18, 2024

this keeps the conditionals you have already, that doesn't change

Okay, good.

I identified two things that are external, though — the second one is the VM+CPython that GH ships in it.

We shouldn't have any direct reliance on the underlying OS though, and the build is designed to abstract away installed tools. Having that occasionally change is a better way to flush out real issues (and we don't try to run the installer, which would be annoyingly impacted by the way GitHub installs Python... currently the release tests only succeed because GitHub can't have installed a copy of Python that we haven't released yet, but if you run the tests on an earlier version it often fails! Haven't found a good way around this yet, short of running our own (clean) VM.)

Hopefully Blurb changes so little in future that we don't regress its CLI/API again, and then there's no issue with that either. It also seems we may not actually need to run it at all (based on some discussion with @ambv), but I'll need more time (in a few weeks) to confirm and fix that.

@webknjaz
Copy link
Contributor Author

Aha, I see. Well, I was thinking of a way to get this run on the VM changes earlier — with the current patch, it's becoming possible to add more clever change detection with cache-based checks that would trigger these job runs. I can explore that in a separate PR if you think it's something that makes sense. Let me know. I'll keep this PR scope tight, though.

@webknjaz webknjaz force-pushed the maintenance/gha-win-msi-reusable-collapse branch from df78d34 to 6ead508 Compare July 18, 2024 19:47
@hugovk hugovk changed the title 🧪💅 Integrate build_msi into main CI workflow Integrate build_msi into main CI workflow Jul 23, 2024
.github/workflows/build.yml Outdated Show resolved Hide resolved
webknjaz and others added 2 commits July 23, 2024 22:18
Previously, this workflow would run on related file changes and not
contribute the the overall outcome of the CI run. This patch turns it
into a reusable workflow, integrating it closer with the rest of the
setup. It remains non-voting and skips or failures will not block the
CI, just as before.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@webknjaz webknjaz force-pushed the maintenance/gha-win-msi-reusable-collapse branch from ad0ba6b to a6bbc82 Compare July 23, 2024 20:18
@webknjaz webknjaz requested a review from hugovk July 23, 2024 20:35
@hugovk
Copy link
Member

hugovk commented Jul 23, 2024

Please remember not to force push in this repo, it makes it harder to review what changed since last review. Everything is squash-merged at the end anyway. Thanks!

From the devguide:

In order to keep the commit history intact, please avoid squashing or amending history and then force-pushing to the PR. Reviewers often want to look at individual commits.

https://devguide.python.org/getting-started/pull-request-lifecycle/#quick-guide

.github/workflows/build.yml Outdated Show resolved Hide resolved

jobs:
build:
name: installer for ${{ inputs.arch }}
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if the name will be qualified in some other way?

Suggested change
name: installer for ${{ inputs.arch }}
name: Windows installer for ${{ inputs.arch }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's already prefixed with "windows" on the calling side. I intentionally didn't add it here. The UI side is fine.

Copy link
Contributor Author

@webknjaz webknjaz Jul 24, 2024

Choose a reason for hiding this comment

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

Screenshot_2024-07-24-10-41-25-10_320a9a695de7cdce83ed5281148d6f19.jpg

Screenshot_2024-07-24-10-42-35-22_40deb401b9ffe8e1df2f1cc5ba480b12.jpg

Screenshot_2024-07-24-10-43-39-56_40deb401b9ffe8e1df2f1cc5ba480b12.jpg

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On the screenshots above, it's visible that it's also consistent with other reusable workflows.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@hugovk hugovk added the needs backport to 3.12 bug and security fixes label Jul 24, 2024
@hugovk hugovk added the needs backport to 3.13 bugs and security fixes label Jul 24, 2024
@hugovk hugovk merged commit af4329e into python:main Jul 24, 2024
39 checks passed
@hugovk
Copy link
Member

hugovk commented Jul 24, 2024

Thanks!

@miss-islington-app
Copy link

Thanks @webknjaz for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 24, 2024
(cherry picked from commit af4329e)

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@miss-islington-app
Copy link

Sorry, @webknjaz and @hugovk, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker af4329e7b1a25d58bb92f79480f5059c3683517b 3.12

@bedevere-app
Copy link

bedevere-app bot commented Jul 24, 2024

GH-122226 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 24, 2024
hugovk added a commit that referenced this pull request Jul 24, 2024
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@hugovk
Copy link
Member

hugovk commented Jul 24, 2024

@webknjaz Please could you do the 3.12 backport? Many thanks!

@webknjaz
Copy link
Contributor Author

Sure, it's on my list, I was AFK for a bit and it got postponed ;)

webknjaz added a commit to webknjaz/cpython that referenced this pull request Jul 24, 2024
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>.
(cherry picked from commit af4329e)

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
@bedevere-app
Copy link

bedevere-app bot commented Jul 24, 2024

GH-122231 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Jul 24, 2024
hugovk pushed a commit that referenced this pull request Jul 24, 2024
nohlson pushed a commit to nohlson/cpython that referenced this pull request Jul 24, 2024
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
nohlson pushed a commit to nohlson/cpython that referenced this pull request Jul 24, 2024
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@@ -218,6 +233,21 @@ jobs:
arch: ${{ matrix.arch }}
free-threading: ${{ matrix.free-threading }}

build_windows_msi:
name: >- # ${{ '' } is a hack to nest jobs under the same sidebar category
Windows MSI${{ '' }}
Copy link
Member

Choose a reason for hiding this comment

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

@webknjaz Someone else has said "Tests / Windows MSI${{ '' }} (pull_request)" looks like a bug.

I think in some other thread you said we can adjust it somehow, is that possible?

Copy link
Contributor Author

@webknjaz webknjaz Aug 2, 2024

Choose a reason for hiding this comment

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

@hugovk basically, there are two options:

  • split this into two matrices in the top-level workflow
  • move the interpolated part of the name into the reusable ones

I personally like the second option. Let me know if you or @ambv want something different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Though, I think both might break grouping 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, any other ideas? Someone else has asked about it because it looks weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it would be most impactful if GitHub fixed this in its own UI rather than having people resort to hacks. I'd be happy to drop the ${{ '' }} hack from other places.

Would it be less confusing is we switched Windows MSI${{ '' }} to ${{ 'Windows MSI' }}?

Copy link
Member

Choose a reason for hiding this comment

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

How would that look for the different builds?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The same, just bits of syntax would be around the string, not after.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think that might be a bit better?

The recent query was actually about the fromJSON stuff, do you think we can do anything about that?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Duplicating the matrix or moving the conditional inside the reusable workflow would improve this, I suppose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've done some thinking and realized that duplicating the matrices is the only way to make it look different while preserving the matrix grouping in the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants