Browse Source

Migrate to common GitHub Actions (#21)

Migrate CI to use swiftlang / SwiftNIO common GitHub Actions.

Motivation:

* Reduce duplication
* Centralise boilerplate changes when new Swift versions are picked up.
* Benefit from centralised work to add new linting / test
  infrastructure.

Modifications:

Changes of note:
* Use soundness checks from swiftlang/github-workflows.
* Retain bespoke license-checking code for .swift files as the gRPC
  header style is very different to most templates.
* Remove scripts which are no longer needed.
* Move scripts to `scripts/` directory in-line with most other Swift on
  Server repositories.

Result:

More test, linting, formatting coverage. More common CI with other Swift
on Server projects.
Rick Newton-Rogers 1 year ago
parent
commit
f9cb377100

+ 14 - 0
.github/release.yml

@@ -0,0 +1,14 @@
+changelog:
+  categories:
+    - title: SemVer Major
+      labels:
+        - ⚠️ semver/major
+    - title: SemVer Minor
+      labels:
+        - semver/minor
+    - title: SemVer Patch
+      labels:
+        - semver/patch
+    - title: Other Changes
+      labels:
+        - semver/none

+ 0 - 54
.github/workflows/ci.yaml

@@ -1,54 +0,0 @@
-name: CI
-on:
-  pull_request:
-    branches: [main]
-jobs:
-  preflight:
-    name: License Header and Formatting Checks
-    runs-on: ubuntu-latest
-    container:
-      image: swift:6.0-jammy
-    steps:
-    - name: "Checkout repository"
-      uses: actions/checkout@v4
-    - name: Mark the workspace as safe
-      run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
-    - name: "Formatting, License Headers, and Generated Code check"
-      run: |
-        ./dev/sanity.sh
-  unit-tests:
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-          - image: swiftlang/swift:nightly-jammy
-          - image: swift:6.0-jammy
-    name: Build and Test on ${{ matrix.image }}
-    runs-on: ubuntu-latest
-    container:
-      image: ${{ matrix.image }}
-    steps:
-    - uses: actions/checkout@v4
-    - name: 🔧 Build
-      run: swift build ${{ matrix.swift-build-flags }}
-      timeout-minutes: 20
-    - name: 🧪 Test
-      run: swift test ${{ matrix.swift-test-flags }}
-      timeout-minutes: 20
-  integration-tests:
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-          - image: swiftlang/swift:nightly-jammy
-          - image: swift:6.0-jammy
-    name: Run integration tests using ${{ matrix.image }}
-    runs-on: ubuntu-latest
-    container:
-      image: ${{ matrix.image }}
-    steps:
-    - uses: actions/checkout@v4
-    - name: Build performance tests
-      run: ./dev/build-performance-tests.sh
-    - name: Run interop tests
-      run: ./dev/run-interop-tests.sh

+ 28 - 0
.github/workflows/main.yml

@@ -0,0 +1,28 @@
+name: Main
+
+on:
+  push:
+    branches: [main]
+  schedule:
+    - cron: "0 8,20 * * *"
+
+jobs:
+  unit-tests:
+    name: Unit Tests
+    uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
+    with:
+      linux_5_9_enabled: false
+      linux_5_10_enabled: false
+      linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
+      linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
+      linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
+
+  integration-tests:
+    name: Integration Tests
+    # Workaround https://github.com/nektos/act/issues/1875
+    uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
+    with:
+      name: "Integration tests"
+      matrix_linux_5_9_enabled: false
+      matrix_linux_5_10_enabled: false
+      matrix_linux_command: "./dev/integration_tests.sh"

+ 53 - 0
.github/workflows/pull_request.yml

@@ -0,0 +1,53 @@
+name: PR
+
+on:
+  pull_request:
+    branches: [main]
+    types: [opened, reopened, synchronize]
+
+jobs:
+  soundness:
+    name: Soundness
+    uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
+    with:
+      license_header_check_project_name: "gRPC"
+
+  swift-license-check:
+    name: Swift License Header Check
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+        with:
+          persist-credentials: false
+      - name: Mark the workspace as safe
+        run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
+      - name: Run license check
+        run: |
+          ./dev/license-check.sh
+
+  unit-tests:
+    name: Unit Tests
+    uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
+    with:
+      linux_5_9_enabled: false
+      linux_5_10_enabled: false
+      linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
+      linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
+      linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
+
+  integration-tests:
+    name: Integration Tests
+    uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
+    with:
+      name: "Integration Tests"
+      matrix_linux_5_9_enabled: false
+      matrix_linux_5_10_enabled: false
+      matrix_linux_command: "./dev/integration_tests.sh"
+
+  cxx-interop:
+    name: Cxx Interop
+    uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
+    with:
+      linux_5_9_enabled: false
+      linux_5_10_enabled: false

+ 18 - 0
.github/workflows/pull_request_label.yml

@@ -0,0 +1,18 @@
+name: PR
+
+on:
+  pull_request:
+    types: [labeled, unlabeled, opened, reopened, synchronize]
+
+jobs:
+  semver-label-check:
+    name: Semantic Version Label Check
+    runs-on: ubuntu-latest
+    timeout-minutes: 1
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+        with:
+          persist-credentials: false
+      - name: Check for Semantic Version label
+        uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main

+ 13 - 0
.license_header_template

@@ -0,0 +1,13 @@
+@@ Copyright YEARS, gRPC Authors All rights reserved.
+@@
+@@ Licensed under the Apache License, Version 2.0 (the "License");
+@@ you may not use this file except in compliance with the License.
+@@ You may obtain a copy of the License at
+@@
+@@     http://www.apache.org/licenses/LICENSE-2.0
+@@
+@@ Unless required by applicable law or agreed to in writing, software
+@@ distributed under the License is distributed on an "AS IS" BASIS,
+@@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@@ See the License for the specific language governing permissions and
+@@ limitations under the License.

+ 41 - 0
.licenseignore

@@ -0,0 +1,41 @@
+.gitignore
+**/.gitignore
+.licenseignore
+.gitattributes
+.git-blame-ignore-revs
+.mailfilter
+.mailmap
+.spi.yml
+.swift-format
+.editorconfig
+.github/*
+*.md
+*.txt
+*.yml
+*.yaml
+*.json
+Package.swift
+**/Package.swift
+Package@-*.swift
+**/Package@-*.swift
+Package.resolved
+**/Package.resolved
+Makefile
+*.modulemap
+**/*.modulemap
+**/*.docc/*
+*.xcprivacy
+**/*.xcprivacy
+*.symlink
+**/*.symlink
+Dockerfile
+**/Dockerfile
+Snippets/*
+dev/git.commit.template
+dev/version-bump.commit.template
+.unacceptablelanguageignore
+IntegrationTests/grpc-performance-tests/Sources/Generated/*
+LICENSE
+**/*.swift
+Sources/CGRPCZlib/*
+dev/protos/**/*.proto

+ 3 - 3
Package.swift

@@ -66,7 +66,7 @@ let dependencies: [Package.Dependency] = [
 let defaultSwiftSettings: [SwiftSetting] = [
 let defaultSwiftSettings: [SwiftSetting] = [
   .swiftLanguageMode(.v6),
   .swiftLanguageMode(.v6),
   .enableUpcomingFeature("ExistentialAny"),
   .enableUpcomingFeature("ExistentialAny"),
-  .enableUpcomingFeature("InternalImportsByDefault")
+  .enableUpcomingFeature("InternalImportsByDefault"),
 ]
 ]
 
 
 let targets: [Target] = [
 let targets: [Target] = [
@@ -87,7 +87,7 @@ let targets: [Target] = [
       .product(name: "NIOCore", package: "swift-nio"),
       .product(name: "NIOCore", package: "swift-nio"),
       .product(name: "NIOHTTP2", package: "swift-nio-http2"),
       .product(name: "NIOHTTP2", package: "swift-nio-http2"),
       .product(name: "NIOExtras", package: "swift-nio-extras"),
       .product(name: "NIOExtras", package: "swift-nio-extras"),
-      .target(name: "CGRPCZlib")
+      .target(name: "CGRPCZlib"),
     ],
     ],
     swiftSettings: defaultSwiftSettings
     swiftSettings: defaultSwiftSettings
   ),
   ),
@@ -140,7 +140,7 @@ let targets: [Target] = [
       .product(name: "X509", package: "swift-certificates"),
       .product(name: "X509", package: "swift-certificates"),
       .product(name: "NIOSSL", package: "swift-nio-ssl"),
       .product(name: "NIOSSL", package: "swift-nio-ssl"),
     ]
     ]
-  )
+  ),
 ]
 ]
 
 
 let package = Package(
 let package = Package(

+ 1 - 1
Sources/GRPCNIOTransportCore/Client/Connection/ClientConnectionHandler.swift

@@ -47,7 +47,7 @@ package enum ClientConnectionEvent: Sendable {
 /// 2. Closing the connection if it is idle (has no open streams) for a configured amount of time.
 /// 2. Closing the connection if it is idle (has no open streams) for a configured amount of time.
 /// 3. Forwarding lifecycle events to the next handler.
 /// 3. Forwarding lifecycle events to the next handler.
 ///
 ///
-/// Some of the behaviours are described in [gRFC A8](https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md).
+/// Some of the behaviours are described in [gRFC A8](https://github.com/grpc/proposal/blob/0e1807a6e30a1a915c0dcadc873bca92b9fa9720/A8-client-side-keepalive.md).
 package final class ClientConnectionHandler: ChannelInboundHandler, ChannelOutboundHandler {
 package final class ClientConnectionHandler: ChannelInboundHandler, ChannelOutboundHandler {
   package typealias InboundIn = HTTP2Frame
   package typealias InboundIn = HTTP2Frame
   package typealias InboundOut = ClientConnectionEvent
   package typealias InboundOut = ClientConnectionEvent

+ 2 - 2
Sources/GRPCNIOTransportCore/Client/Connection/LoadBalancers/RoundRobinLoadBalancer.swift

@@ -529,7 +529,7 @@ extension RoundRobinLoadBalancer {
       mutating func updateState(_ newState: ConnectivityState) -> Bool {
       mutating func updateState(_ newState: ConnectivityState) -> Bool {
         // The transition from transient failure to connecting is ignored.
         // The transition from transient failure to connecting is ignored.
         //
         //
-        // See: https://github.com/grpc/grpc/blob/master/doc/load-balancing.md
+        // See: https://github.com/grpc/grpc/blob/7f664c69b2a636386fbf95c16bc78c559734ce0f/doc/load-balancing.md
         if case .transientFailure = self.state, newState == .connecting {
         if case .transientFailure = self.state, newState == .connecting {
           return false
           return false
         }
         }
@@ -733,7 +733,7 @@ extension RoundRobinLoadBalancer {
 
 
 extension ConnectivityState {
 extension ConnectivityState {
   static func aggregate(_ states: some Collection<ConnectivityState>) -> ConnectivityState {
   static func aggregate(_ states: some Collection<ConnectivityState>) -> ConnectivityState {
-    // See https://github.com/grpc/grpc/blob/master/doc/load-balancing.md
+    // See https://github.com/grpc/grpc/blob/7f664c69b2a636386fbf95c16bc78c559734ce0f/doc/load-balancing.md
 
 
     // If any one subchannel is in READY state, the channel's state is READY.
     // If any one subchannel is in READY state, the channel's state is READY.
     if states.contains(where: { $0 == .ready }) {
     if states.contains(where: { $0 == .ready }) {

+ 3 - 3
Sources/GRPCNIOTransportCore/GRPCStreamStateMachine.swift

@@ -638,7 +638,7 @@ extension GRPCStreamStateMachine {
     headers.reserveCapacity(7 + customMetadata.count)
     headers.reserveCapacity(7 + customMetadata.count)
 
 
     // Add required headers.
     // Add required headers.
-    // See https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests
+    // See https://github.com/grpc/grpc/blob/7f664c69b2a636386fbf95c16bc78c559734ce0f/doc/PROTOCOL-HTTP2.md#requests
 
 
     // The order is important here: reserved HTTP2 headers (those starting with `:`)
     // The order is important here: reserved HTTP2 headers (those starting with `:`)
     // must come before all other headers.
     // must come before all other headers.
@@ -851,7 +851,7 @@ extension GRPCStreamStateMachine {
       if (100 ... 199).contains(httpStatusCode.code) {
       if (100 ... 199).contains(httpStatusCode.code) {
         // For 1xx status codes, the entire header should be skipped and a
         // For 1xx status codes, the entire header should be skipped and a
         // subsequent header should be read.
         // subsequent header should be read.
-        // See https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md
+        // See https://github.com/grpc/grpc/blob/7f664c69b2a636386fbf95c16bc78c559734ce0f/doc/http-grpc-status-mapping.md
         return .invalid(.doNothing)
         return .invalid(.doNothing)
       }
       }
 
 
@@ -1868,7 +1868,7 @@ extension Metadata {
 }
 }
 
 
 extension Status.Code {
 extension Status.Code {
-  // See https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md
+  // See https://github.com/grpc/grpc/blob/7f664c69b2a636386fbf95c16bc78c559734ce0f/doc/http-grpc-status-mapping.md
   init(httpStatusCode: HTTPResponseStatus) {
   init(httpStatusCode: HTTPResponseStatus) {
     switch httpStatusCode {
     switch httpStatusCode {
     case .badRequest:
     case .badRequest:

+ 1 - 1
Sources/GRPCNIOTransportCore/Internal/ContentType.swift

@@ -15,7 +15,7 @@
  */
  */
 
 
 // See:
 // See:
-// - https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
+// - https://github.com/grpc/grpc/blob/7f664c69b2a636386fbf95c16bc78c559734ce0f/doc/PROTOCOL-HTTP2.md
 enum ContentType {
 enum ContentType {
   case grpc
   case grpc
 
 

+ 1 - 1
Sources/GRPCNIOTransportCore/Internal/GRPCStatusMessageMarshaller.swift

@@ -56,7 +56,7 @@ extension GRPCStatusMessageMarshaller {
 
 
     for char in message.utf8 {
     for char in message.utf8 {
       switch char {
       switch char {
-      // See: https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#responses
+      // See: https://github.com/grpc/grpc/blob/7f664c69b2a636386fbf95c16bc78c559734ce0f/doc/PROTOCOL-HTTP2.md#responses
       case 0x20 ... 0x24,
       case 0x20 ... 0x24,
         0x26 ... 0x7E:
         0x26 ... 0x7E:
         bytes.append(char)
         bytes.append(char)

+ 1 - 1
Sources/GRPCNIOTransportCore/Server/CommonHTTP2ServerTransport.swift

@@ -235,7 +235,7 @@ package final class CommonHTTP2ServerTransport<
     // - If we get an error because the http2Stream failed to close, then there's nothing we can do
     // - If we get an error because the http2Stream failed to close, then there's nothing we can do
     // - If we get an error because the inner closure threw, then the only possible scenario in which
     // - If we get an error because the inner closure threw, then the only possible scenario in which
     // that could happen is if methodDescriptor.get() throws - in which case, it means we never got
     // that could happen is if methodDescriptor.get() throws - in which case, it means we never got
-    // the RPC metadata, which means we can't do anything either and it's okay to just kill the stream.
+    // the RPC metadata, which means we can't do anything either and it's okay to just close the stream.
     try? await stream.executeThenClose { inbound, outbound in
     try? await stream.executeThenClose { inbound, outbound in
       guard let descriptor = try? await descriptor.get() else {
       guard let descriptor = try? await descriptor.get() else {
         return
         return

+ 1 - 1
Sources/GRPCNIOTransportCore/Server/Connection/ServerConnectionManagementHandler+StateMachine.swift

@@ -333,7 +333,7 @@ extension ServerConnectionManagementHandler.StateMachine {
         // If there are no open streams and keep alive pings aren't allowed without calls then
         // If there are no open streams and keep alive pings aren't allowed without calls then
         // use an interval of two hours.
         // use an interval of two hours.
         //
         //
-        // This comes from gRFC A8: https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md
+        // This comes from gRFC A8: https://github.com/grpc/proposal/blob/0e1807a6e30a1a915c0dcadc873bca92b9fa9720/A8-client-side-keepalive.md
         interval = .hours(2)
         interval = .hours(2)
       }
       }
 
 

+ 2 - 2
Sources/GRPCNIOTransportCore/Server/Connection/ServerConnectionManagementHandler.swift

@@ -37,8 +37,8 @@ private import NIOTLS
 ///    too many pings.
 ///    too many pings.
 ///
 ///
 /// Some of the behaviours are described in:
 /// Some of the behaviours are described in:
-/// - [gRFC A8](https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md), and
-/// - [gRFC A9](https://github.com/grpc/proposal/blob/master/A9-server-side-conn-mgt.md).
+/// - [gRFC A8](https://github.com/grpc/proposal/blob/0e1807a6e30a1a915c0dcadc873bca92b9fa9720/A8-client-side-keepalive.md), and
+/// - [gRFC A9](https://github.com/grpc/proposal/blob/0e1807a6e30a1a915c0dcadc873bca92b9fa9720/A9-server-side-conn-mgt.md).
 package final class ServerConnectionManagementHandler: ChannelDuplexHandler {
 package final class ServerConnectionManagementHandler: ChannelDuplexHandler {
   package typealias InboundIn = HTTP2Frame
   package typealias InboundIn = HTTP2Frame
   package typealias InboundOut = HTTP2Frame
   package typealias InboundOut = HTTP2Frame

+ 1 - 1
Tests/GRPCNIOTransportHTTP2Tests/HTTP2TransportTests.swift

@@ -1274,7 +1274,7 @@ final class HTTP2TransportTests: XCTestCase {
   }
   }
 
 
   private static let httpToStatusCodePairs: [(Int, RPCError.Code)] = [
   private static let httpToStatusCodePairs: [(Int, RPCError.Code)] = [
-    // See https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md
+    // See https://github.com/grpc/grpc/blob/7f664c69b2a636386fbf95c16bc78c559734ce0f/doc/http-grpc-status-mapping.md
     (400, .internalError),
     (400, .internalError),
     (401, .unauthenticated),
     (401, .unauthenticated),
     (403, .permissionDenied),
     (403, .permissionDenied),

+ 13 - 14
dev/build-performance-tests.sh

@@ -1,18 +1,17 @@
 #!/bin/bash
 #!/bin/bash
-
-# Copyright 2024, gRPC Authors All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+## Copyright 2024, gRPC Authors All rights reserved.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+##     http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
 
 
 set -euo pipefail
 set -euo pipefail
 
 

+ 14 - 16
dev/format.sh

@@ -1,18 +1,17 @@
 #!/bin/bash
 #!/bin/bash
-
-# Copyright 2020, gRPC Authors All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+## Copyright 2020, gRPC Authors All rights reserved.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+##     http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
 
 
 set -eu
 set -eu
 
 
@@ -69,8 +68,7 @@ if "$lint"; then
     To fix, run the following command:
     To fix, run the following command:
 
 
     % $THIS_SCRIPT -f
     % $THIS_SCRIPT -f
-    "
-    exit "${SWIFT_FORMAT_RC}"
+    " "${SWIFT_FORMAT_RC}"
   fi
   fi
 
 
   log "Ran swift format lint with no errors."
   log "Ran swift format lint with no errors."

+ 24 - 0
dev/integration_tests.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+## Copyright 2024, gRPC Authors All rights reserved.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+##     http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+
+set -euo pipefail
+
+here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+echo "Build performance tests"
+eval "$here/build-performance-tests.sh"
+
+echo "Run interop tests"
+eval "$here/run-interop-tests.sh"

+ 15 - 20
dev/license-check.sh

@@ -1,18 +1,17 @@
 #!/bin/bash
 #!/bin/bash
-
-# Copyright 2019, gRPC Authors All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+## Copyright 2019, gRPC Authors All rights reserved.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+##     http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
 
 
 # This script checks the copyright headers in source *.swift source files and
 # This script checks the copyright headers in source *.swift source files and
 # exits if they do not match the expected header. The year, or year range in
 # exits if they do not match the expected header. The year, or year range in
@@ -38,10 +37,6 @@ read -r -d '' COPYRIGHT_HEADER_SWIFT << 'EOF'
 EOF
 EOF
 SWIFT_SHA=$(echo "$COPYRIGHT_HEADER_SWIFT" | shasum | awk '{print $1}')
 SWIFT_SHA=$(echo "$COPYRIGHT_HEADER_SWIFT" | shasum | awk '{print $1}')
 
 
-replace_years() {
-  sed -e 's/201[56789]-20[12][0-9]/YEARS/' -e 's/201[56789]/YEARS/'
-}
-
 # Checks the Copyright headers for *.swift files in this repository against the
 # Checks the Copyright headers for *.swift files in this repository against the
 # expected headers.
 # expected headers.
 #
 #
@@ -74,12 +69,12 @@ check_copyright_headers() {
         drop_first=1
         drop_first=1
         expected_lines=15
         expected_lines=15
         ;;
         ;;
-      */Package@swift-*.swift)
+      */Package@swift-*.*.swift)
         expected_sha="$SWIFT_SHA"
         expected_sha="$SWIFT_SHA"
         drop_first=1
         drop_first=1
         expected_lines=15
         expected_lines=15
         ;;
         ;;
-      */Package@swift-*.*.swift)
+      */Package@swift-*.swift)
         expected_sha="$SWIFT_SHA"
         expected_sha="$SWIFT_SHA"
         drop_first=1
         drop_first=1
         expected_lines=15
         expected_lines=15

+ 13 - 14
dev/protos/fetch.sh

@@ -1,18 +1,17 @@
 #!/bin/bash
 #!/bin/bash
-#
-# Copyright 2024, gRPC Authors All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+## Copyright 2024, gRPC Authors All rights reserved.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+##     http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
 
 
 set -eu
 set -eu
 
 

+ 13 - 14
dev/protos/generate.sh

@@ -1,18 +1,17 @@
 #!/bin/bash
 #!/bin/bash
-#
-# Copyright 2024, gRPC Authors All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+## Copyright 2024, gRPC Authors All rights reserved.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+##     http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
 
 
 set -eu
 set -eu
 
 

+ 15 - 16
dev/run-interop-tests.sh

@@ -1,18 +1,17 @@
 #!/bin/bash
 #!/bin/bash
-
-# Copyright 2024, gRPC Authors All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+## Copyright 2024, gRPC Authors All rights reserved.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+##     http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
 
 
 set -euo pipefail
 set -euo pipefail
 
 
@@ -56,7 +55,7 @@ bound_port=$(grep -o "$pattern" < "$server_output_file" | grep -o '[0-9]*$')
 
 
 if [[ -z "$bound_port" ]]; then
 if [[ -z "$bound_port" ]]; then
   error "Failed to get the bound port."
   error "Failed to get the bound port."
-  kill $server_pid
+  kill $server_pid # ignore-unacceptable-language
   exit 1
   exit 1
 else
 else
   log "Started server on $host:$bound_port"
   log "Started server on $host:$bound_port"
@@ -91,7 +90,7 @@ done
 
 
 # Stop the server
 # Stop the server
 log "Stopping the server..."
 log "Stopping the server..."
-kill $server_pid
+kill $server_pid # ignore-unacceptable-language
 
 
 if [[ $failed_tests -gt 0 ]]; then
 if [[ $failed_tests -gt 0 ]]; then
   error "$failed_tests tests failed."
   error "$failed_tests tests failed."

+ 0 - 51
dev/sanity.sh

@@ -1,51 +0,0 @@
-#!/bin/bash
-
-# Copyright 2020, gRPC Authors All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -eu
-
-here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-function run_logged() {
-  local message=$1
-  local command=$2
-
-  log=$(mktemp)
-
-  printf '==> %s ... ' "$message"
-
-  if $command > "$log" 2>&1; then
-    printf "\033[0;32mOK\033[0m\n"
-  else
-    errors=$(( errors + 1))
-    printf "\033[0;31mFAILED\033[0m\n"
-    echo "=== Captured output:"
-    cat "$log"
-    echo "==="
-  fi
-}
-
-function check_license_headers() {
-  run_logged "Checking license headers" "$here/license-check.sh"
-}
-
-function check_formatting() {
-  run_logged "Checking formatting" "$here/format.sh -l"
-}
-
-errors=0
-check_license_headers
-check_formatting
-exit $errors