Skip to content

Handle plugin manifest object as immutable#325

Draft
vojtechszocs wants to merge 1 commit into
openshift:mainfrom
vojtechszocs:deep-freeze-LoadedPlugin-manifest
Draft

Handle plugin manifest object as immutable#325
vojtechszocs wants to merge 1 commit into
openshift:mainfrom
vojtechszocs:deep-freeze-LoadedPlugin-manifest

Conversation

@vojtechszocs

Copy link
Copy Markdown
Contributor

Add optional peer dependency on type-fest to lib-core and lib-webpack

Cannot bundle type-fest types in generated dist/index.d.ts properly via API Extractor bundledPackages option due to some types not exported properly, e.g. ReadonlyMapDeep used in ReadonlyDeep triggers the ae-forgotten-export warning which cannot be avoided.

Suppressing the ae-forgotten-export warnings globally is not feasible. Using a custom tsdoc.json is also not feasible since API Extractor looks for tsdoc.json files relative to each source file's package and the lookup stops at the package boundary.

Handle plugin manifest object as immutable outside PluginStore impl.

Calling PluginStore.add{Pending,Loaded,Failed}Plugin methods will deep freeze the manifest object.

Plugin manifest should be treated as read-only (immutable) by consumers. Attempts to modify parts of the plugin manifest should now fail as per Object.freeze contract.

All objects returned from PluginStore.getPluginInfo method now use manifest: ReadonlyDeep<PluginManifest>.

Additional changes

  • expose freezeDeep utility in lib-core package
  • LoadedPlugin['loadedExtensions'] type changed to Readonly<Readonly<LoadedExtension>[]>

@vojtechszocs vojtechszocs force-pushed the deep-freeze-LoadedPlugin-manifest branch from 66e47ec to 8359813 Compare July 1, 2026 15:57
@openshift-ci openshift-ci Bot requested review from florkbr and karelhala July 1, 2026 15:58
@openshift-ci

openshift-ci Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vojtechszocs

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2026
@openshift-ci

openshift-ci Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@vojtechszocs: all tests passed!

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.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 30.93%. Comparing base (317459d) to head (8359813).

Files with missing lines Patch % Lines
packages/lib-core/src/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #325      +/-   ##
==========================================
+ Coverage   30.70%   30.93%   +0.23%     
==========================================
  Files          75       75              
  Lines        1964     1972       +8     
  Branches      349      350       +1     
==========================================
+ Hits          603      610       +7     
- Misses       1332     1333       +1     
  Partials       29       29              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vojtechszocs vojtechszocs marked this pull request as draft July 1, 2026 17:22
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants