Skip to content

NO-JIRA: Bump to 4.22.0-prerelease.3 SDK#903

Open
logonoff wants to merge 1 commit intoopenshift:mainfrom
logonoff:sdk
Open

NO-JIRA: Bump to 4.22.0-prerelease.3 SDK#903
logonoff wants to merge 1 commit intoopenshift:mainfrom
logonoff:sdk

Conversation

@logonoff
Copy link
Copy Markdown
Member

@logonoff logonoff commented Apr 24, 2026

Follow up to #876 which provides a more "official" path to consume getCSRFToken

Summary by CodeRabbit

  • Chores
    • Updated OpenShift dynamic plugin SDK packages to the latest prerelease.
  • Refactor
    • Switched internal CSRF token handling to use the updated SDK implementation.
    • Removed an unneeded development build override to simplify local builds.
  • Tests
    • Added a test-side stub to standardize CSRF token behavior during test runs.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 24, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@logonoff: This pull request explicitly references no jira issue.

Details

In response to this:

Follow up to #876 which provides a more "official" path to consume getCSRFToken

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot requested review from etmurasaki and zhuje April 24, 2026 15:55
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 758a6663-dd2b-49f1-8eb5-e69453531565

📥 Commits

Reviewing files that changed from the base of the PR and between c719d4b and 13353c0.

⛔ Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • web/cypress/dummy-sdk-internal.tsx
  • web/package.json
  • web/src/components/dashboards/perses/perses/datasource-cache-api.ts
  • web/webpack.config.ts
💤 Files with no reviewable changes (1)
  • web/webpack.config.ts
✅ Files skipped from review due to trivial changes (3)
  • web/cypress/dummy-sdk-internal.tsx
  • web/src/components/dashboards/perses/perses/datasource-cache-api.ts
  • web/package.json

Walkthrough

Bumped three dynamic-plugin-sdk packages to a new prerelease; switched CSRF token import to the SDK internal package and added a Cypress dummy exporter returning undefined; removed a webpack alias override that blocked resolving @console/internal; updated a TODO comment accordingly.

Changes

Cohort / File(s) Summary
Dependency updates
web/package.json
Updated versions for @openshift-console/dynamic-plugin-sdk, @openshift-console/dynamic-plugin-sdk-internal, @openshift-console/dynamic-plugin-sdk-webpack from ^4.22.0-prerelease.2 to exact 4.22.0-prerelease.3.
CSRF import & runtime
web/src/components/dashboards/perses/perses/datasource-cache-api.ts
Replaced getCSRFToken import to come from @openshift-console/dynamic-plugin-sdk-internal; revised TODO to mention notifying Console team about adding fetch override support.
Build config
web/webpack.config.ts
Removed the resolve.alias override that prevented resolving @console/internal in development.
Test shim
web/cypress/dummy-sdk-internal.tsx
Added exported getCSRFToken() stub that returns undefined for Cypress/testing environment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: bumping the OpenShift Console dynamic plugin SDK to version 4.22.0-prerelease.3, which aligns with the primary modifications across all changed files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed This PR is not applicable to the Stable and Deterministic Test Names check. The monitoring-plugin repository does not use the Ginkgo testing framework; it uses standard Go testing and Jest/Cypress instead.
Test Structure And Quality ✅ Passed The PR modifies only TypeScript, JavaScript, JSON, and webpack configuration files for the web UI. No Go test files using Ginkgo are modified.
Microshift Test Compatibility ✅ Passed This PR contains only frontend code changes in the web/ directory (TypeScript, webpack config, dependencies) and does not add any new Ginkgo e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This pull request does not add any Ginkgo e2e tests, making this SNO compatibility check not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Pull request modifies only web UI plugin code and build configuration files, not deployment manifests or operators. No Kubernetes scheduling constraints introduced.
Ote Binary Stdout Contract ✅ Passed PR modifies only web layer files (TypeScript, webpack config, dependencies). No Go code, test setup functions, or OTE binary logic affected.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add any Ginkgo e2e tests; only TypeScript/JavaScript source files and configuration are modified.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/src/components/dashboards/perses/perses/datasource-cache-api.ts`:
- Line 14: The build replaces `@openshift-console/dynamic-plugin-sdk-internal`
with cypress/dummy-sdk-internal.tsx which currently lacks getCSRFToken, causing
runtime errors when datasources-cache-api.ts calls getCSRFToken; add a mock
export named getCSRFToken to cypress/dummy-sdk-internal.tsx that returns a safe
value (e.g., a string token or null) so calls from the function that sets the
CSRF header succeed in standalone/Cypress mode; ensure the export signature
matches usage (no args, returns string | null) and is exported as a named
export.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 822b4efa-c0d3-4f09-b9cc-bd59f58b0373

📥 Commits

Reviewing files that changed from the base of the PR and between be776a6 and ea0731c.

⛔ Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • web/package.json
  • web/src/components/dashboards/perses/perses/datasource-cache-api.ts
  • web/webpack.config.ts
💤 Files with no reviewable changes (1)
  • web/webpack.config.ts

Comment thread web/src/components/dashboards/perses/perses/datasource-cache-api.ts
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/src/components/dashboards/perses/perses/datasource-cache-api.ts (1)

100-109: ⚠️ Potential issue | 🟠 Major

Use a collision-free cache key.

Concatenating kind, name, and project with - can collide for valid values that themselves contain hyphens, which would make the cache return the wrong datasource or suppress a needed lookup.

♻️ Proposed fix
 private generateKey(selector: DatasourceSelector, project?: string): string {
-  let key = selector.kind;
-  if (selector.name !== undefined) {
-    key += `-${selector.name}`;
-  }
-  if (project !== undefined) {
-    key += `-${project}`;
-  }
-  return key;
+  return JSON.stringify([selector.kind, selector.name ?? null, project ?? null]);
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/dashboards/perses/perses/datasource-cache-api.ts` around
lines 100 - 109, The generateKey function builds cache keys by concatenating
selector.kind, selector.name and project with hyphens which can collide when
those values contain hyphens; change generateKey (in datasource-cache-api.ts) to
produce a collision-free key by serializing the components deterministically
(e.g. JSON.stringify({kind: selector.kind, name: selector.name, project})) or by
joining them with a non-allowed delimiter (like '\0') or by prefixing each
component with a label (e.g. "k:", "n:", "p:") so that lookups using the
DatasourceSelector always map to a unique key.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@web/src/components/dashboards/perses/perses/datasource-cache-api.ts`:
- Around line 100-109: The generateKey function builds cache keys by
concatenating selector.kind, selector.name and project with hyphens which can
collide when those values contain hyphens; change generateKey (in
datasource-cache-api.ts) to produce a collision-free key by serializing the
components deterministically (e.g. JSON.stringify({kind: selector.kind, name:
selector.name, project})) or by joining them with a non-allowed delimiter (like
'\0') or by prefixing each component with a label (e.g. "k:", "n:", "p:") so
that lookups using the DatasourceSelector always map to a unique key.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 9021c0a6-d214-445c-98c0-0eb4e71ffa40

📥 Commits

Reviewing files that changed from the base of the PR and between ea0731c and c719d4b.

⛔ Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • web/cypress/dummy-sdk-internal.tsx
  • web/package.json
  • web/src/components/dashboards/perses/perses/datasource-cache-api.ts
  • web/webpack.config.ts
💤 Files with no reviewable changes (1)
  • web/webpack.config.ts
✅ Files skipped from review due to trivial changes (2)
  • web/package.json
  • web/cypress/dummy-sdk-internal.tsx

@vojtechszocs
Copy link
Copy Markdown

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 24, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 24, 2026

@logonoff: 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.

@jgbernalp
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 25, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jgbernalp, logonoff, 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 Apr 25, 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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants