Skip to content

Commit

Permalink
Update repository docs for swift-version support and recent CI check …
Browse files Browse the repository at this point in the history
…changes (#2815)

Make sure repository docs represent the current status quo

Motivation:

Some parts of the docs were out of date and confusing/wrong.

Modifications:

Made references to supported versions appropriate for the current mainline version supported (5.10) and the retained support for 5.9 and 5.8.
In addition made that operating mode an explicit statement of commitment, along with the use of nightlies of pre release versions..

Now that more checks are present as GitHub Actions they are easier for users to run directly with act, so provided some links and one liners to do that.

The old references to swift-format were no longer hopeful, they became true!

Added myself as a committer at the same time

Result:

Docs should be more accurate and helpful. Intent of the matrix for support should be clearer
  • Loading branch information
UncleMattHope authored Aug 1, 2024
1 parent f045108 commit ba62457
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
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, but a project maintainer must kick it off for you. Currently all versions of Swift >= 5.8 are supported.

If you wish to test this locally you have two options [act](https://github.com/nektos/act) and Docker Compose files.

#### Act

[Install act](https://nektosact.com/installation/) and then you can run the full suite of checks via:
```
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

We commit to support the most recently released swift version (currently 5.10) and the last two minor releases before that unless this is impossible to do in one codebase.
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

0 comments on commit ba62457

Please sign in to comment.