Skip to content

Fix es5 ext#14

Closed
weshayutin wants to merge 31 commits into
migtools:oadp-devfrom
weshayutin:fix_es5-ext
Closed

Fix es5 ext#14
weshayutin wants to merge 31 commits into
migtools:oadp-devfrom
weshayutin:fix_es5-ext

Conversation

@weshayutin

@weshayutin weshayutin commented May 15, 2026

Copy link
Copy Markdown

Description

Eliminate es5-ext via pnpm Override

Background

  • Problem: es5-ext@0.10.64 is a transitive dependency pulled in via vue-reader -> epubjs@0.3.93 -> event-emitter -> es5-ext
  • CVE-2024-27088 (ReDoS, CVSS 0.0) is already patched in the installed version, but eliminating es5-ext entirely removes future risk

Chosen Approach: pnpm Override with @likecoin/epub-ts

@likecoin/epub-ts (v0.6.3, Apr 2026) is a TypeScript rewrite of epubjs v0.3.93 that:

  • Has the exact same API (drop-in replacement, "change one import line")
  • Has only 1 runtime dependency (jszip) -- no es5-ext, no event-emitter, no d, no es6-iterator
  • Is 56.7% smaller bundle, significantly faster
  • Exports all the same classes: Book, Rendition, Themes, Contents, etc.
  • Supports requestCredentials, getRendition, themes.override -- everything used in frontend/src/views/files/Preview.vue

Summary by CodeRabbit

Release Notes

  • New Features

    • Added option to disable user profile functionality in branding settings
    • Added configurable default login user for streamlined authentication
    • Help menu now dynamically displays available actions based on user permissions
  • Chores

    • Enhanced container builds with improved health checks and multi-stage compilation
    • Updated CI/CD workflows and dependency management for better compatibility

Review Change Stack

weshayutin and others added 30 commits March 16, 2026 19:53
Signed-off-by: Wesley Hayutin <weshayutin@gmail.com>
build: first pass at a konflux dockerfile
Hermeto/Cachi2 requires package-lock.json (or npm-shrinkwrap.json) for
npm dependency pre-fetching during hermetic Konflux builds. pnpm-lock.yaml
is not supported by Hermeto's npm handler.

Generated via: npm install --package-lock-only
Lockfile version: 3

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
UPSTREAM: <carry>: Add package-lock.json for Konflux hermetic builds
New config option:
  --branding.disableUserProfile

This option allows to disable User Profile together
with User settings.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
New config option:
  --branding.defaultLoginUser "username"

This option allows to provide default Username, which will result
in hiding username field from the welcome page.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Removes Help options "Delete" and "Rename" if the
following permissions are revoked from a particular
user:

  --perm.delete=false
  --perm.rename=false

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Add multi-stage Containerfile for UBI-based builds.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Adds OWNERS file.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Fix downstream changes to match upstream refactored functions.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Signed-off-by: Wesley Hayutin <weshayutin@gmail.com>
Hermeto/Cachi2 requires package-lock.json (or npm-shrinkwrap.json) for
npm dependency pre-fetching during hermetic Konflux builds. pnpm-lock.yaml
is not supported by Hermeto's npm handler.

Generated via: npm install --package-lock-only
Lockfile version: 3

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In hermetic Konflux/Cachi2 builds, network access is blocked, causing
`npm install -g pnpm` to fail with ENOTFOUND when trying to reach
registry.npmjs.org.

Replace pnpm with npm clean-install, consistent with how mta-ui and
mta-static-report handle npm dependencies in hermetic builds.
package-lock.json is already present in the frontend/ directory.

Changes:
- Remove pnpm install, use npm clean-install --ignore-scripts --no-audit --verbose
- Replace pnpm run build with npm run typecheck && npx vite build
  (the package.json build script references pnpm internally)
- Remove go mod download, Cachi2 pre-fetches Go modules and makes
  them available via cachi2.env GOMODCACHE
- Consolidate LABEL instructions into single multi-line block
- Fix extra space in io.k8s.description label

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous package-lock.json was out of sync with package.json after
rebase, causing version mismatches (e.g. vite@7.3.2 vs ^8.0.0) and
preventing Cachi2 from properly pre-fetching npm dependencies.

Regenerated using registry.access.redhat.com/ubi9/nodejs-24:latest
(Node.js v24.13.0, npm 11.6.2) to match the builder image.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use npm instead of pnpm for hermetic Konflux builds
New config option:
  --branding.disableUserProfile

This option allows to disable User Profile together
with User settings.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
New config option:
  --branding.defaultLoginUser "username"

This option allows to provide default Username, which will result
in hiding username field from the welcome page.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Removes Help options "Delete" and "Rename" if the
following permissions are revoked from a particular
user:

  --perm.delete=false
  --perm.rename=false

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Add multi-stage Containerfile for UBI-based builds.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Adds OWNERS file.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Fix downstream changes to match upstream refactored functions.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Signed-off-by: Wesley Hayutin <weshayutin@gmail.com>
Hermeto/Cachi2 requires package-lock.json (or npm-shrinkwrap.json) for
npm dependency pre-fetching during hermetic Konflux builds. pnpm-lock.yaml
is not supported by Hermeto's npm handler.

Generated via: npm install --package-lock-only
Lockfile version: 3

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In hermetic Konflux/Cachi2 builds, network access is blocked, causing
`npm install -g pnpm` to fail with ENOTFOUND when trying to reach
registry.npmjs.org.

Replace pnpm with npm clean-install, consistent with how mta-ui and
mta-static-report handle npm dependencies in hermetic builds.
package-lock.json is already present in the frontend/ directory.

Changes:
- Remove pnpm install, use npm clean-install --ignore-scripts --no-audit --verbose
- Replace pnpm run build with npm run typecheck && npx vite build
  (the package.json build script references pnpm internally)
- Remove go mod download, Cachi2 pre-fetches Go modules and makes
  them available via cachi2.env GOMODCACHE
- Consolidate LABEL instructions into single multi-line block
- Fix extra space in io.k8s.description label

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous package-lock.json was out of sync with package.json after
rebase, causing version mismatches (e.g. vite@7.3.2 vs ^8.0.0) and
preventing Cachi2 from properly pre-fetching npm dependencies.

Regenerated using registry.access.redhat.com/ubi9/nodejs-24:latest
(Node.js v24.13.0, npm 11.6.2) to match the builder image.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Disable Validate Title check (semantic commit PR titles are
not used downstream). Fix Go version to 1.25 and add oadp-*
branches to CI triggers.
requires removal of es5-ext
in depth explanation in doc/eliminate-es5-ext.md

Signed-off-by: Wesley Hayutin <weshayutin@gmail.com>
@openshift-ci openshift-ci Bot requested a review from Joeavaikath May 15, 2026 14:56
@openshift-ci

openshift-ci Bot commented May 15, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: weshayutin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented May 15, 2026

Copy link
Copy Markdown

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@weshayutin weshayutin closed this May 15, 2026
@openshift-ci

openshift-ci Bot commented May 15, 2026

Copy link
Copy Markdown

@weshayutin: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/images f39aed0 link true /test images

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d066c794-855a-4fc0-842f-3b2465115659

📥 Commits

Reviewing files that changed from the base of the PR and between 5919ff8 and f39aed0.

⛔ Files ignored due to path filters (2)
  • frontend/package-lock.json is excluded by !**/package-lock.json
  • frontend/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • .github/workflows/ci.yaml
  • .github/workflows/lint-pr.yaml
  • Containerfile
  • OWNERS
  • cmd/config.go
  • doc/eliminate-es5-ext.md
  • docker/ubi/healthcheck.sh
  • frontend/index.html
  • frontend/package.json
  • frontend/src/components/Sidebar.vue
  • frontend/src/components/prompts/Help.vue
  • frontend/src/i18n/en.json
  • frontend/src/router/index.ts
  • frontend/src/types/settings.d.ts
  • frontend/src/utils/constants.ts
  • frontend/src/views/Login.vue
  • frontend/src/views/Settings.vue
  • frontend/src/views/settings/Global.vue
  • http/static.go
  • konflux.Dockerfile
  • settings/branding.go

📝 Walkthrough

Walkthrough

This PR implements user profile control branding features while introducing containerization infrastructure, updating CI toolchain versions, establishing code ownership, and addressing a frontend dependency security issue. The changes span backend configuration, HTTP template injection, and frontend UI gating to conditionally disable user profile access and support pre-filled login credentials.

Changes

User Profile Control Feature

Layer / File(s) Summary
Backend branding configuration
settings/branding.go, cmd/config.go, http/static.go, frontend/index.html
Branding struct adds DisableUserProfile and DefaultLoginUser fields; CLI flags wire these values into the configuration; HTTP handler injects them into the frontend template context.
Frontend configuration contracts
frontend/src/types/settings.d.ts, frontend/src/utils/constants.ts
SettingsBranding TypeScript interface extends with new boolean and string fields; frontend constants extract DisableUserProfile and DefaultLoginUser from window.FileBrowser configuration.
Frontend UI implementation
frontend/src/i18n/en.json, frontend/src/router/index.ts, frontend/src/components/Sidebar.vue, frontend/src/components/prompts/Help.vue, frontend/src/views/Login.vue, frontend/src/views/Settings.vue, frontend/src/views/settings/Global.vue
Router guards redirect profile and settings navigation when disableUserProfile is true; sidebar profile button conditionally hidden; login view hides username input when defaultLoginUser is pre-filled; global settings expose branding configuration UI; help prompts respect user permissions; translations added for new setting label.

Infrastructure, Build & Dependency Updates

Layer / File(s) Summary
Multi-stage container builds
Containerfile, konflux.Dockerfile, docker/ubi/healthcheck.sh
Two production-ready multi-stage Dockerfile definitions compile frontend assets with pnpm and backend binary with Go; emit minimal UBI-based runtime images with non-root execution, persistent volumes, port 8080, and health checks.
CI workflow and code ownership
.github/workflows/ci.yaml, .github/workflows/lint-pr.yaml, OWNERS
Go toolchain downgraded from 1.26 to 1.25 across lint, test, build, and release jobs; PR title validation disabled; OWNERS file establishes approvers and reviewers for codebase governance.
Frontend dependency security and documentation
frontend/package.json, doc/eliminate-es5-ext.md
pnpm override aliases epubjs to @likecoin/epub-ts@^0.6.3 to eliminate the es5-ext transitive dependency and CVE-2024-27088; documentation describes the dependency chain, API compatibility, and implementation steps.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • OWNERS file oadp-cli#152: The PR adds an OWNERS file with explicitly configured approvers and reviewers lists, directly implementing the code ownership structure requested in that issue.

Poem

🐰 A profile that hides when you wish it away,
Default logins appear without delay,
Containers are built in stages so neat,
While dependencies shrink with a security feat,
The filebrowser dances in style today!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix_es5-ext

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants