Skip to content

feat: add GitLab CI/CD integration for setup-vp#97

Merged
fengmk2 merged 33 commits into
voidzero-dev:mainfrom
naokihaba:main
Jul 5, 2026
Merged

feat: add GitLab CI/CD integration for setup-vp#97
fengmk2 merged 33 commits into
voidzero-dev:mainfrom
naokihaba:main

Conversation

@naokihaba

@naokihaba naokihaba commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

resolves #88

I thought it would be best to document the GitLab integration features as an RFC, so I’ve put everything together along with a diagram of the overall flow.

rfcs/assets/gitlab-runtime-flow.svg

gitlab-runtime-flow

@naokihaba

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 277acafbdc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread gitlab/bootstrap.sh
Comment thread README.md Outdated
@naokihaba

Copy link
Copy Markdown
Collaborator Author

GitLab CI Test Steps

Replace <test-ref> with the branch or commit SHA you want to test.

1. Basic smoke test

Verify that the setup works as expected under standard conditions.

include:
  - remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/<test-ref>/gitlab/setup-vp.yml"
    inputs:
      setup-ref: "<test-ref>"
      node-version: "22"
      run-install: "true"

test:
  extends: .setup-vp
  image: node:22
  script:
    - vp --version
    - node --version
    - vp run test

For this test, check if the pipeline config is accepted and the setup correctly reaches the script section. You should see vp --version outputting the version correctly, confirming that vp install ran before the script executed.

2. Old Node image regression test

Ensure that the setup remains compatible even when using an older Node image.

include:
  - remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/<test-ref>/gitlab/setup-vp.yml"
    inputs:
      setup-ref: "<test-ref>"
      node-version: "22"
      run-install: "false"

test:
  extends: .setup-vp
  image: node:18
  script:
    - node --version
    - vp --version

Confirm that the setup succeeds on the node:18 image. The runtime should switch to the requested Node version before setup-vp.mjs is executed.

3. Multi install entries

Test whether the run-install input correctly handles complex YAML objects.

include:
  - remote: "https://raw.githubusercontent.com/voidzero-dev/setup-vp/<test-ref>/gitlab/setup-vp.yml"
    inputs:
      setup-ref: "<test-ref>"
      node-version: "22"
      run-install: |
        - cwd: .
          args: ['--frozen-lockfile']

test:
  extends: .setup-vp
  image: node:22
  script:
    - vp --version

Verify that the pipeline configuration is valid and that run-install is parsed without errors. In the logs, you should see vp install --frozen-lockfile being executed.

@naokihaba naokihaba marked this pull request as ready for review June 28, 2026 17:49
Copilot AI review requested due to automatic review settings June 28, 2026 17:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@fengmk2

fengmk2 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Today I will set up a continuous verification repository on GitLab, and the results will be synchronized.

@fengmk2 fengmk2 self-assigned this Jun 29, 2026
Comment thread gitlab/setup-vp.mjs Outdated
@naokihaba naokihaba marked this pull request as draft June 29, 2026 01:39
@naokihaba

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45e42bf985

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gitlab/run-install.ts
@naokihaba naokihaba marked this pull request as ready for review June 29, 2026 07:39
Copilot AI review requested due to automatic review settings June 29, 2026 07:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@naokihaba naokihaba marked this pull request as draft June 29, 2026 09:06
@naokihaba naokihaba marked this pull request as ready for review June 30, 2026 09:52
@naokihaba

naokihaba commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Verified against PR head 88748cbc7b4758fee7b5d79c33812e3f2c771954 on a real internal GitLab runner (Linux x64, Node.js 24.18.0).

The core GitLab implementation works:

  • default vp install
  • structured multi-package installs with --frozen-lockfile
  • run-install: false
  • Socket Firewall Free wrapping
  • vp build, vp pack, and vp test
  • a complete pnpm monorepo running vp run ready
  • task caching: first run 0/5, second run 5/5 cache hit (100%)

The internal validation pipeline is green.

One caveat: we executed the exact vendored runtime from the PR rather than testing the public include:remote download chain. The template/bootstrap currently download from voidzero-dev/setup-vp, where this commit will not exist until the PR is merged. We’ll run a final include:remote smoke test after merge or once a tag is available.

From the runtime and GitLab-runner compatibility perspective, the solution is working.

Thank you so much for testing this out on your actual in-house GitLab Runner.

It is a huge relief to know that the bundled runtime works perfectly across the entire main workflow, from structured installs and the run-install: false setting to SFW wrapping, vp build, pack, and test, as well as monorepo usage and task caching.

Fixed the diff issue where only the dist artifacts were affected in 2ed3691.

@naokihaba naokihaba marked this pull request as ready for review July 4, 2026 12:13
Copilot AI review requested due to automatic review settings July 4, 2026 12:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 21 changed files in this pull request and generated 1 comment.

Comment thread gitlab/setup-vp.yml Outdated
@naokihaba naokihaba requested a review from fengmk2 July 4, 2026 14:38
@fengmk2

fengmk2 commented Jul 4, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a05032c174

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread gitlab/bootstrap.sh Outdated
Comment thread src/gitlab/install-sfw.ts
Comment thread src/gitlab/run-install.ts Outdated
@naokihaba naokihaba marked this pull request as draft July 4, 2026 16:03
@naokihaba

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: fa40c703e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@naokihaba naokihaba marked this pull request as ready for review July 4, 2026 16:35
Copilot AI review requested due to automatic review settings July 4, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 21 changed files in this pull request and generated 1 comment.

Comment thread README.md Outdated

@fengmk2 fengmk2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@naokihaba I will run a round simplify before I merge.

- renovate: track SFW_VERSION in src/gitlab/install-sfw.ts so the GitLab
  copy is bumped alongside the GitHub Action one instead of freezing
- install-sfw: drop unused isSfwSupported/sfwAssetName helpers and compute
  isMuslLinux() once on the unsupported-platform fallback path
- run-install: extract applyEntryLine to remove three near-identical copies
  of the key/value + block-array handling, and correct the comment
  explaining why the runtime avoids zod/yaml (keep the fetched bundle tiny,
  not "shared chunks break relative imports")
- rebuild dist bundles with vite-plus 0.2.2 to match the toolchain
Copilot AI review requested due to automatic review settings July 5, 2026 13:46
@fengmk2 fengmk2 merged commit 250f29c into voidzero-dev:main Jul 5, 2026
39 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 22 changed files in this pull request and generated 3 comments.

Comment thread src/gitlab/run-install.ts
Comment on lines +5 to +14
function parseScalar(value: string): string {
const trimmed = String(value || "").trim();
if (
(trimmed.startsWith('"') && trimmed.endsWith('"')) ||
(trimmed.startsWith("'") && trimmed.endsWith("'"))
) {
return trimmed.slice(1, -1);
}
return trimmed;
}
Comment thread src/gitlab/run-install.ts
Comment on lines +39 to +55
for (const char of body) {
if (quote) {
if (char === quote) quote = "";
current += char;
continue;
}
if (char === "'" || char === '"') {
quote = char;
current += char;
continue;
}
if (char === ",") {
pushCurrent();
continue;
}
current += char;
}
Comment thread src/gitlab/install-sfw.ts
Comment on lines +147 to +164
export async function setupSfw(
runInstallEntries: RunInstallEntry[],
env: NodeJS.ProcessEnv = process.env,
): Promise<InstallCommand> {
if (env.SETUP_VP_SFW !== "true") return "vp";

if (runInstallEntries.length === 0) {
console.log(
"setup-vp: sfw was requested but run-install is disabled; sfw will not be invoked.",
);
return "vp";
}

const existing = commandPath("sfw");
if (existing) {
console.log(`setup-vp: using existing sfw on PATH: ${existing}`);
return "sfw";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GitLab CI/CD template support

3 participants