Skip to content

feat(prepare-sources): implement plugin-removal module (RHIDP-15835) - #174

Open
davidfestal wants to merge 2 commits into
redhat-developer:mainfrom
davidfestal:fix-15835
Open

davidfestal wants to merge 2 commits into
redhat-developer:mainfrom
davidfestal:fix-15835

Conversation

@davidfestal

@davidfestal davidfestal commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

plugin-removal pipeline module

Implements the plugin-removal step of the source-preparation pipeline (RHIDP-15835).

What it does:

  • Intersects plugins-list.yaml with rhdh-supported-packages.txt to keep only supported plugins
  • Preserves embedded package sources (matched by npm name from dist-dynamic/embedded/*/package.json)
  • Removes infrastructure directories (packages/app, packages/backend, examples/, .storybook, node_modules)
  • Deletes remaining non-supported plugin directories
  • Rewrites plugins-list.yaml preserving comments, blank lines, and CLI args

Pipeline changes:

  • Adds overlayRepoRoot to PipelineInputs (needed to read tier-list files from the overlay repo root)
  • Extends the fixture loader with input/overlay-root/ support for tier-list test scenarios

Tests: 5 fixture tests + 8 unit tests, 100% coverage (statements, branches, functions, lines).

NOTE: Based on top of PR #166 which should be merged first

Generate manifest.json (workspace package inventory) and, when the
workspace contains backstage:^ dependencies, backstage-manifest.json
with @backstage package metadata extracted from yarn.lock and
validated against versions.backstage.io.

Add a zero-dependency Yarn Berry lockfile parser/serializer for
round-trip fidelity, shared manifest types, and fixture-based tests.
Extend test utilities with a mockFetch helper and wire the module
into the pipeline runner. Add @vitest/coverage-v8 and ignore the
coverage directory.

Assisted-by: Cursor
Signed-off-by: David Festal <dfestal@redhat.com>
Intersect `plugins-list.yaml` with `rhdh-supported-packages.txt` for the
current workspace, preserve packages referenced by
`dist-dynamic/embedded/*/package.json`, remove infrastructure directories
(`packages/app`, `packages/backend`, `.storybook`, `examples/`,
`node_modules`), and delete remaining non-supported plugin directories.
Rewrite the filtered `plugins-list.yaml` back to the overlay path,
preserving full lines including export CLI args.

Expose `overlayRepoRoot` on `PipelineInputs` so tier-list files can be read
from the overlay repository root instead of resolving `../..` inside the
module. Update the fixture loader to support an `input/overlay-root/`
directory for tier-list fixtures.

Add the module implementation, unit tests, fixtures, and README.md;
wire the module into the pipeline runner.

Assisted-by: Cursor
Signed-off-by: David Festal <dfestal@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: David Festal <dfestal@redhat.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

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.

1 participant