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

Update repository docs for swift-version support and recent CI check changes #2815

Merged
merged 12 commits into from
Aug 1, 2024
26 changes: 24 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,21 @@ The default policy for taking contributions is “Squash and Merge” - because

### Make sure your patch works for all supported versions of swift

The CI will do this for you. You can use the docker-compose files included if you wish to check locally. Currently all versions of swift >= 5.7 are supported. For example usage of docker compose see the main [README](./README.md#an-alternative-using-docker-compose)
The CI will do this for you. Currently all versions of Swift >= 5.8 are supported.
UncleMattHope marked this conversation as resolved.
Show resolved Hide resolved

If you wish to test this locally you have two options [act](https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://github.com/nektos/act) and Docker Compose files.
UncleMattHope marked this conversation as resolved.
Show resolved Hide resolved

#### Act

[Install act](https://nektosact.com) and then you can run the full suite of checks via:
UncleMattHope marked this conversation as resolved.
Show resolved Hide resolved
```
act pull_request
```
Note that SwiftNIO matrix testing makes use of nightly builds, so you may want to make use of the ```--action-offline-mode``` to avoid repulling those.

#### Docker Compose files

You can use the docker-compose files. For example usage of Docker Compose see the main [README](./README.md#an-alternative-using-docker-compose)

### Make sure your code is performant

Expand All @@ -77,7 +91,15 @@ SwiftNIO has been created to be high performance. The integration tests cover s

Try to keep your lines less than 120 characters long so github can correctly display your changes.

It is intended SwiftNIO will use the swift-format tool in the future to bring consistency to code formatting. To follow the discussion on this topic see the swift evolution proposal [SE-250](https://github.com/apple/swift-evolution/blob/main/proposals/0250-swift-style-guide-and-formatter.md)
SwiftNIO uses the [swift-format](https://github.com/swiftlang/swift-format) tool to bring consistency to code formatting. There is a specific [.swift-format](./.swift-format) configuration file. This will be checked and enforced on PRs. Note that the check will run on the current most recent stable version target which may not match that in your own local development environment.

If you want to apply the formatting to your local repo before you commit then you can either run [check-swift-format.sh](./scripts/check-swift-format.sh) which will use your current toolchain, or to match the CI checks exactly you can use `act` (see [act section](#act)):
```
act --action-offline-mode --bind workflow_call -j format-check --input format_check_enabled=true
```

This will run the format checks, binding to your local checkout so the edits made are to your own source.


### Extensibility

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ needs to be listed here.
- Markus Kieselmann <[email protected]>
- Marli Oshlack <[email protected]>
- Matt Eaton <[email protected]>
- Matt Hope <[email protected]>
- Matteo Comisso <[email protected]>
- Max Desiatov <[email protected]>
- Max Desiatov <[email protected]>
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ Redis | ✅ | ❌ | [swift-server/RediStack](https://github.com/swift-server/Red

This is the current version of SwiftNIO and will be supported for the foreseeable future.

The most recent versions of SwiftNIO support Swift 5.7 and newer. The minimum Swift version supported by SwiftNIO releases are detailed below:
### Swift Versions

The intention is to support the most recently released swift version (currently 5.10) and the last two minor releases before that.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should punch this up a bit more. It's not our intention, it's our commitment, unless we find ourselves in a place where this simply is not possible. Let's be a bit more forceful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fine with me, will add 👊

In addition checks are run against the latest beta release (if any) as well as the nightly swift builds and the intent is that these should pass.

The most recent versions of SwiftNIO support Swift 5.8 and newer. The minimum Swift version supported by SwiftNIO releases are detailed below:

SwiftNIO | Minimum Swift Version
--------------------|----------------------
Expand Down Expand Up @@ -106,7 +111,6 @@ In SwiftPM that can be easily done specifying for example `from: "2.0.0"` meanin
SemVer and SwiftNIO's Public API guarantees should result in a working program without having to worry about testing every single version for compatibility.



## Conceptual Overview

SwiftNIO is fundamentally a low-level tool for building high-performance networking applications in Swift. It particularly targets those use-cases where using a "thread-per-connection" model of concurrency is inefficient or untenable. This is a common limitation when building servers that use a large number of relatively low-utilization connections, such as HTTP servers.
Expand Down