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

PR check generator: add excludeOsAndVersionCombination #2350

Merged
merged 4 commits into from
Jun 24, 2024

Conversation

angelapwen
Copy link
Contributor

@angelapwen angelapwen commented Jun 24, 2024

We often need to exclude specific combinations of CLI versions + operating systems. Previously there was no easy way to do this: we would run all CLI versions specified against all operating systems specified. This change adds the excludeOsAndVersionCombination parameter to do just that!

To test, I re-enabled Swift on Linux for CLI v >= 2.17.4, which remained as a to-do item after we disabled those checks in #2299. Note that default, linked, and nightly-latest are all now current enough to re-enable those. The new generator script allows us to exclude all older CLI versions on Linux.

I'll update the required PR checks once this PR is approved ✅

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@angelapwen angelapwen force-pushed the angelapwen/add-exclude-pr-check-param branch from 62fb0a9 to 9ff3492 Compare June 24, 2024 12:44
Now that CLI v2.17.4+ are available, we can switch this job back to `ubuntu`. As a result, we can also bring back testing on the older CLI versions (which did not work on MacOS).
CLI v.2.16.6 has a known failure on Linux so we exclude it from this workflow.

This change is orthogonal to the PR check generator change as the check doesn't use the generator.
@angelapwen angelapwen force-pushed the angelapwen/add-exclude-pr-check-param branch from 9ff3492 to 462c756 Compare June 24, 2024 12:44
@angelapwen angelapwen marked this pull request as ready for review June 24, 2024 13:38
@angelapwen angelapwen requested a review from a team as a code owner June 24, 2024 13:38
henrymercer
henrymercer previously approved these changes Jun 24, 2024
Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

Just a small suggestion to reduce the likelihood of an argument ordering mismatch

matrix = []
excludedVersionsAndOses = checkSpecification.get('excludeOsAndVersionCombination', [])
Copy link
Contributor

Choose a reason for hiding this comment

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

We could rename to excludedOsesAndVersions for clarity since it's OSes first and versions second


for runnerImage in runnerImagesForOs:
# Skip appending this combination to the matrix if it is explicitly excluded.
if is_version_and_os_excluded(version, operatingSystem, excludedVersionsAndOses):
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly here consider using the same order of OS and version as in the YAML.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I actually misordered it myself when testing initially 😆

@@ -27,6 +27,12 @@
"nightly-latest"
]

def is_os_and_version_excluded(version, os, exclude_params):
Copy link
Contributor

Choose a reason for hiding this comment

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

Final suggestion: match the order of the arguments too, e.g. is_os_and_version_excluded(os, version, exclude_params):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call ✨

@angelapwen
Copy link
Contributor Author

Updated the branch protection rules accordingly for main, releases/v2, and releases/v3.

@angelapwen angelapwen merged commit 8723b5b into main Jun 24, 2024
310 checks passed
@angelapwen angelapwen deleted the angelapwen/add-exclude-pr-check-param branch June 24, 2024 16:49
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.

2 participants