Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ tmp/
.env
.yarn-cache
.yarnrc
.pnp.*
.yarn/unplugged
.yarn/build-state.yml
.yarn/cache
.yarn/cache/
.yarn/unplugged/
hermeto*
874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.4.cjs

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
yarnPath: ".yarn/releases/yarn-3.6.4.cjs"
nodeLinker: "node-modules" # safer than PnP for Hermeto
enableGlobalCache: false
enableImmutableCache: false
supportedArchitectures:
cpu:
- x64
- arm64
libc:
- glibc
- musl
os:
- darwin
- linux

27 changes: 10 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
FROM registry.access.redhat.com/ubi8/nodejs-16 as builder

USER root

# Set up working directory
FROM registry.access.redhat.com/ubi8/nodejs-18 AS builder
COPY . /mig-ui
WORKDIR /mig-ui
USER root

# Install Yarn from vendored tarball (not internet, not raw JS)
COPY third-party/yarn-v1.22.22.tar.gz /tmp/yarn.tar.gz
RUN npm install -g /tmp/yarn.tar.gz && rm /tmp/yarn.tar.gz
# Use Corepack if available, or use vendored Yarn binary
# You can skip installing Yarn globally — Berry is self-contained
RUN node .yarn/releases/yarn-*.cjs install --immutable

# Configure Yarn for offline mirror
RUN echo 'yarn-offline-mirror "/mig-ui/.yarn-cache"' >> .yarnrc && \
echo 'yarn-offline-mirror-pruning false' >> .yarnrc
# Build the app using env-aware commands (no internet needed)
RUN node .yarn/releases/yarn-*.cjs run build

# Install dependencies and build using offline cache
RUN yarn install --offline --frozen-lockfile && \
yarn build && \
rm -rf /mig-ui/.yarn-cache /mig-ui/src /mig-ui/config /mig-ui/scripts /mig-ui/tests
RUN node .yarn/releases/yarn-*.cjs workspaces focus --production --all

# Production image
FROM registry.access.redhat.com/ubi8/nodejs-16
# Final runtime image
FROM registry.access.redhat.com/ubi8/nodejs-18

COPY --from=builder /mig-ui/dist /opt/app-root/src/staticroot
COPY --from=builder /mig-ui/public/favicon.ico /opt/app-root/src/staticroot
Expand Down
26 changes: 8 additions & 18 deletions downstream_dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#@follow_tag(registry.redhat.io/ubi8/nodejs-16:latest)
FROM registry.redhat.io/ubi8/nodejs-16:1-161 AS builder
#@follow_tag(registry.redhat.io/ubi8/nodejs-18:latest)
FROM registry.redhat.io/ubi8/nodejs-18:1-161 AS builder

# First copy the application source
COPY --chown=1001:0 $REMOTE_SOURCES/mig-ui/app $APP_ROOT/src
Expand All @@ -8,34 +8,24 @@ COPY --chown=1001:0 $REMOTE_SOURCES/mig-ui/app $APP_ROOT/src
USER root
ADD . .

# Install Yarn from tarball
RUN container-entrypoint npm config set offline true
RUN container-entrypoint npm install --no-audit --verbose -g ./yarn-v1.22.19.tar.gz

# Needed dev packages for native builds
RUN dnf install -y openssl-devel python3
RUN dnf module install -y nodejs:16/development
RUN yarn config set nodedir /usr
RUN dnf module install -y nodejs:18/development

# Source cachito environment
RUN source $REMOTE_SOURCES_DIR/mig-ui/cachito.env

# COPY cached node_modules and yarn offline mirror
COPY --chown=1001:0 $REMOTE_SOURCES_DIR/mig-ui/deps/yarn-classic $APP_ROOT/src/node_modules
COPY --chown=1001:0 $REMOTE_SOURCES_DIR/mig-ui/deps/yarn-cache $APP_ROOT/src/.yarn-cache

# ✅ Ensure yarn uses the offline cache
RUN yarn config set yarn-offline-mirror $APP_ROOT/src/.yarn-cache
RUN yarn config set yarn-offline-mirror-pruning false
# COPY cached node_modules and yarn cache for Berry
COPY --chown=1001:0 $REMOTE_SOURCES_DIR/mig-ui/deps/yarn-cache $APP_ROOT/src/.yarn/cache

# ✅ Build with offline mode
# ✅ Build with Yarn Berry - uses vendored binary, no internet needed
ENV BRAND_TYPE="RedHat"
ENV CHROMEDRIVER_SKIP_DOWNLOAD=true \
SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true \
CYPRESS_INSTALL_BINARY=0

RUN container-entrypoint yarn install --offline
RUN container-entrypoint bash -c 'BRAND_TYPE=RedHat yarn build --offline'
RUN container-entrypoint node .yarn/releases/yarn-*.cjs install --immutable
RUN container-entrypoint bash -c 'BRAND_TYPE=RedHat node .yarn/releases/yarn-*.cjs run build'

# Optional: may already be covered by vendoring
# RUN container-entrypoint yarn install --offline --production
Expand Down
19 changes: 8 additions & 11 deletions konflux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
FROM registry.redhat.io/ubi8/nodejs-16:latest AS builder
FROM registry.redhat.io/ubi8/nodejs-18:latest AS builder
COPY --chown=1001:0 . $APP_ROOT/src
WORKDIR $APP_ROOT/src
COPY . .
USER root
RUN dnf install -y openssl-devel python3
RUN dnf module install -y nodejs:16/development
RUN container-entrypoint npm config set offline true
RUN container-entrypoint npm install --no-audit --verbose -g ./hack/build/third-party/yarn-v1.22.22.tar.gz
RUN yarn config set nodedir /usr
RUN yarn config set yarn-offline-mirror /cachi2/output/deps/yarn-classic
RUN yarn config set yarn-offline-mirror-pruning false
RUN dnf module install -y nodejs:18/development

ENV BRAND_TYPE="RedHat"
ENV CHROMEDRIVER_SKIP_DOWNLOAD=true \
SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true \
CYPRESS_INSTALL_BINARY=0

RUN container-entrypoint yarn install --offline
RUN container-entrypoint bash -c 'BRAND_TYPE=RedHat yarn build'
RUN container-entrypoint yarn install --offline --production
# Use Yarn Berry - vendored binary, hermetic build
RUN container-entrypoint node .yarn/releases/yarn-*.cjs install --immutable
RUN container-entrypoint bash -c 'BRAND_TYPE=RedHat node .yarn/releases/yarn-*.cjs run build'
# Install production dependencies only (equivalent to yarn install --production in Classic)
RUN container-entrypoint bash -c 'NODE_ENV=production node .yarn/releases/yarn-*.cjs install --immutable'

FROM registry.redhat.io/ubi8/nodejs-16-minimal:latest
FROM registry.redhat.io/ubi8/nodejs-18-minimal:latest
USER 1001
COPY --from=builder $APP_ROOT/src/dist /opt/app-root/src/staticroot
COPY --from=builder $APP_ROOT/src/public/favicon.ico /opt/app-root/src/staticroot
Expand Down
38 changes: 25 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"@testing-library/react": "^11.2.5",
"@types/jest": "^26.0.0",
"@types/node": "^11.13.6",
"@types/react": "^16.9.34",
"@types/react-dom": "^17.0.6",
"@types/react-router-dom": "^5.1.7",
"@types/react": "17",
"@types/react-dom": "17",
"@types/react-router-dom": "5",
"@types/react-router-hash-link": "^2.4.0",
"@types/redux-logger": "^3.0.8",
"@types/testing-library__jest-dom": "^5.9.1",
Expand Down Expand Up @@ -67,7 +67,7 @@
"style-loader": "^2.0.0",
"ts-jest": "^26.5.4",
"ts-loader": "^9.1.0",
"typescript": "^4.2.3",
"typescript": "^5.8.3",
"webpack": "^5.94.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.2",
Expand All @@ -84,12 +84,11 @@
"@testing-library/dom": "^7.19.0",
"@testing-library/user-event": "^12.0.11",
"@types/q": "^1.5.4",
"@types/react-redux": "^7.1.16",
"@types/redux-saga": "^0.10.5",
"axios": "^1.7.4",
"classnames": "^2.2.6",
"compression": "^1.7.4",
"connected-react-router": "^6.9.1",
"connected-react-router": "^6.9.3",
"dayjs": "^1.9.5",
"ejs": "^3.1.7",
"express": "^4.20.0",
Expand All @@ -103,14 +102,15 @@
"lodash": "^4.17.21",
"process": "^0.11.10",
"q": "^1.5.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react": "17",
"react-dom": "17",
"react-fast-compare": "^3.2.0",
"react-hot-loader": "^4.13.0",
"react-json-view": "^1.21.3",
"react-redux": "^7.2.4",
"react-router-dom": "^5.1.2",
"react-redux": "^7.2.9",
"react-router-dom": "5",
"react-router-hash-link": "^2.4.3",
"redux": "^5.0.1",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-saga": "^1.0.3",
Expand All @@ -130,7 +130,19 @@
"tough-cookie": "4.1.3",
"follow-redirects": "^1.15.6",
"braces": "^3.0.3",
"path-to-regexp": "0.1.10"

}
"path-to-regexp": "0.1.10",
"express": "^4.19.2"
},
"packageManager": "yarn@3.6.4",
"directories": {
"doc": "docs",
"lib": "lib"
},
"keywords": [
"crane",
"migration",
"ui",
"mtc"
],
"author": "Ian Bolton"
}
6 changes: 4 additions & 2 deletions src/app/cluster/duck/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ function* removeClusterSaga(action: any): Generator<any, any, any> {
yield put(ClusterActions.removeClusterSuccess(name));
yield put(alertSuccessTimeout(`Successfully removed cluster "${name}"!`));
} catch (err) {
yield put(alertErrorTimeout(err.message));
const errorMessage = err instanceof Error ? err.message : 'An error occurred';
yield put(alertErrorTimeout(errorMessage));
yield put(ClusterActions.removeClusterFailure(err));
}
}
Expand Down Expand Up @@ -214,9 +215,10 @@ function* addClusterRequest(action: any): Generator<any, any, any> {
);
}
} catch (err) {
const errorMessage = err instanceof Error ? err.message : 'An error occurred';
yield put(
ClusterActions.setClusterAddEditStatus(
createAddEditStatusWithMeta(AddEditState.Critical, AddEditMode.Add, err.message, '')
createAddEditStatusWithMeta(AddEditState.Critical, AddEditMode.Add, errorMessage, '')
)
);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/app/debug/duck/utils.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
}

.activeHighlight {
background-color: #E7F1FA;
border: #E7F1FA solid 1px;
background-color: #e7f1fa;
border: #e7f1fa solid 1px;
border-radius: 7px;
font-weight: bold;
& > div {
Expand Down
Loading