Skip to content

Commit 94f89bc

Browse files
committed
RHAIENG-2860: Move custom packages from artifact to .json files
Add hermetic Konflux support: Tekton prefetch + custom-packages (codeload URLs), drop generic artifacts for css-parser/watcher, update rewrite-npm-urls for codeload and integrity; document Hermeto layout in custom-packages README.
1 parent 30d1bed commit 94f89bc

File tree

12 files changed

+69
-52
lines changed

12 files changed

+69
-52
lines changed

.tekton/odh-workbench-codeserver-datascience-cpu-py312-ubi9-pull-request.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ spec:
172172
type: npm
173173
- path: codeserver/ubi9-python-3.12/prefetch-input/patches/code-server-v4.106.3/lib/vscode/extensions/microsoft-authentication
174174
type: npm
175+
# GitHub tarball deps (git+ssh not available in Konflux); same URLs as artifacts.in.yaml
176+
- path: codeserver/ubi9-python-3.12/prefetch-input/patches/code-server-v4.106.3/custom-packages
177+
type: npm
175178
pipelineRef:
176179
name: multiarch-combined-pipeline
177180
taskRunTemplate:

.tekton/odh-workbench-codeserver-datascience-cpu-py312-ubi9-push.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ spec:
169169
type: npm
170170
- path: codeserver/ubi9-python-3.12/prefetch-input/patches/code-server-v4.106.3/lib/vscode/extensions/microsoft-authentication
171171
type: npm
172+
# GitHub tarball deps (git+ssh not available in Konflux); same URLs as artifacts.in.yaml
173+
- path: codeserver/ubi9-python-3.12/prefetch-input/patches/code-server-v4.106.3/custom-packages
174+
type: npm
172175

173176
pipelineRef:
174177
name: multiarch-combined-pipeline

codeserver/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ RUN dnf install -y \
8181
/cachi2/output/deps/generic/nfpm-2.44.1-1.$(uname -m).rpm && \
8282
dnf clean all
8383

84-
# There was limitation on Hermeto, it can't fetch npm packages using git/ssh protocol.
85-
# To work around this, need to fetch some npm packages as generic artifacts and copy to npm directory.
86-
RUN cp /cachi2/output/deps/generic/npm/* /cachi2/output/deps/npm/
87-
8884
# [HERMETIC] Git metadata needed by code-server's build scripts (version detection, submodules).
8985
COPY .git /root/.git
9086
# [HERMETIC] Rewrite script: used by setup-offline-binaries.sh to rewrite npm

codeserver/ubi9-python-3.12/Dockerfile.konflux.cpu

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ RUN dnf install -y \
8181
/cachi2/output/deps/generic/nfpm-2.44.1-1.$(uname -m).rpm && \
8282
dnf clean all
8383

84-
# There was limitation on Hermeto, it can't fetch npm packages using git/ssh protocol.
85-
# To work around this, need to fetch some npm packages as generic artifacts and copy to npm directory.
86-
RUN cp /cachi2/output/deps/generic/npm/* /cachi2/output/deps/npm/
87-
8884
# [HERMETIC] Git metadata needed by code-server's build scripts (version detection, submodules).
8985
COPY .git /root/.git
9086
# [HERMETIC] Rewrite script: used by setup-offline-binaries.sh to rewrite npm

codeserver/ubi9-python-3.12/prefetch-input/odh/artifacts.in.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,6 @@ input:
5959
- url: https://mirror.openshift.com/pub/openshift-v4/s390x/clients/ocp/4.18.33/openshift-client-linux.tar.gz
6060
filename: openshift-client-linux-s390x.tar.gz
6161

62-
# GitHub tarball dependency for @emmetio/css-parser (used by VSCode emmet extension)
63-
# Filename must use .tgz to match rewrite-npm-urls.sh and download-npm.sh conventions.
64-
- url: https://codeload.github.com/ramya-rao-a/css-parser/tar.gz/370c480ac103bd17c7bcfb34bf5d577dc40d3660
65-
filename: npm/ramya-rao-a-css-parser-370c480ac103bd17c7bcfb34bf5d577dc40d3660.tgz
66-
67-
# GitHub tarball dependency for @parcel/watcher (v4.106.3 uses git ref instead of npm registry)
68-
# Filename must use .tgz to match rewrite-npm-urls.sh and download-npm.sh conventions.
69-
- url: https://codeload.github.com/parcel-bundler/watcher/tar.gz/1ca032aa8339260a8a3bcf825c3a1a71e3e43542
70-
filename: npm/parcel-bundler-watcher-1ca032aa8339260a8a3bcf825c3a1a71e3e43542.tgz
71-
7262
# VSCode marketplace extensions (built-in extensions bundled with code-server)
7363
- url: https://github.com/microsoft/vscode-js-debug-companion/releases/download/v1.1.3/ms-vscode.js-debug-companion.1.1.3.vsix
7464
filename: ms-vscode.js-debug-companion.1.1.3.vsix

codeserver/ubi9-python-3.12/prefetch-input/odh/artifacts.lock.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ artifacts:
6868
- download_url: https://mirror.openshift.com/pub/openshift-v4/s390x/clients/ocp/4.18.33/openshift-client-linux.tar.gz
6969
checksum: sha256:2162b0a596f5f29fbd290382b52ccf60bf6e9739346b52698a55ac77396989d9
7070
filename: openshift-client-linux-s390x.tar.gz
71-
- download_url: https://codeload.github.com/ramya-rao-a/css-parser/tar.gz/370c480ac103bd17c7bcfb34bf5d577dc40d3660
72-
checksum: sha256:6004ae05ad17931a62a72b27ebf1dab54fca6e72c0a9f0b7925a8b315bbe776d
73-
filename: npm/ramya-rao-a-css-parser-370c480ac103bd17c7bcfb34bf5d577dc40d3660.tgz
74-
- download_url: https://codeload.github.com/parcel-bundler/watcher/tar.gz/1ca032aa8339260a8a3bcf825c3a1a71e3e43542
75-
checksum: sha256:2d22d1ade4bc4d7bc96c1b61888a2b9b7e50d01740d75c92a865834ce7c4359e
76-
filename: npm/parcel-bundler-watcher-1ca032aa8339260a8a3bcf825c3a1a71e3e43542.tgz
7771
- download_url: https://github.com/microsoft/vscode-js-debug-companion/releases/download/v1.1.3/ms-vscode.js-debug-companion.1.1.3.vsix
7872
checksum: sha256:7380a890787452f14b2db7835dfa94de538caf358ebc263f9d46dd68ac52de93
7973
filename: ms-vscode.js-debug-companion.1.1.3.vsix
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# custom-packages
2+
3+
Declares npm dependencies that **Konflux cannot fetch via git+ssh** (hermetic build limitation). These are provided as **HTTPS GitHub tarball URLs** so the pipeline prefetches them as `type: npm` into `deps/npm/` directly.
4+
5+
- **@emmetio/css-parser** — used by VSCode emmet extension (from `ramya-rao-a/css-parser`).
6+
- **@parcel/watcher** — used by VSCode (from `parcel-bundler/watcher`).
7+
8+
The main code-server/VSCode lockfiles reference these via git+ssh; `rewrite-npm-urls.sh` rewrites them to `file:///cachi2/output/deps/npm/owner-repo-<commit>.tgz`, which are supplied by this prefetch.
9+
10+
**Note (Hermeto):** If Konflux uses [Hermeto](https://hermetoproject.github.io/) for npm prefetch, codeload.github.com tarballs are stored under `deps/npm/external-<pkg>/<pkg>-external-sha512-<contenthash>.tgz`, not as flat `owner-repo-<ref>.tgz`. In that case the pipeline should use Hermeto’s inject-files output (lockfile already pointing to those paths) and must not run `rewrite-npm-urls.sh` for these deps, or the build will look for the wrong filenames.

codeserver/ubi9-python-3.12/prefetch-input/patches/code-server-v4.106.3/custom-packages/package-lock.json

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "code-server-hermetic-git-deps",
3+
"version": "1.0.0",
4+
"description": "Pins npm deps that Konflux cannot fetch via git+ssh (GitHub tarball URLs only). Prefetched into deps/npm/ and consumed by rewrite-npm-urls.sh when building code-server/VSCode.",
5+
"private": true,
6+
"dependencies": {
7+
"@emmetio/css-parser": "https://codeload.github.com/ramya-rao-a/css-parser/tar.gz/370c480ac103bd17c7bcfb34bf5d577dc40d3660",
8+
"@parcel/watcher": "https://codeload.github.com/parcel-bundler/watcher/tar.gz/1ca032aa8339260a8a3bcf825c3a1a71e3e43542"
9+
}
10+
}

codeserver/ubi9-python-3.12/prefetch-input/rhds/artifacts.in.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,6 @@ input:
6464
- url: https://mirror.openshift.com/pub/openshift-v4/s390x/clients/ocp/4.18.33/openshift-client-linux.tar.gz
6565
filename: openshift-client-linux-s390x.tar.gz
6666

67-
# GitHub tarball dependency for @emmetio/css-parser (used by VSCode emmet extension)
68-
# Filename must use .tgz to match rewrite-npm-urls.sh and download-npm.sh conventions.
69-
- url: https://codeload.github.com/ramya-rao-a/css-parser/tar.gz/370c480ac103bd17c7bcfb34bf5d577dc40d3660
70-
filename: npm/ramya-rao-a-css-parser-370c480ac103bd17c7bcfb34bf5d577dc40d3660.tgz
71-
72-
# GitHub tarball dependency for @parcel/watcher (v4.106.3 uses git ref instead of npm registry)
73-
# Filename must use .tgz to match rewrite-npm-urls.sh and download-npm.sh conventions.
74-
- url: https://codeload.github.com/parcel-bundler/watcher/tar.gz/1ca032aa8339260a8a3bcf825c3a1a71e3e43542
75-
filename: npm/parcel-bundler-watcher-1ca032aa8339260a8a3bcf825c3a1a71e3e43542.tgz
76-
7767
# VSCode marketplace extensions (built-in extensions bundled with code-server)
7868
- url: https://github.com/microsoft/vscode-js-debug-companion/releases/download/v1.1.3/ms-vscode.js-debug-companion.1.1.3.vsix
7969
filename: ms-vscode.js-debug-companion.1.1.3.vsix

0 commit comments

Comments
 (0)