Skip to content

Commit 980a619

Browse files
abnegateclaude
andcommitted
fix: switch to VCS repos for query/async and simplify CI
Replace path repositories with VCS repos pointing to GitHub, removing the need for separate checkout steps, sed rewrites, and Docker volume mounts for query/async in all CI workflows and the Dockerfile. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a6949b8 commit 980a619

7 files changed

Lines changed: 52 additions & 118 deletions

File tree

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,14 @@ jobs:
1111
uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 2
14-
path: database
15-
16-
- name: Checkout query library
17-
uses: actions/checkout@v4
18-
with:
19-
repository: utopia-php/query
20-
ref: feat-builder
21-
path: query
22-
23-
- name: Checkout async library
24-
uses: actions/checkout@v4
25-
with:
26-
repository: utopia-php/async
27-
path: async
2814

2915
- run: git checkout HEAD^2
3016
if: github.event_name == 'pull_request'
31-
working-directory: database
3217

3318
- name: Run CodeQL
3419
run: |
35-
docker run --rm -v $PWD/database:/app -v $PWD/query:/query -v $PWD/async:/async -w /app -e COMPOSER_MIRROR_PATH_REPOS=1 php:8.4-cli-alpine sh -c \
20+
docker run --rm -v $PWD:/app -w /app php:8.4-cli-alpine sh -c \
3621
"php -r \"copy('https://getcomposer.org/installer', '/tmp/composer-setup.php');\" && \
3722
php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
38-
sed -i 's|\"url\": \"../query\"|\"url\": \"/query\"|' composer.json && \
39-
sed -i 's|\"url\": \"../async\"|\"url\": \"/async\"|' composer.json && \
40-
sed -i 's|\"symlink\": true|\"symlink\": false|' composer.json && \
41-
sed -i 's|\"url\": \"../query\"|\"url\": \"/query\"|' composer.lock && \
42-
sed -i 's|\"url\": \"../async\"|\"url\": \"/async\"|' composer.lock && \
4323
composer install --profile --ignore-platform-reqs && \
4424
composer check"

.github/workflows/linter.yml

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,12 @@ jobs:
1111
uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 2
14-
path: database
15-
16-
- name: Checkout query library
17-
uses: actions/checkout@v4
18-
with:
19-
repository: utopia-php/query
20-
ref: feat-builder
21-
path: query
22-
23-
- name: Checkout async library
24-
uses: actions/checkout@v4
25-
with:
26-
repository: utopia-php/async
27-
path: async
2814

2915
- run: git checkout HEAD^2
3016
if: github.event_name == 'pull_request'
31-
working-directory: database
3217

3318
- name: Run Linter
3419
run: |
35-
docker run --rm -v $PWD/database:/app -v $PWD/query:/query -v $PWD/async:/async -w /app -e COMPOSER_MIRROR_PATH_REPOS=1 phpswoole/swoole:5.1.8-php8.3-alpine sh -c \
36-
"sed -i 's|\"url\": \"../query\"|\"url\": \"/query\"|' composer.json && \
37-
sed -i 's|\"url\": \"../async\"|\"url\": \"/async\"|' composer.json && \
38-
sed -i 's|\"symlink\": true|\"symlink\": false|' composer.json && \
39-
sed -i 's|\"url\": \"../query\"|\"url\": \"/query\"|' composer.lock && \
40-
sed -i 's|\"url\": \"../async\"|\"url\": \"/async\"|' composer.lock && \
41-
composer install --profile --ignore-platform-reqs && \
42-
if [ -L vendor/utopia-php/query ]; then rm vendor/utopia-php/query && cp -r /query vendor/utopia-php/query; fi && \
43-
if [ -L vendor/utopia-php/async ]; then rm vendor/utopia-php/async && cp -r /async vendor/utopia-php/async; fi && \
20+
docker run --rm -v $PWD:/app -w /app phpswoole/swoole:5.1.8-php8.3-alpine sh -c \
21+
"composer install --profile --ignore-platform-reqs && \
4422
composer lint"

.github/workflows/tests.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,6 @@ jobs:
1717
steps:
1818
- name: Checkout repository
1919
uses: actions/checkout@v4
20-
with:
21-
path: database
22-
23-
- name: Checkout query library
24-
uses: actions/checkout@v4
25-
with:
26-
repository: utopia-php/query
27-
ref: feat-builder
28-
path: query
29-
30-
- name: Checkout async library
31-
uses: actions/checkout@v4
32-
with:
33-
repository: utopia-php/async
34-
path: async
3520

3621
- name: Set up Docker Buildx
3722
uses: docker/setup-buildx-action@v3
@@ -40,7 +25,7 @@ jobs:
4025
uses: docker/build-push-action@v3
4126
with:
4227
context: .
43-
file: database/Dockerfile
28+
file: Dockerfile
4429
push: false
4530
tags: ${{ env.IMAGE }}
4631
load: true

Dockerfile

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,16 @@ FROM composer:2.8 AS composer
22

33
WORKDIR /usr/local/src/
44

5-
COPY database/composer.lock /usr/local/src/
6-
COPY database/composer.json /usr/local/src/
5+
COPY composer.lock /usr/local/src/
6+
COPY composer.json /usr/local/src/
77

8-
# Copy local dependencies (referenced as ../query and ../async in composer.json)
9-
COPY query /usr/local/query
10-
COPY async /usr/local/async
11-
12-
# Rewrite path repositories to use copied locations
13-
RUN sed -i 's|"url": "../query"|"url": "/usr/local/query"|' /usr/local/src/composer.json \
14-
&& sed -i 's|"url": "../async"|"url": "/usr/local/async"|' /usr/local/src/composer.json \
15-
&& sed -i 's|"symlink": true|"symlink": false|' /usr/local/src/composer.json \
16-
&& sed -i 's|"url": "../query"|"url": "/usr/local/query"|' /usr/local/src/composer.lock \
17-
&& sed -i 's|"url": "../async"|"url": "/usr/local/async"|' /usr/local/src/composer.lock
18-
19-
RUN COMPOSER_MIRROR_PATH_REPOS=1 composer install \
8+
RUN composer install \
209
--ignore-platform-reqs \
2110
--optimize-autoloader \
2211
--no-plugins \
2312
--no-scripts \
2413
--prefer-dist
2514

26-
# Replace symlink with actual copy (composer path repos may still symlink)
27-
RUN rm -rf /usr/local/src/vendor/utopia-php/query && \
28-
cp -r /usr/local/query /usr/local/src/vendor/utopia-php/query
29-
3015
FROM php:8.4.18-cli-alpine3.22 AS compile
3116

3217
ENV PHP_REDIS_VERSION="6.3.0" \
@@ -120,17 +105,14 @@ RUN echo "opcache.enable_cli=1" >> $PHP_INI_DIR/php.ini
120105
RUN echo "memory_limit=1024M" >> $PHP_INI_DIR/php.ini
121106

122107
COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
123-
# Ensure local libs are copied (not symlinked) in vendor
124-
COPY query /usr/src/code/vendor/utopia-php/query
125-
COPY async /usr/src/code/vendor/utopia-php/async
126108
COPY --from=swoole /usr/local/lib/php/extensions/no-debug-non-zts-20240924/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/
127109
COPY --from=redis /usr/local/lib/php/extensions/no-debug-non-zts-20240924/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/
128110
COPY --from=pcov /usr/local/lib/php/extensions/no-debug-non-zts-20240924/pcov.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/
129111
COPY --from=xdebug /usr/local/lib/php/extensions/no-debug-non-zts-20240924/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/
130112

131-
COPY database/bin /usr/src/code/bin
132-
COPY database/src /usr/src/code/src
133-
COPY database/dev /usr/src/code/dev
113+
COPY bin /usr/src/code/bin
114+
COPY src /usr/src/code/src
115+
COPY dev /usr/src/code/dev
134116

135117
# Add Debug Configs
136118
RUN if [ "$DEBUG" = "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi

composer.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"utopia-php/cache": "1.*",
4444
"utopia-php/pools": "1.*",
4545
"utopia-php/mongo": "1.*",
46-
"utopia-php/query": "@dev",
46+
"utopia-php/query": "dev-feat-builder",
4747
"utopia-php/async": "@dev"
4848
},
4949
"require-dev": {
@@ -64,18 +64,12 @@
6464
},
6565
"repositories": [
6666
{
67-
"type": "path",
68-
"url": "../query",
69-
"options": {
70-
"symlink": true
71-
}
67+
"type": "vcs",
68+
"url": "https://github.com/utopia-php/query.git"
7269
},
7370
{
74-
"type": "path",
75-
"url": "../async",
76-
"options": {
77-
"symlink": true
78-
}
71+
"type": "vcs",
72+
"url": "https://github.com/utopia-php/async.git"
7973
}
8074
],
8175
"config": {

composer.lock

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

docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ services:
33
container_name: tests
44
image: databases-dev
55
build:
6-
context: ..
7-
dockerfile: database/Dockerfile
6+
context: .
7+
dockerfile: Dockerfile
88
args:
99
DEBUG: true
1010
networks:
@@ -54,8 +54,8 @@ services:
5454

5555
postgres:
5656
build:
57-
context: ..
58-
dockerfile: database/postgres.dockerfile
57+
context: .
58+
dockerfile: postgres.dockerfile
5959
args:
6060
POSTGRES_VERSION: 16
6161
container_name: utopia-postgres
@@ -76,8 +76,8 @@ services:
7676

7777
postgres-mirror:
7878
build:
79-
context: ..
80-
dockerfile: database/postgres.dockerfile
79+
context: .
80+
dockerfile: postgres.dockerfile
8181
args:
8282
POSTGRES_VERSION: 16
8383
container_name: utopia-postgres-mirror

0 commit comments

Comments
 (0)