Skip to content

Commit fa2900e

Browse files
Merge branch 'main' into feature/hybrid-cache
2 parents 604055c + 09b226b commit fa2900e

4 files changed

Lines changed: 29 additions & 39 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,16 @@ permissions:
88
on:
99
push:
1010
branches: [main]
11-
issue_comment:
12-
types: [created]
11+
pull_request:
12+
workflow_dispatch:
1313

1414
jobs:
1515
e2e:
1616
runs-on: ubuntu-latest
17-
# Run on push/PR or when a maintainer comments "/test e2e" or "/run e2e"
18-
if: |
19-
github.event_name != 'issue_comment' || (
20-
github.event.issue.pull_request &&
21-
(contains(github.event.comment.body, '/test e2e') || contains(github.event.comment.body, '/run e2e')) &&
22-
(github.event.comment.author_association == 'OWNER' ||
23-
github.event.comment.author_association == 'MEMBER' ||
24-
github.event.comment.author_association == 'COLLABORATOR')
25-
)
2617

2718
steps:
2819
- name: Checkout code
2920
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
30-
with:
31-
# When triggered by comment, checkout the PR branch
32-
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || github.ref }}
3321

3422
- name: Set up Docker Buildx
3523
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
@@ -57,8 +45,11 @@ jobs:
5745

5846
- name: Wait for services to be ready
5947
run: |
60-
timeout 60 bash -c 'until docker compose ps | grep -q "Up"; do sleep 2; done'
61-
sleep 10
48+
timeout 60 bash -c '
49+
while [ "$(docker compose ps | grep -c "Up")" -ne 3 ]; do
50+
sleep 2
51+
done
52+
' || { echo "Service readiness check failed:"; docker compose ps; exit 1; }
6253
6354
- name: Run E2E tests
6455
run: npm run test:e2e

.github/workflows/npm.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ jobs:
3131
VERSION=$(node -p "require('./package.json').version")
3232
if [[ "$VERSION" == *"-"* ]]; then
3333
echo "Publishing pre-release: $VERSION"
34-
npm publish --provenance --access=public --tag rc
34+
npm publish --access=public --tag rc
3535
else
3636
echo "Publishing stable release: $VERSION"
37-
npm publish --provenance --access=public
37+
npm publish --access=public
3838
fi
39-
env:
40-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Dockerfile

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@ FROM node:20 AS builder
22

33
USER root
44

5-
WORKDIR /app
5+
WORKDIR /out
6+
7+
COPY package*.json ./
8+
COPY tsconfig.json tsconfig.publish.json proxy.config.json config.schema.json test-e2e.proxy.config.json vite.config.ts index.html index.ts ./
9+
10+
RUN npm pkg delete scripts.prepare && npm ci --include=dev
611

7-
COPY tsconfig.json tsconfig.publish.json proxy.config.json config.schema.json test-e2e.proxy.config.json vite.config.ts package*.json index.html index.ts ./
8-
COPY src/ /app/src/
9-
COPY public/ /app/public/
12+
COPY src/ /out/src/
13+
COPY public/ /out/public/
1014

11-
# Build the UI and server
12-
RUN npm pkg delete scripts.prepare \
13-
&& npm ci --include=dev \
14-
&& npm run build-ui -dd \
15+
RUN npm run build-ui \
1516
&& npx tsc --project tsconfig.publish.json \
1617
&& cp config.schema.json dist/ \
1718
&& npm prune --omit=dev
1819

1920
FROM node:20 AS production
2021

21-
COPY --from=builder /app/package*.json ./
22-
COPY --from=builder /app/node_modules/ /app/node_modules/
23-
COPY --from=builder /app/dist/ /app/dist/
24-
COPY --from=builder /app/build /app/dist/build/
22+
COPY --from=builder /out/package*.json ./
23+
COPY --from=builder /out/node_modules/ /app/node_modules/
24+
COPY --from=builder /out/dist/ /app/dist/
25+
COPY --from=builder /out/build /app/dist/build/
2526
COPY proxy.config.json config.schema.json ./
2627
COPY docker-entrypoint.sh /docker-entrypoint.sh
2728

@@ -31,8 +32,8 @@ RUN apt-get update && apt-get install -y \
3132
git tini \
3233
&& rm -rf /var/lib/apt/lists/*
3334

34-
RUN chown 1000:1000 /app/dist/build \
35-
&& chmod g+w /app/dist/build
35+
RUN mkdir -p /app/.data /app/.tmp /app/.remote \
36+
&& chown -R 1000:1000 /app
3637

3738
USER 1000
3839

@@ -41,4 +42,4 @@ WORKDIR /app
4142
EXPOSE 8080 8000
4243

4344
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
44-
CMD ["node", "dist/index.js"]
45+
CMD ["node", "--enable-source-maps", "dist/index.js"]

src/proxy/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ export class Proxy {
5151
const defaultAuthorisedRepoList = getAuthorisedList();
5252
const allowedList: Repo[] = await getRepos();
5353

54-
defaultAuthorisedRepoList.forEach(async (x) => {
55-
const found = allowedList.find((y) => y.url === x.url);
54+
for (const defaultRepo of defaultAuthorisedRepoList) {
55+
const found = allowedList.find((configuredRepo) => configuredRepo.url === defaultRepo.url);
5656
if (!found) {
57-
const repo = await createRepo(x);
57+
const repo = await createRepo(defaultRepo);
5858
await addUserCanPush(repo._id!, 'admin');
5959
await addUserCanAuthorise(repo._id!, 'admin');
6060
}
61-
});
61+
}
6262
}
6363

6464
private async createApp() {

0 commit comments

Comments
 (0)