Skip to content

feat: add process docs and scripts for yarn.lock only backports#2713

Draft
JessicaJHee wants to merge 3 commits into
redhat-developer:release-1.10from
JessicaJHee:lockfile-patch-scripts
Draft

feat: add process docs and scripts for yarn.lock only backports#2713
JessicaJHee wants to merge 3 commits into
redhat-developer:release-1.10from
JessicaJHee:lockfile-patch-scripts

Conversation

@JessicaJHee

@JessicaJHee JessicaJHee commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds tooling to backport transitive dependency CVE fixes in yarn.lock only for z-stream releases — without bumping source.json:repo-ref.

Tooling lives in scripts/yarnlock-backport/ (TypeScript CLI). Full workflow: user-guide/06-patch-management.md.

Commands

Typical usage:

export OVERLAY_WORKSPACE=../../workspaces/orchestrator
export PLUGINS_REPO=~/git/rhdh-plugins

yarnlock-backport prepare \
  --release 1.10 \
  --overlay-workspace "$OVERLAY_WORKSPACE" \
  --plugins-repo "$PLUGINS_REPO"

# yarn up vulnerable packages in $PLUGINS_REPO/workspaces/orchestrator

yarnlock-backport generate \
  --release 1.10 \
  --overlay-workspace "$OVERLAY_WORKSPACE" \
  --plugins-repo "$PLUGINS_REPO" \
  --cve 'CVE-…,CVE-…'

Artifacts per workspace

workspaces/[ws]/patches/
├── 0-cve-yarn-lock.patch    # CVE dependency bumps (max one; applied first)
├── cve-backports.yaml       # Auto-generated CVE tracking
└── 1-fix-something.patch    # Optional code/build patches (applied after 0-)

Documentation

  • CVE backport workflow in user-guide/06-patch-management.md (prepare → yarn up → generate, re-roll when patch apply fails, manifest format)
  • scripts/yarnlock-backport/README.md — quick start

Fork clones need an upstream remote for rhdh-plugin-export-overlays and rhdh-plugins; the tool syncs release branches and fetches pinned repo-ref SHAs from upstream.

Example output

Lightspeed CVE backport generated with this tooling: #2722

@JessicaJHee JessicaJHee requested review from a team, gashcrumb and kadel as code owners June 26, 2026 14:44
@JessicaJHee JessicaJHee force-pushed the lockfile-patch-scripts branch from 66ee59f to 7793d32 Compare June 26, 2026 18:11
@github-actions github-actions Bot added the non-workspace-changes PR changes files outside workspace directories label Jun 26, 2026

@jonkoops jonkoops 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.

As per redhat-developer/rhdh-adr#9 and architecture call agreements, all new scripts should be written using TypeScript as the preferred language.

Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/index.ts Fixed
@JessicaJHee JessicaJHee force-pushed the lockfile-patch-scripts branch 3 times, most recently from c0371e1 to 5ecd8a8 Compare June 30, 2026 17:23
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
@JessicaJHee JessicaJHee force-pushed the lockfile-patch-scripts branch from 5ecd8a8 to d0ef54a Compare June 30, 2026 18:15
Comment thread scripts/yarnlock-backport/paths.ts Fixed
Comment thread scripts/yarnlock-backport/paths.ts Fixed
Comment thread scripts/yarnlock-backport/paths.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
@JessicaJHee JessicaJHee force-pushed the lockfile-patch-scripts branch from d0ef54a to c37d759 Compare June 30, 2026 18:49
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
Comment thread scripts/yarnlock-backport/backport.ts Fixed
@JessicaJHee

Copy link
Copy Markdown
Member Author

@jonkoops Just converted the script over to TypeScript. I dismissed a few path validation SonarCloud warnings since the script requires cross repo access. Accepting the risk since this is a local only script meant to be run manually. We're looking to integrate this in the future in a GitHub actions as well, in that case the inputs will be controlled as well. PTAL :)

Signed-off-by: Jessica He <jhe@redhat.com>
@JessicaJHee JessicaJHee force-pushed the lockfile-patch-scripts branch from c37d759 to 03c7e7f Compare July 1, 2026 11:16
@JessicaJHee JessicaJHee marked this pull request as ready for review July 1, 2026 11:18

| Option | Required | Description |
|--------|----------|-------------|
| `--release` | yes | RHDH release line (e.g. `1.10` → branch `release-1.10` on rhdh-plugin-export-overlays) |

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.

non-blocking comment: if 1.10 means release-1.10, why dont the user specify direclty --release release-1.10

backports:
- cve_ids:
- CVE-2026-44486
- CVE-2026-44487

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.

non-blocking: in the example we should set at least one cve with override

@alizard0 alizard0 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.

lgtm

@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

@JessicaJHee JessicaJHee marked this pull request as draft July 2, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress non-workspace-changes PR changes files outside workspace directories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants