Skip to content

Commit 5e3c395

Browse files
Cyb3rDuduclaude
andcommitted
Merge origin/main into feat/dns-domain-resolution
Resolve ComposeUp.swift conflicts: - getIPForRunningService: keep containerName(for:) helper, retain main's container-address comment (Mcrich23#100). - waitUntilServiceIsRunning: adopt main's ActivityClock idle/maxWait signature (Mcrich23#112); keep containerName(for:) helper in place of the silent guard-let-projectName return. - configService: keep BOTH Mcrich23#97's --dns-domain args and main's compose project/service labels (Mcrich23#110) — independent features at the same site. - Failed-wait teardown: call stopExistingContainers([containerName]) (Mcrich23#97 rename) instead of main's stopOldStuff([serviceName]); pass the actual launched name so dotted/explicit names are torn down correctly. Builds clean; 63 static tests pass (DNS helpers, parsing, volumes, helpers). Co-Authored-By: Claude <noreply@anthropic.com>
2 parents 1e42796 + 18521e2 commit 5e3c395

20 files changed

Lines changed: 565 additions & 111 deletions

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
run: swift build --build-tests
3636

3737
- name: Run static tests
38-
run: swift test --filter Container-Compose-StaticTests.
38+
run: swift test --filter Container_Compose_StaticTests
3939

4040
- name: Upload static test results
4141
uses: actions/upload-artifact@v4

Package.resolved

Lines changed: 63 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ let package = Package(
88
platforms: [.macOS(.v15)],
99
dependencies: [
1010
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.1"),
11-
.package(url: "https://github.com/mcrich23/container", branch: "add-command-option-group-function-macro"),
12-
.package(url: "https://github.com/jpsim/Yams.git", from: "5.0.6"),
11+
.package(url: "https://github.com/apple/container", from: "1.0.0"),
12+
.package(url: "https://github.com/jpsim/Yams.git", from: "6.0.0"),
1313
.package(url: "https://github.com/onevcat/Rainbow", .upToNextMajor(from: "4.0.0")),
1414
],
1515
targets: [
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//===----------------------------------------------------------------------===//
2+
// Copyright © 2025 Morris Richman and the Container-Compose project authors. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// https://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//===----------------------------------------------------------------------===//
16+
17+
import Foundation
18+
19+
/// Thread-safe timestamp of the most recent output from a service's
20+
/// `container run` subprocess. Written from the streaming `Task` and read by
21+
/// the readiness wait to tell "slow but progressing" apart from "stuck".
22+
///
23+
/// The clock is injectable so the idle-window logic can be exercised in tests
24+
/// without leaning on real wall-clock time.
25+
final class ActivityClock: @unchecked Sendable {
26+
private let lock = NSLock()
27+
private let now: @Sendable () -> Date
28+
private var _lastActivity: Date
29+
30+
init(now: @escaping @Sendable () -> Date = { Date() }) {
31+
self.now = now
32+
self._lastActivity = now()
33+
}
34+
35+
func touch() {
36+
lock.lock()
37+
_lastActivity = now()
38+
lock.unlock()
39+
}
40+
41+
var lastActivity: Date {
42+
lock.lock()
43+
defer { lock.unlock() }
44+
return _lastActivity
45+
}
46+
}

Sources/Container-Compose/Application.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import ArgumentParser
1919

2020
public struct Main: AsyncParsableCommand {
2121
private static let commandName: String = "container-compose"
22-
private static let version: String = "0.11.0"
22+
private static let version: String = "1.0.0"
2323
public static var versionString: String {
2424
"\(commandName) version \(version)"
2525
}
@@ -33,6 +33,9 @@ public struct Main: AsyncParsableCommand {
3333
ComposeBuild.self,
3434
Version.self
3535
])
36+
37+
@OptionGroup
38+
var composeFileOptions: ComposeFileOptions
3639

3740
public init() {}
3841
}

0 commit comments

Comments
 (0)