Skip to content

Support cross-PR testing for Swift packages #52

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Oct 29, 2024

Depends on #49.


This allows Swift Packages to be tested in combination with PRs updating their dependencies. To reference a linked PR, Linked PR: <link to PR> needs to be added to the PR description, eg:

Linked PR: https://github.com/swiftlang/swift-syntax/pull/2859

Example run: https://github.com/swiftlang/swift-format/actions/runs/11564842847/job/32193164363

@ahoppen ahoppen requested a review from a team as a code owner October 29, 2024 02:08
@ahoppen ahoppen force-pushed the cross-pr-testing branch 5 times, most recently from ab590ce to bd3f008 Compare October 29, 2024 02:35
Copy link
Member

@FranzBusch FranzBusch left a comment

Choose a reason for hiding this comment

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

Looks good in general to me. What is the expectation post merge of a PR that has linked PRs. Couldn't it be that the linked PRs haven't been merged or that deps haven't been updated and main becomes unstable?

@ahoppen
Copy link
Member Author

ahoppen commented Oct 29, 2024

Yes, you will need to merge your dependency PRs before the PR itself. Otherwise the post-merge check will fail but will recover once the dependencies have been updated. I don’t really think there is any way around that.

@FranzBusch
Copy link
Member

Instead of doing this in the regular checks that are triggered on the PR events we could make this triggered by leaving a comment on the PR.
This way you can trigger it manually and get feedback if it works. Then merge the PRs in your deps. Once they are merged you can run the normal PR checks.
Would that work?

@ahoppen
Copy link
Member Author

ahoppen commented Oct 29, 2024

Instead of doing this in the regular checks that are triggered on the PR events we could make this triggered by leaving a comment on the PR.
This way you can trigger it manually and get feedback if it works. Then merge the PRs in your deps. Once they are merged you can run the normal PR checks.
Would that work?

No, that doesn’t work. swiftlang/swift-syntax#2859, for example, introduces a breaking swift-syntax change that needs a corresponding update in swift-format, since swift-format is also in the toolchain (in this case, that changes is done by swiftlang/swift-format#866). Thus, we need to be able to get both the swift-syntax and the swift-format PR into a green CI state at the same time so that the Merge pull request button can be hit on both of them at (roughly) the same time. This is how cross-PR testing works in then Jenkins-based Swift CI for toolchain repos at the moment (https://github.com/swiftlang/swift/blob/main/docs/ContinuousIntegration.md#cross-repository-testing).

This allows Swift Packages to be tested in combination with PRs updating their dependencies. To reference a linked PR, `Linked PR: <link to PR>` needs to be added to the PR description, eg:

```
Linked PR: swiftlang/swift-syntax#2859
```
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