Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5d0da41

Browse files
Use an SSH URL to fetch Runtime in CI (#3)
Use an SSH URL to fetch Runtime in CI (Same as: apple/swift-openapi-generator#3) ### Motivation Until the swift-openapi-runtime repository is made public, it cannot be cloned using a HTTPS package URL without authentication, which is what this package is using in its Package.swift. This means CI isn't able to run for this package. However, CI is able to clone this repository over SSH, which presents an opportunity for a temporary workaround. ### Modifications Add a temporary step to the Docker Compose CI flow, which creates a Git config in a shared ephemeral volume with the following contents: ```gitconfig [url "git@github.com:apple/swift-openapi-runtime"] insteadOf = https://github.com/apple/swift-openapi-runtime ``` ### Result The CI should be able to clone the private dependency and then succeed. ### Test Plan Locally, this works: ```console ❯ docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.2204.58.yaml run test ... + swift test -Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error ... Fetching https://github.com/apple/swift-openapi-runtime ... Fetched https://github.com/apple/swift-openapi-runtime (2.68s) ... Executed 86 tests, with 0 failures (0 unexpected) in 3.265 (3.265) seconds ``` Also, if we use can use the `shell` Docker Compose service to see things are configured correctly: ```console root@20ab69e3f292:/code# echo $GIT_CONFIG_GLOBAL /ci-gitconfig/gitconfig root@20ab69e3f292:/code# cat $GIT_CONFIG_GLOBAL [url "git@github.com:apple/swift-openapi-runtime"] insteadOf = https://github.com/apple/swift-openapi-runtime ``` Reviewed by: simonjbeaumont Builds: ✔︎ pull request validation (5.8) - Build finished. ✔︎ pull request validation (5.9) - Build finished. ✔︎ pull request validation (nightly) - Build finished. ✔︎ pull request validation (soundness) - Build finished. #3
1 parent ccc7b5b commit 5d0da41

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎docker/docker-compose.yaml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,24 @@ services:
1515
build:
1616
context: .
1717
dockerfile: Dockerfile
18+
# Note: This temporary step creates a gitconfig to use SSH for a dependency
19+
# that is not yet public. This can be removed once it is public.
20+
command: git config --global url."git@github.com:apple/swift-openapi-runtime".insteadOf "https://github.com/apple/swift-openapi-runtime"
21+
volumes:
22+
- ci-gitconfig:/ci-gitconfig
23+
environment:
24+
- GIT_CONFIG_GLOBAL=/ci-gitconfig/gitconfig
1825

1926
common: &common
2027
image: *image
2128
depends_on: [runtime-setup]
2229
volumes:
2330
- ~/.ssh:/root/.ssh
2431
- ..:/code:z
32+
- ci-gitconfig:/ci-gitconfig
2533
working_dir: /code
34+
environment:
35+
- GIT_CONFIG_GLOBAL=/ci-gitconfig/gitconfig
2636

2737
soundness:
2838
<<: *common
@@ -35,3 +45,6 @@ services:
3545
shell:
3646
<<: *common
3747
entrypoint: /bin/bash
48+
49+
volumes:
50+
ci-gitconfig:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /