Skip to content

CI use 6.1 nightlies, enable more soundness #185

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

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ jobs:
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
34 changes: 21 additions & 13 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ jobs:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
linux_pre_build_command: "apt-get update -y -q && apt-get install -y -q libsasl2-dev"
license_header_check_project_name: "swift-kafka-client"
api_breakage_check_enabled: false # requires libsasl2-dev
docs_check_enabled: false # requires libsasl2-dev

unit-tests:
name: Unit tests
Expand All @@ -20,20 +19,29 @@ jobs:
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"

construct-cxx-matrix:
name: Construct Cxx interop matrix
runs-on: ubuntu-latest
outputs:
cxx-interop-matrix: '${{ steps.generate-matrix.outputs.cxx-interop-matrix }}'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- id: generate-matrix
run: echo "cxx-interop-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
env:
MATRIX_LINUX_COMMAND: "curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-cxx-interop-compatibility.sh | bash"
MATRIX_LINUX_SETUP_COMMAND: "apt-get update -y -q && apt-get install -y -q curl jq libsasl2-dev"

cxx-interop:
name: Cxx interop
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
needs: construct-cxx-matrix
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
with:
name: "Cxx interop"
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q jq && apt-get -y install libsasl2-dev && curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-cxx-interop-compatibility.sh | bash"
matrix_linux_5_9_enabled: true
matrix_linux_5_10_enabled: true
matrix_linux_6_0_enabled: true
matrix_linux_nightly_6_0_enabled: true
matrix_linux_nightly_main_enabled: true
matrix_windows_6_0_enabled: false
matrix_windows_nightly_6_0_enabled: false
matrix_windows_nightly_main_enabled: false
matrix_string: '${{ needs.construct-cxx-matrix.outputs.cxx-interop-matrix }}'
18 changes: 9 additions & 9 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ on:
type: string
description: "The arguments passed to swift test in the Linux 6.0 Swift version matrix job."
default: ""
linux_nightly_6_0_enabled:
linux_nightly_6_1_enabled:
type: boolean
description: "Boolean to enable the Linux nightly 6.0 Swift version matrix job. Defaults to true."
description: "Boolean to enable the Linux nightly 6.1 Swift version matrix job. Defaults to true."
default: true
linux_nightly_6_0_arguments_override:
linux_nightly_6_1_arguments_override:
type: string
description: "The arguments passed to swift test in the Linux nightly 6.0 Swift version matrix job."
description: "The arguments passed to swift test in the Linux nightly 6.1 Swift version matrix job."
default: ""
linux_nightly_main_enabled:
type: boolean
Expand All @@ -46,7 +46,7 @@ on:

jobs:
unit-tests:
name: Unit tests
name: Unit tests (${{ matrix.swift.swift_version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -62,9 +62,9 @@ jobs:
- image: "swift:6.0-jammy"
swift_version: "6.0"
enabled: ${{ inputs.linux_6_0_enabled }}
- image: "swiftlang/swift:nightly-6.0-jammy"
swift_version: "nightly-6.0"
enabled: ${{ inputs.linux_nightly_6_0_enabled }}
- image: "swiftlang/swift:nightly-6.1-jammy"
swift_version: "nightly-6.1"
enabled: ${{ inputs.linux_nightly_6_1_enabled }}
- image: "swiftlang/swift:nightly-main-jammy"
swift_version: "nightly-main"
enabled: ${{ inputs.linux_nightly_main_enabled }}
Expand All @@ -87,7 +87,7 @@ jobs:
COMMAND_OVERRIDE_5_9: "swift test ${{ inputs.linux_5_9_arguments_override }}"
COMMAND_OVERRIDE_5_10: "swift test ${{ inputs.linux_5_10_arguments_override }}"
COMMAND_OVERRIDE_6_0: "swift test ${{ inputs.linux_6_0_arguments_override }}"
COMMAND_OVERRIDE_NIGHTLY_6_0: "swift test ${{ inputs.linux_nightly_6_0_arguments_override }}"
COMMAND_OVERRIDE_NIGHTLY_6_1: "swift test ${{ inputs.linux_nightly_6_1_arguments_override }}"
COMMAND_OVERRIDE_NIGHTLY_MAIN: "swift test ${{ inputs.linux_nightly_main_arguments_override }}"
run: |
apt-get -qq update && apt-get -qq -y install curl && apt-get -y install libsasl2-dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ extension KafkaConfiguration {
///
/// - Parameters:
/// - privateKey: The client's private key (PEM) used for authentication.
/// - certificate: The client's public key (PEM) used for authentication.
/// - certificates: The client's public key (PEM) used for authentication and potentially multiple intermediate certificates.
public static func keyPair(
privateKey: PrivateKey,
certificates: LeafAndIntermediates
Expand Down
6 changes: 3 additions & 3 deletions Sources/Kafka/Configuration/KafkaConsumerConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public struct KafkaConsumerConfiguration {
/// The consumer joins a consumer group identified by a group ID and consumes from multiple topics.
///
/// - Parameters:
/// - id: The ID of the consumer group to join.
/// - groupID: The ID of the consumer group to join.
/// - topics: An array of topic names to consume from.
public static func group(id groupID: String, topics: [String]) -> ConsumptionStrategy {
.init(consumptionStrategy: .group(groupID: groupID, topics: topics))
}
}

/// The strategy used for consuming messages.
/// See ``KafkaConsumerConfiguration/ConsumptionStrategy-swift.struct-swift.struct`` for more information.
/// See ``KafkaConsumerConfiguration/ConsumptionStrategy-swift.struct`` for more information.
public var consumptionStrategy: ConsumptionStrategy

// MARK: - Consumer-specific Config Properties
Expand Down Expand Up @@ -144,7 +144,7 @@ public struct KafkaConsumerConfiguration {
public static let error = AutoOffsetReset(description: "error")
}

/// Action to take when there is no initial offset in the offset store or the desired offset is out of range. See ``KafkaConfiguration/AutoOffsetReset`` for more information.
/// Action to take when there is no initial offset in the offset store or the desired offset is out of range. See ``KafkaConsumerConfiguration/AutoOffsetReset-swift.struct`` for more information.
/// Default: `.largest`
public var autoOffsetReset: AutoOffsetReset = .largest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public struct KafkaProducerConfiguration {
public var messageLimit: MessageLimit = .maximumLimit(100_000)

/// Maximum total message size sum allowed on the producer queue. This queue is shared by all topics and partitions.
/// This property has higher priority than ``KafkaConfiguration/QueueOptions/messageLimit``.
/// This property has higher priority than ``KafkaProducerConfiguration/QueueConfiguration/MessageLimit-swift.struct``.
/// Default: `1_048_576 * 1024`
public var maximumMessageBytes: Int = 1_048_576 * 1024

Expand Down
2 changes: 1 addition & 1 deletion Sources/Kafka/Configuration/KafkaTopicConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public struct KafkaTopicConfiguration {
public static let fnv1aRandom = Partitioner(description: "fnv1a_random")
}

/// Partitioner. See ``KafkaConfiguration/Partitioner`` for more information.
/// Partitioner. See ``KafkaTopicConfiguration/Partitioner-swift.struct`` for more information.
/// Default: `.consistentRandom`
public var partitioner: Partitioner = .consistentRandom

Expand Down
3 changes: 1 addition & 2 deletions Sources/Kafka/KafkaConsumer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public struct KafkaConsumerMessages: Sendable, AsyncSequence {

// MARK: - KafkaConsumer

/// A ``KafkaConsumer `` can be used to consume messages from a Kafka cluster.
/// Can be used to consume messages from a Kafka cluster.
public final class KafkaConsumer: Sendable, Service {
/// The configuration object of the consumer client.
private let configuration: KafkaConsumerConfiguration
Expand Down Expand Up @@ -192,7 +192,6 @@ public final class KafkaConsumer: Sendable, Service {
/// - Parameters:
/// - configuration: The ``KafkaConsumerConfiguration`` for configuring the ``KafkaConsumer``.
/// - logger: A logger.
/// - Returns: The newly created ``KafkaConsumer``.
/// - Throws: A ``KafkaError`` if the initialization failed.
public convenience init(
configuration: KafkaConsumerConfiguration,
Expand Down
1 change: 0 additions & 1 deletion Sources/Kafka/KafkaProducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public final class KafkaProducer: Service, Sendable {
/// - Parameters:
/// - configuration: The ``KafkaProducerConfiguration`` for configuring the ``KafkaProducer``.
/// - logger: A logger.
/// - Returns: The newly created ``KafkaProducer``.
/// - Throws: A ``KafkaError`` if initializing the producer failed.
public convenience init(
configuration: KafkaProducerConfiguration,
Expand Down
Loading