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

Add Swift Macro Compatibility Check to CI #3406

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Matejkob
Copy link
Contributor

This PR adds a Swift Macro Compatibility Check GitHub Action to ensure that macro changes remain compatible across different versions of swift-syntax. The action automatically verifies compatibility with major swift-syntax versions (509.0.0, 510.0.0, 600.0.0), running builds and tests. It's also posible to turn on checking agains all versions of swift-syntax.

Key Benefits:

  • Automated Compatibility Checks: No need to manually test changes across different swift-syntax versions—this is handled automatically in CI.
  • Prevents Breakages: Helps avoid accidentally committing changes that break older versions.

This PR adds a **Swift Macro Compatibility Check** GitHub Action to ensure that macro changes remain compatible across different versions of `swift-syntax`. The action automatically verifies compatibility with major `swift-syntax` versions (`509.0.0`, `510.0.0`, `600.0.0`), running builds and tests. It's also posible to turn on checking agains all versions of `swift-syntax`.

#### Key Benefits:
- **Automated Compatibility Checks**: No need to manually test changes across different `swift-syntax` versions—this is handled automatically in CI.
- **Prevents Breakages**: Helps avoid accidentally committing changes that break older versions.
@Matejkob Matejkob changed the title Add Swift Macro Compatibility Check GitHub Action Add Swift Macro Compatibility Check to CI Sep 24, 2024
@Matejkob
Copy link
Contributor Author

A run with all swift-syntax versions took 7 m 46 s. I have changed the argument in the action to run with only the major version–let's see the difference if one of you would be kind enough to approve the workflow again :3

@Matejkob
Copy link
Contributor Author

Wrapping up: checking against all versions of swift-syntax:

  • 509.0.0
  • 509.0.1
  • 509.0.2
  • 509.1.0
  • 509.1.1
  • 510.0.0
  • 510.0.1
  • 510.0.2
  • 510.0.3
  • 600.0.0

for this repository, it takes approximately 8 minutes,

but checking against only major versions:

  • 509.0.0
  • 510.0.0
  • 600.0.0

takes 3 minutes. From my experience, running only against major versions is sufficient since swift-syntax does not introduce significant changes across major versions. @stephencelis @mbrandonw, please let me know which version you prefer.

@stephencelis
Copy link
Member

@Matejkob Might be nice to do major versions only. Should the major versions take the latest up to the next major? E.g.:

  • 509.1.1
  • 510.0.3
  • 600.0.0

Or do you think compatibility with the earlier version in a major release is better?

@Matejkob
Copy link
Contributor Author

Matejkob commented Sep 25, 2024

@Matejkob Might be nice to do major versions only. Should the major versions take the latest up to the next major? E.g.:

  • 509.1.1
  • 510.0.3
  • 600.0.0

Or do you think compatibility with the earlier version in a major release is better?

At the time I considered this, I concluded that the "major version" should correspond to the version of swift-syntax where a new version marker module was introduced. I believe this approach makes the most sense. For instance, if at some point swift-syntax requires a version marker (empty product) for a non-major version, like 6.0.2, then it can also be added to the list of "major versions" (it should not be called major version anymore).

but if you @stephencelis think otherwise I can change it :>

@Matejkob Matejkob marked this pull request as draft September 25, 2024 19:10
@Matejkob
Copy link
Contributor Author

I'm marking it as a draft since I want to make one more change before we land it. But before that let's end discusing the above topic.

@stephencelis
Copy link
Member

I think it makes sense, just curious about the thought process 😄 Let us know when it's ready and we'll merge!

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