Commit Graph
131 Commits
Author SHA1 Message Date
Guoye Zhang 45eb022491 Stop using Foundation on platforms with FoundationEssentials (#108)
Resolves #107
1.5.1
2025-10-21 08:44:07 -07:00
Melissa Kilby 9410f6b9a3 chore: restrict GitHub workflow permissions - future-proof (#106)
See https://github.com/swiftlang/github-workflows/issues/167 for
additional context

This approach aligns with security best practices, as detailed in the
following documentation:

-
https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
-
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#defining-access-for-the-github_token-scopes
-
https://openssf.org/blog/2024/08/12/mitigating-attack-vectors-in-github-workflows/


The default GITHUB_TOKEN permissions are defined at the repository
level. This PR modifies the workflow-level overrides to conform to
OpenSSF best practices -> defense in depth.

Allow me to quote OpenSSF:

https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

> The highest score is awarded when the permissions definitions in each
workflow's yaml file are set as read-only at the top level and the
required write permissions are declared at the run-level.”

> Remediation steps
> - Set top-level permissions as read-all or contents: read as described
in GitHub's documentation.
> - Set any required write permissions at the job-level. Only set the
permissions required for that job; do not set permissions: write-all at
the job level.


Compare to the LLVM project:

Top-level: contents read, e.g.
https://github.com/swiftlang/llvm-project/blob/next/.github/workflows/build-ci-container-windows.yml#L3-L4
-> this makes it future-proof

Job-level: Allow write permissions as needed, e.g.
https://github.com/swiftlang/llvm-project/blob/next/.github/workflows/build-ci-container-windows.yml#L53-L58

Signed-off-by: Melissa Kilby <mkilby@apple.com>
1.5.0
2025-10-17 17:50:38 -07:00
Guoye Zhang 3acdb1c8e8 Move HTTPRequest.url to the main library (#79)
Resolves #76
2025-10-17 07:51:03 +01:00
Guoye ZhangandCory Benfield 9c9d5ea7e3 Convert WebSocket URLRequest to RFC8441 HTTPRequest (#92)
WebSocket uses the extended-CONNECT form in HTTP/2 and HTTP/3. When
creating an HTTPRequest from a URLRequest, we should translate it into
the new form.

`:method`: `GET` -> `CONNECT`
`:scheme`: `wss`/`ws` -> `https`/`http`
`:protocol`: `websocket`

HTTPTypes defaults to modern HTTP versions, and the expectation is that
the HTTP/1 serializer has to translate the extended-CONNECT request back
to the old request form.

---------

Co-authored-by: Cory Benfield <lukasa@apple.com>
2025-10-05 11:13:17 -07:00
Rick Newton-Rogers 4366cd1e64 Enable Swift 6.2 jobs in CI (#105)
Motivation:

Swift 6.2 has been released, we should add it to our CI coverage.

Modifications:

Add additional Swift 6.2 jobs where appropriate in main.yml,
pull_request.yml

Result:

Improved test coverage.
2025-10-01 16:23:41 +01:00
Guoye Zhang 97c96755ae Add QUERY method (internal only) (#103) 2025-09-20 00:46:58 -07:00
Raphael b00139f252 Enable release mode builds (#102)
### Motivation:

Some errors do not show up in debug builds. Enabling release mode builds
improves the CI coverage.

### Modifications:

Enable release mode builds for pull requests and scheduled builds on
main.

### Result:

Improved CI coverage.
2025-07-30 08:50:56 +01:00
Rick Newton-RogersandGeorge Barnett 3faa71f2b7 Enable Swift 6.1 jobs in CI (#99)
Motivation:

Swift 6.1 has been released, we should add it to our CI coverage.

Modifications:

Add additional Swift 6.1 jobs where appropriate in main.yml,
pull_request.yml

Result:

Improved test coverage.

Co-authored-by: George Barnett <gbarnett@apple.com>
2025-04-14 12:50:08 +01:00
Rick Newton-Rogers 4d7c10f344 add thresholds for Swift 6.1 from 6.0 thresholds (#100) 2025-04-14 12:16:08 +01:00
Rick Newton-Rogers a0a57e949a Enable macOS CI on pull requests (#97)
Motivation:

* Improve test coverage

Modifications:

Enable macOS CI to be run on pull request commits and make the use of
the nightly runner pool for main.yml jobs explicit.

Result:

Improved test coverage.
1.4.0
2025-04-01 07:23:38 -07:00
Rick Newton-Rogers 493e43a702 Enable macOS CI on merge to main and daily timer (#96)
Motivation:

* Improve test coverage
* Check test pass/fail status
* Monitor CI throughput

Modifications:

Enable macOS CI to be run on all merges to main and on a daily timer.

Result:

Improved test coverage run out-of-band at the moment so we can get a
feeling for if any changes need to be made in the repo or in the CI
pipelines to ensure timely and stable checks.
2025-03-28 14:53:30 +00:00
Rick Newton-Rogers 05dc8d9a36 Add static SDK CI workflow (#95)
Add static SDK CI workflow which runs on commits to PRs, merges to main
and daily on main.
2025-03-13 11:08:12 +00:00
Rick Newton-Rogers 66ab3c568c Only apply standard swift settings on valid targets (#93)
Only apply standard swift settings on valid targets. The current check
ignores plugins but that is not comprehensive enough.
2025-03-07 06:29:37 -08:00
Rick Newton-Rogers 5d11d38230 Rename nightly_6_1 params to nightly_next (#91)
Rename nightly_6_1 params to nightly_next; see
https://github.com/apple/swift-nio/pull/3122
2025-03-03 15:26:53 +00:00
Guoye Zhang e8011a7bc3 PseudoHeaderFields adopting CoW to reduce size (#88)
HTTPRequest size 288 -> 16
HTTPResponse size 80 -> 16

rdar://144520456
2025-02-21 17:30:57 -08:00
Guoye Zhang 4bd2f8104f Eliminate hasPrefix usage for pseudo HTTP header names (#87)
UTF8 view is faster than hasPrefix

rdar://144395951
2025-02-15 18:14:25 -08:00
Rick Newton-Rogers 99d1c41bac CI use 6.1 nightlies (#85)
CI use 6.1 nightlies now that Swift development is happening in the 6.1
branch
2025-01-31 10:01:03 +00:00
Guoye Zhang 40ca463b5f Request.url should return nil for situations where it is not applicable (#84)
Regular CONNECT requests and OPTIONS * requests do not have URLs
2025-01-29 07:10:41 +00:00
Guoye Zhang 74191f0834 Update benchmark threshold to Swift 6.1 (#83) 2025-01-25 11:57:02 -08:00
Clinton Nkwocha 8e01d32d18 Enable strict concurrency (#82)
Motivation:

To catch potential data races at build time.

Modifications:

- Enable strict concurrency in Package.swift.
- Update CI flags.

Result:

Strict concurrency adoption.
2025-01-13 16:33:22 +00:00
Franz Busch baf704f113 Update release.yml (#80)
Update the release.yml file with the latest label changes
2024-12-18 14:04:37 +00:00
Rick Newton-Rogers d57e30afe0 Enable MemberImportVisibility check on all targets (#78)
* Update swift tools version to 5.9
* Enable MemberImportVisibility check on all targets. Use a standard
string header and footer to bracket the new block for ease of updating
in the future with scripts.
2024-12-11 11:00:56 +00:00
Franz Busch 9490f89447 Merge pull request #75 from FranzBusch/align-semantic-version-check
Aligning semantic version label check name
2024-11-28 12:58:56 +01:00
Franz Busch d797509cc6 Aligning semantic version label check name 2024-11-28 12:04:42 +01:00
Guoye Zhang 9f7a43fb24 Merge pull request #73 from rnro/add_editorconfig
add .editorconfig file
2024-11-15 14:07:26 +00:00
Rick Newton-Rogers ac909c1e99 add .editorconfig file 2024-11-14 13:33:27 +00:00
Guoye Zhang ef18d829e8 Merge pull request #72 from guoye-zhang/internal
Remove usable from inline and internal properties
1.3.1
2024-11-13 15:35:29 +00:00
Guoye Zhang 51e4fd888f Remove usable from inline and internal properties 2024-11-13 13:27:04 +00:00
Guoye Zhang 7e038be7ae Merge pull request #70 from guoye-zhang/mutex
Adopt Mutex where available
2024-11-13 11:18:48 +00:00
Guoye Zhang e44a816927 Merge branch 'main' into mutex 2024-11-13 10:48:36 +00:00
Guoye Zhang 4f278a0895 Merge pull request #71 from guoye-zhang/windows
Support building without CoreFoundation on Windows
2024-11-13 10:41:37 +00:00
Guoye Zhang 32a95f29c1 Check the compiler version instead 2024-10-28 18:34:49 -07:00
Guoye Zhang 06a234b69b Update baseline 2024-10-28 18:00:33 -07:00
Guoye Zhang 74e4995e39 Support building without CoreFoundation on Windows 2024-10-28 17:16:02 -07:00
Guoye Zhang c82e4078cd Adopt Mutex where available 2024-10-28 14:26:36 -07:00
Franz Busch 46dd772e85 Merge pull request #68 from FranzBusch/fb-gha-fix
[CI] Make all CI checks green
2024-10-28 11:44:06 +01:00
Franz Busch 5eeef940dd Fix checks 2024-10-28 11:13:19 +01:00
Franz Busch 95045b96be Revert "Change compiler checks"
This reverts commit 310e8eaf92.
2024-10-25 10:51:29 +02:00
Franz Busch 700f1999c0 Enable Windows 2024-10-24 22:31:48 +02:00
Franz Busch 310e8eaf92 Change compiler checks 2024-10-24 22:30:18 +02:00
Franz Busch f3d9ec3eef [CI] Make all CI checks green
# Motivation

We just adopted GH actions and want to make sure all the CI checks are green.

# Modification

This PR makes the necessary changes to pass all checks. Including:

- Adding a licenseignore file
- Moving `swift-format` and adopting the config that we use in all other swift on server repos.

# Result

Green CI.
2024-10-24 22:30:18 +02:00
Guoye Zhang 70cda1b770 Merge pull request #69 from guoye-zhang/lock
Adopt NIOLock for more platform support
2024-10-24 13:19:25 -07:00
Guoye Zhang 4ba4e72b06 Remove the public class 2024-10-23 12:21:05 -07:00
Guoye Zhang 6b3c3a26b7 Adopt NIOLock 2024-10-23 11:26:17 -07:00
Guoye Zhang f9a647bdfd Merge pull request #66 from FranzBusch/fb-gha
[CI] Migrate to GitHub actions
2024-10-22 07:22:27 -07:00
Franz Busch 4f9ee4f272 [CI] Migrate to GitHub actions
# Motivation

We want to adopt GitHub actions in all of our Swift repositories to replace our current Jenkins CI.

# Modification

This PR adopts the reusable workflows from NIO and the swiftlang organization to ensure soundness and test coverage. Additionally, this PR enables a sematic label check and adds a `release.yml` to make releasing this package easy.

# Result

Modern CI and release flow.
2024-10-22 11:47:27 +02:00
Guoye Zhang ae67c8178e Merge pull request #59 from guoye-zhang/contributors
Update CONTRIBUTORS
1.3.0
2024-07-16 17:14:23 -07:00
Guoye Zhang 511d828079 Update CONTRIBUTORS 2024-07-16 17:10:23 -07:00
Guoye Zhang c30771e408 Merge pull request #58 from zunda-pixel/fix-swift-6
support URLSession concurrency method in Swift 6(Linux, Windows)
2024-07-16 17:06:57 -07:00
zunda ae224e4bd2 add newline 2024-07-17 09:04:00 +09:00