Skip to content

Commit e50157f

Browse files
committed
Merge remote-tracking branch 'origin/master' into HEAD
2 parents 4752fd4 + 8265001 commit e50157f

9 files changed

Lines changed: 208 additions & 121 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
yamllint:
1414
runs-on: ubuntu-24.04
1515
steps:
16-
- uses: actions/checkout@v7.0.0
16+
- uses: actions/checkout@v7.0.1
1717
- uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1
1818
with:
1919
strict: true
@@ -25,11 +25,11 @@ jobs:
2525
node-version: [24, 25]
2626
bun-version: [1.2.23, 1.3.10]
2727
steps:
28-
- uses: actions/checkout@v7.0.0
28+
- uses: actions/checkout@v7.0.1
2929
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
3030
with:
3131
bun-version: ${{ matrix.bun-version }}
32-
- uses: actions/setup-node@v6
32+
- uses: actions/setup-node@v7
3333
with:
3434
node-version: ${{ matrix.node-version }}
3535
- run: bun install --frozen-lockfile
@@ -44,7 +44,7 @@ jobs:
4444
typecheck:
4545
runs-on: ubuntu-24.04
4646
steps:
47-
- uses: actions/checkout@v7.0.0
47+
- uses: actions/checkout@v7.0.1
4848
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
4949
with:
5050
bun-version: 1.3.14
@@ -54,7 +54,7 @@ jobs:
5454
eslint:
5555
runs-on: ubuntu-24.04
5656
steps:
57-
- uses: actions/checkout@v7.0.0
57+
- uses: actions/checkout@v7.0.1
5858
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
5959
with:
6060
bun-version: 1.3.14
@@ -64,7 +64,7 @@ jobs:
6464
unused-deps:
6565
runs-on: ubuntu-24.04
6666
steps:
67-
- uses: actions/checkout@v7.0.0
67+
- uses: actions/checkout@v7.0.1
6868
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
6969
with:
7070
bun-version: 1.3.14
@@ -74,7 +74,7 @@ jobs:
7474
test:
7575
runs-on: ubuntu-24.04
7676
steps:
77-
- uses: actions/checkout@v7.0.0
77+
- uses: actions/checkout@v7.0.1
7878
with:
7979
fetch-depth: 0
8080
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
@@ -83,7 +83,7 @@ jobs:
8383
- run: bun install --frozen-lockfile
8484
- name: Run Tests
8585
run: bun run coverage
86-
- uses: sonarsource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e # v8.2
86+
- uses: sonarsource/sonarqube-scan-action@22918119ff8e1ca75a623e15c8296b6ea4fbe28f # v8.2
8787
env:
8888
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8989
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -99,15 +99,15 @@ jobs:
9999

100100
steps:
101101
- name: Checkout repository
102-
uses: actions/checkout@v7.0.0
102+
uses: actions/checkout@v7.0.1
103103

104104
- name: Initialize CodeQL
105-
uses: github/codeql-action/init@v4.36.2
105+
uses: github/codeql-action/init@v4.37.4
106106
with:
107107
languages: 'typescript'
108108

109109
- name: Autobuild
110-
uses: github/codeql-action/autobuild@v4.36.2
110+
uses: github/codeql-action/autobuild@v4.37.4
111111

112112
- name: Perform CodeQL Analysis
113-
uses: github/codeql-action/analyze@v4.36.2
113+
uses: github/codeql-action/analyze@v4.37.4

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
contents: write
1414
id-token: write
1515
steps:
16-
- uses: actions/checkout@v7.0.0
16+
- uses: actions/checkout@v7.0.1
1717

1818
- name: Set version from tag
1919
if: github.ref_type == 'tag'
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
bun-version: 1.3.14
2626

27-
- uses: actions/setup-node@v6.4.0
27+
- uses: actions/setup-node@v7.0.0
2828
with:
2929
node-version: '24'
3030
registry-url: 'https://registry.npmjs.org'

bun.lock

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

examples/docker-compose-nodejs/package-lock.json

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

renovate.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,12 @@
99
"matchUpdateTypes": ["minor", "patch", "lockFileMaintenance"],
1010
"groupName": "All non-major"
1111
}
12+
],
13+
"customManagers": [
14+
{
15+
"customType": "regex",
16+
"managerFilePatterns": ["/^src/utils\\.ts$/"],
17+
"matchStrings": ["// renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)\\s+static readonly \\w+: string = \"[^:\"]+:(?<currentValue>[^\"]+)\";"]
18+
}
1219
]
1320
}

src/parser.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,16 @@ export class Parser {
297297
let index = 0;
298298
if (expandVariables) {
299299
for (const line of fileSplit) {
300-
interactiveMatch = interactiveMatch ?? /#\s?@\s?[Ii]nteractive/.exec(line);
301-
injectSSHAgent = injectSSHAgent ?? /#\s?@\s?[Ii]njectSSHAgent/.exec(line);
302-
noArtifactsToSourceMatch = noArtifactsToSourceMatch ?? /#\s?@\s?NoArtifactsToSource/i.exec(line);
303-
descriptionMatch = descriptionMatch ?? /#\s?@\s?[Dd]escription (?<description>.*)/.exec(line);
300+
if (/^\s*#/.test(line)) {
301+
interactiveMatch = interactiveMatch ?? /#\s?@\s?[Ii]nteractive/.exec(line);
302+
injectSSHAgent = injectSSHAgent ?? /#\s?@\s?[Ii]njectSSHAgent/.exec(line);
303+
noArtifactsToSourceMatch = noArtifactsToSourceMatch ?? /#\s?@\s?NoArtifactsToSource/i.exec(line);
304+
descriptionMatch = descriptionMatch ?? /#\s?@\s?[Dd]escription (?<description>.*)/.exec(line);
305+
index++;
306+
continue;
307+
}
304308

305-
const jobMatch = /\w:/.exec(line);
309+
const jobMatch = /^[^\s#].*:/.exec(line);
306310
if (jobMatch && (interactiveMatch || descriptionMatch || injectSSHAgent || noArtifactsToSourceMatch)) {
307311
if (interactiveMatch) {
308312
fileSplitClone.splice(index + 1, 0, " gclInteractive: true");
@@ -317,7 +321,7 @@ export class Parser {
317321
index++;
318322
}
319323
if (descriptionMatch) {
320-
fileSplitClone.splice(index + 1, 0, ` gclDescription: ${descriptionMatch?.groups?.description ?? ""}`);
324+
fileSplitClone.splice(index + 1, 0, ` gclDescription: ${JSON.stringify(descriptionMatch?.groups?.description ?? "")}`);
321325
index++;
322326
}
323327
interactiveMatch = null;

src/utils.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,12 @@ export class Utils {
422422
}
423423

424424
static readonly gclRegistryPrefix: string = "registry.gcl.local";
425+
// renovate: datasource=docker depName=registry
426+
static readonly gclRegistryImage: string = "registry:3.1.1";
427+
// renovate: datasource=docker depName=alpine/openssl
428+
static readonly gclOpensslImage: string = "alpine/openssl:3.5.7";
429+
// renovate: datasource=docker depName=curlimages/curl
430+
static readonly gclCurlImage: string = "curlimages/curl:8.21.0";
425431
static async startDockerRegistry (argv: Argv): Promise<void> {
426432
const gclRegistryCertVol = `${this.gclRegistryPrefix}.certs`;
427433
const gclRegistryDataVol = `${this.gclRegistryPrefix}.data`;
@@ -446,7 +452,7 @@ export class Utils {
446452
"-addext", `subjectAltName=DNS:${this.gclRegistryPrefix}`,
447453
];
448454
const generateCertsInPlace = [
449-
argv.containerExecutable, "run", "--rm", "-v", `${gclRegistryCertVol}:/certs`, "--entrypoint", "sh", "alpine/openssl", "-c",
455+
argv.containerExecutable, "run", "--rm", "-v", `${gclRegistryCertVol}:/certs`, "--entrypoint", "sh", this.gclOpensslImage, "-c",
450456
[
451457
"openssl", ...opensslArgs,
452458
"&&", "mkdir", "-p", `/certs/${this.gclRegistryPrefix}`,
@@ -481,18 +487,19 @@ export class Utils {
481487
"-e", "REGISTRY_HTTP_ADDR=0.0.0.0:443",
482488
"-e", `REGISTRY_HTTP_TLS_CERTIFICATE=/certs/${this.gclRegistryPrefix}.crt`,
483489
"-e", `REGISTRY_HTTP_TLS_KEY=/certs/${this.gclRegistryPrefix}.key`,
484-
"registry",
490+
this.gclRegistryImage,
485491
]);
486492

487493
try {
494+
await Utils.spawn([argv.containerExecutable, "pull", this.gclCurlImage]);
488495
await execa(argv.containerExecutable, [
489496
"run", "--rm",
490497
"--network", gclRegistryNet,
491498
"--entrypoint", "sh",
492-
"curlimages/curl",
499+
this.gclCurlImage,
493500
"-c", `until [ "$(curl -s -o /dev/null -k -w "%{http_code}" https://${this.gclRegistryPrefix}:443)" = "200" ]; do sleep 1; done;`,
494501
], {
495-
timeout: 4000,
502+
timeout: 10000,
496503
});
497504
} catch (err) {
498505
await this.stopDockerRegistry(argv.containerExecutable);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
# @Description Runs first
3+
firstjob:
4+
script:
5+
- echo "first"
6+
7+
# @Description Upload source maps. Opt in per brand:
8+
# sourcemaps:
9+
# extends: [.foo]
10+
sourcemaps:
11+
script:
12+
- echo "sourcemaps"
13+
14+
# @Description Deploys everything
15+
deploy to prod:
16+
script:
17+
- echo "deploy"
18+
19+
# @Description Builds the image
20+
build/image:
21+
script:
22+
- echo "build"
23+
24+
# @Description Quoted with a colon: and "quotes"
25+
"quoted job":
26+
script:
27+
- echo "quoted"
28+
29+
# @Description Single quoted job
30+
'single quoted':
31+
script:
32+
- echo "single"
33+
34+
# @Description Runs the tests
35+
plainjob:
36+
script:
37+
- echo "test"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import {WriteStreamsMock} from "../../../src/write-streams.js";
2+
import {handler} from "../../../src/handler.js";
3+
import {initSpawnSpy} from "../../mocks/utils.mock.js";
4+
import {WhenStatics} from "../../mocks/when-statics.js";
5+
6+
beforeAll(() => {
7+
initSpawnSpy(WhenStatics.all);
8+
});
9+
10+
test.concurrent("comment-directive-anchor --list", async () => {
11+
const writeStreams = new WriteStreamsMock();
12+
await handler({
13+
cwd: "tests/test-cases/comment-directive-anchor/",
14+
list: true,
15+
noColor: true,
16+
stateDir: ".gitlab-ci-local-comment-directive-anchor",
17+
}, writeStreams);
18+
19+
const descriptionOf = (jobName: string) => {
20+
const line = writeStreams.stdoutLines.find(l => l.startsWith(`${jobName} `));
21+
expect(line, `no output line for job ${jobName}`).toBeDefined();
22+
return line!.slice(jobName.length).trimStart().replace(/\s{2,}.*$/, "");
23+
};
24+
25+
expect(descriptionOf("firstjob")).toBe("Runs first");
26+
expect(descriptionOf("sourcemaps")).toBe("Upload source maps. Opt in per brand:");
27+
expect(descriptionOf("deploy to prod")).toBe("Deploys everything");
28+
expect(descriptionOf("build/image")).toBe("Builds the image");
29+
expect(descriptionOf("quoted job")).toBe("Quoted with a colon: and \"quotes\"");
30+
expect(descriptionOf("single quoted")).toBe("Single quoted job");
31+
expect(descriptionOf("plainjob")).toBe("Runs the tests");
32+
});

0 commit comments

Comments
 (0)