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

workflows: Fix duplicate 3.11 job while still listing all versions together #249

Merged
merged 7 commits into from
Aug 17, 2023

Conversation

EliahKagan
Copy link
Contributor

@EliahKagan EliahKagan commented Aug 14, 2023

Closes #248

This stops a separate experimental=false test job from being created alongside the intended experimental=true job for the latest version, by moving all introduction of the experimental key into the include list. (This is possible solution 3 in #248.)

This could be done slightly more compactly by simply omitting the latest version from the initial list, but I think that would make it significantly less clear, in reading the workflow, what versions are being tested. It could be done even more compactly by removing the "experimental" logic altogether, since 3.11 no longer requires it, but I don't think that's the best approach because such logic is likely to be wanted for 3.12 soon. I've explored these considerations in more detail in #248.

The approach used here has the additional benefit--or at least I consider it a benefit--that, because the experimental key is added only in the include list, it is not made part of the job names shown in the GitHub Actions web interface.

I've also quoted all X.Y version numbers; although this only needs to be done for 3.10 and already was, it was also done for 3.11, suggesting no strong preference for minimal quoting. I think putting them all in the same style makes it easier to see what's going on. I did it originally to help myself avoid making a mistake when making the other changes, and I think it may make sense to keep it in. Of course, I'd be pleased to remove that change if it is not wanted, as well as to make any other requested changes to this PR.

This gives all Python versions to setup-python as strings rather
than as numbers. That was already being done, and must be done, for
3.10, which otherwise would become 3.1, but it was also already
being done for 3.11, suggesting no strong preference for minimal
quoting.
@EliahKagan EliahKagan marked this pull request as ready for review August 14, 2023 22:05
@EliahKagan EliahKagan changed the title workflows: Fix duplicate 3.11 workflow while still listing all versions together workflows: Fix duplicate 3.11 job while still listing all versions together Aug 14, 2023
This fixes the following two problems:

- GitHub Actions generated two separate jobs for Python 3.11
  because the "python-version" and "experimental" lists in the
  CI matrix generated a job for it with experimental=false, and
  then the "include" list that augments the CI matrix generated a
  separate job for it with experimental=true.

- The list of jobs is somewhat difficult to understand in the
  GitHub Actions interface, because the "python-version" and
  "experimental" keys are show in different orders, due to the
  different orders the workflow file listed them.
This lists all Python versions in the same list, given as the value
of the python-version key for the matrix, as was done in the past.
However, it still avoids producing two separate experimental and
non-experimental jobs for the same version that is intended to be
experimental, by listing both general and overridden "experimental"
keys in "include", and *not* listing "experimental" outside
"include".

This gives the workflow readability benefit of the old code, while
still fixing the problem that a separate non-experimental job was
also generated.
@cwacek cwacek merged commit 2a5aeb2 into cwacek:master Aug 17, 2023
6 checks passed
@EliahKagan EliahKagan deleted the logic-for-experimental branch August 17, 2023 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI experimental version logic duplicates job
2 participants