Skip to content

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

Open
JessicaJHee wants to merge 1 commit into
redhat-developer:release-1.10from
JessicaJHee:lockfile-patch-scripts
Open

feat: add process docs and scripts for yarn.lock only backports#2713
JessicaJHee wants to merge 1 commit 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 :)

Comment thread user-guide/06-patch-management.md Outdated

| 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

Comment thread user-guide/06-patch-management.md Outdated
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

@JessicaJHee JessicaJHee marked this pull request as draft July 2, 2026 15:39
@JessicaJHee JessicaJHee force-pushed the lockfile-patch-scripts branch 2 times, most recently from 03ab477 to b52e910 Compare July 6, 2026 15:50
@JessicaJHee JessicaJHee marked this pull request as ready for review July 6, 2026 15:50
Signed-off-by: Jessica He <jhe@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@JessicaJHee JessicaJHee force-pushed the lockfile-patch-scripts branch from b52e910 to d6e3084 Compare July 6, 2026 17:17
@JessicaJHee JessicaJHee requested review from a team, karthikjeeyar and rohitkrai03 as code owners July 6, 2026 17:17
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE


if (!opts.dryRun) {
mkdirSync(dirname(opts.manifestPath), { recursive: true });
writeFileSync(opts.manifestPath, formatManifestDocument(opts.repoRef, rows));
@github-actions github-actions Bot removed the non-workspace-changes PR changes files outside workspace directories label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants