Skip to content

Commit a806ff3

Browse files
Merge pull request #969 from anwesha-palit-redhat/feat/SRVKP-10796
SRVKP-10796: Manual cherry picking commits of Yarn 4 migration + CVE commits in release-v1.16.x
2 parents 3aeedc0 + 954e136 commit a806ff3

20 files changed

Lines changed: 18899 additions & 26510 deletions

.ci-operator.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
build_root_image:
2-
name: nodejs-18
3-
namespace: openshift
4-
tag: latest
2+
name: console-plugin-test-cypress
3+
namespace: ci
4+
tag: node20-yarn4

.github/workflows/publish_container_image.yaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
1-
name: publish container images
1+
name: Build and Publish Container
2+
23
on:
34
push:
45
branches:
56
- main
67
- release-v* # example: release-v1.14
8+
- main_ocp_4.22
79
tags: ['v*']
10+
pull_request:
11+
branches:
12+
- main
13+
- main_ocp_4.22
14+
workflow_dispatch:
815

916
jobs:
1017
setup:
1118
name: build container
1219
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
packages: write
1323

1424
steps:
1525
- name: Checkout source code
1626
uses: actions/checkout@v4
1727

1828
- uses: actions/setup-node@v4
1929
with:
20-
node-version: '18'
30+
node-version: '20'
31+
32+
- name: Enable Corepack
33+
run: corepack enable
2134

2235
- uses: docker/setup-buildx-action@v3
2336

2437
- name: Login in to ghcr.io registry
38+
if: github.event_name != 'pull_request'
2539
uses: docker/login-action@v3
2640
with:
2741
registry: ghcr.io
@@ -41,5 +55,5 @@ jobs:
4155
run: ./scripts/build_container.sh
4256
env:
4357
SUPPORT_MULTI_ARCH: "true"
44-
CONSOLE_PLUGIN_IMAGE_REPO: 'ghcr.io/${{ github.repository }}'
45-
CONSOLE_PLUGIN_IMAGE_TAG: '${{ github.ref_name }}'
58+
CONSOLE_PLUGIN_IMAGE_REPO: ${{ github.event_name == 'pull_request' && format('ttl.sh/{0}/console-plugin-pr-{1}', github.repository, github.event.pull_request.number) || format('ghcr.io/{0}', github.repository) }}
59+
CONSOLE_PLUGIN_IMAGE_TAG: ${{ github.event_name == 'pull_request' && '24h' || github.ref_name }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ integration-tests/screenshots
77
yarn-error.log
88
.DS_Store
99
*.pem
10-
integration-tests/cypress-a11y-report.json
10+
integration-tests/cypress-a11y-report.json
11+
.yarn/

.konflux/dockerfiles/console-plugin.Dockerfile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1-
ARG BUILDER=registry.redhat.io/ubi8/nodejs-18@sha256:1a109c7d4a268e897a22b87f505eef326864f5ff74d4e2b7f0706605c9c5aba5
2-
ARG RUNTIME=registry.redhat.io/ubi8/nginx-124@sha256:b02afddd2dd7d754bda1226fe3141f4b934f1e2fab3a1ed1ddc9bd476a8ee3e6
1+
ARG BUILDER=registry.redhat.io/ubi8/nodejs-20@sha256:2a71011f69e5cfc26c55d99e07d0b7ca7da25879338fdae7045cdb2ad19711da
2+
ARG RUNTIME=registry.redhat.io/ubi8/nginx-124@sha256:0c48ade8db59c4cf3be128bace64b23e132b587b2c3a7f53ad11380f14ad3b9b
33

44
FROM $BUILDER AS builder-ui
55

66
WORKDIR /go/src/github.com/openshift-pipelines/console-plugin
77
COPY . .
8-
RUN npm install -g yarn-1.22.22.tgz
9-
COPY .konflux/yarn.lock .
10-
COPY .konflux/package.json .
11-
RUN set -e; for f in patches/*.patch; do echo ${f}; [[ -f ${f} ]] || continue; git apply ${f}; done
12-
RUN yarn install --offline --frozen-lockfile --ignore-scripts && \
8+
#Install Yarn
9+
RUN if [[ -d /cachi2/output/deps/npm/ ]]; then \
10+
npm install -g /cachi2/output/deps/npm/yarnpkg-cli-dist-4.6.0.tgz; \
11+
YARN_ENABLE_NETWORK=0; \
12+
else \
13+
echo "ERROR: Hermetic npm deps not injected"; \
14+
exit 1; \
15+
fi
16+
17+
# Install dependencies & build
18+
USER root
19+
RUN CYPRESS_INSTALL_BINARY=0 yarn install --immutable && \
1320
yarn build
1421

22+
1523
FROM $RUNTIME
1624
ARG VERSION=console-plugin-1.16.4
1725

.konflux/npm/package-lock.json

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

.konflux/npm/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "yarn4-nodejs22-ubil9-minimal",
3+
"version": "1.0.0",
4+
"description": "Konflux image containing rebuilds for tooling to assist in building with yarn",
5+
"dependencies": {
6+
"@yarnpkg/cli-dist": "4.6.0"}
7+
}

0 commit comments

Comments
 (0)