Skip to content

CONSOLE-5438: Expose ResourceYAMLEditor onCancel to the SDK - #16941

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
logonoff:CONSOLE-5438-oncancel
Aug 11, 2026
Merged

CONSOLE-5438: Expose ResourceYAMLEditor onCancel to the SDK#16941
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
logonoff:CONSOLE-5438-oncancel

Conversation

@logonoff

@logonoff logonoff commented Aug 10, 2026

Copy link
Copy Markdown
Member

Analysis / Root cause:

We were not allowing consumers to pass onCancel until now, but now others want to use the prop. It's been stable for a while so it seems reasonable to allow people to use it now

Solution description:

Adds passthrough for the onCancel prop to ResourceYAMLEditor

Summary by CodeRabbit

  • New Features

    • Added an optional cancel callback to the resource YAML editor, allowing custom behavior when users cancel editing.
    • Custom cancel handling overrides the editor’s default cancel-button behavior.
  • Documentation

    • Documented the new cancel callback and its behavior in the SDK API reference.
  • Bug Fixes

    • Improved localization key extraction to correctly handle singular and plural translation suffixes.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 10, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@logonoff: This pull request references CONSOLE-5438 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the ticket to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Analysis / Root cause:

We were not allowing consumers to pass onCancel until now, but now others want to use the prop. It's been stable for a while so it seems reasonable to allow people to use it now

Solution description:

Adds passthrough for the onCancel prop to ResourceYAMLEditor

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.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 49c354b9-9bb9-4ce0-b9fd-38b76c8fb3fe

📥 Commits

Reviewing files that changed from the base of the PR and between 37e2645 and 6d5ddc1.

📒 Files selected for processing (2)
  • dynamic-demo-plugin/i18next.config.ts
  • frontend/i18next.config.ts

Walkthrough

The public ResourceYAMLEditor API now supports an optional onCancel callback. The dynamic demo plugin builds the SDK directly from its package directory. i18next extraction removes plural suffixes from default values.

Changes

Resource YAML editor cancellation

Layer / File(s) Summary
ResourceYAMLEditor cancellation contract and wiring
frontend/packages/console-dynamic-plugin-sdk/src/extensions/console-types.ts, frontend/public/components/droppable-edit-yaml.tsx, frontend/packages/console-dynamic-plugin-sdk/src/api/core-api.ts, frontend/packages/console-dynamic-plugin-sdk/docs/api.md, frontend/packages/console-dynamic-plugin-sdk/CHANGELOG-core.md
Adds the optional onCancel callback, forwards it to DroppableEditYAML, and documents that it overrides the default cancel-button behavior.

Dynamic demo plugin SDK build

Layer / File(s) Summary
Direct SDK package build
dynamic-demo-plugin/package.json
Updates build-plugin-sdk to run the SDK package build directly and removes the previous chained frontend build and installation command.

i18next extraction defaults

Layer / File(s) Summary
Plural suffix normalization
dynamic-demo-plugin/i18next.config.ts, frontend/i18next.config.ts
The extraction callbacks remove trailing ._one and ._other suffixes from translation keys.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • openshift/console#16926: Both changes update i18next extraction behavior in the frontend and dynamic demo plugin configurations.

Suggested labels: kind/i18n

Suggested reviewers: spadgett, therealjon

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the root cause and solution but omits required testing, browser conformance, screenshot, additional information, and reviewer sections. Add the missing template sections and provide test cases, test setup, browser conformance status, screenshots if applicable, additional information, and reviewers or assignees.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Jira issue and the primary change: exposing ResourceYAMLEditor onCancel to SDK consumers.
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 The patch changes only configuration, documentation, and implementation files; it adds no test files or Ginkgo title declarations, so it introduces no unstable test name.
Test Structure And Quality ✅ Passed The PR changes only TypeScript, Markdown, JSON, and i18next configuration files; it adds no Ginkgo tests or cluster operations to review.
Microshift Test Compatibility ✅ Passed The pull request changes only TypeScript, JSON, and Markdown files; it adds no Ginkgo e2e tests or other tests requiring MicroShift compatibility review.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR adds no Go files or Ginkgo tests; changes are limited to TypeScript, JSON, and Markdown, so SNO compatibility review is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The diff modifies SDK TypeScript/docs, i18n configs, and package scripts only; it adds no deployment, operator, controller, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR changes only TypeScript, Markdown, and package configuration. It adds no OTE binary, Ginkgo suite, or process-level Go stdout write.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The commit changes SDK/UI/docs/configuration files only; it adds no Ginkgo e2e tests, IPv4 assumptions, or test connectivity requirements.
No-Weak-Crypto ✅ Passed The patch adds an onCancel passthrough and i18next/build configuration changes; scans found no weak algorithms, crypto APIs, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The PR adds no container/Kubernetes manifest and no prohibited privilege setting; the existing demo Deployment sets allowPrivilegeEscalation: false and runAsNonRoot: true.
No-Sensitive-Data-In-Logs ✅ Passed The commit adds no logging calls or sensitive-data logging. The new onCancel value is only typed, documented, and forwarded to the editor.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
openshift-ci Bot requested review from TheRealJon and spadgett August 10, 2026 21:20
@openshift-ci openshift-ci Bot added component/core Related to console core functionality component/sdk Related to console-plugin-sdk approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/demo-plugin Related to dynamic-demo-plugin plugin-api-changed Categorizes a PR as containing plugin API changes labels Aug 10, 2026
@logonoff
logonoff force-pushed the CONSOLE-5438-oncancel branch from 03d1fad to 37e2645 Compare August 10, 2026 21:20
@logonoff

Copy link
Copy Markdown
Member Author

/label px-approved
/label docs-approved

@openshift-ci openshift-ci Bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Aug 10, 2026
@logonoff
logonoff force-pushed the CONSOLE-5438-oncancel branch from 37e2645 to 6d5ddc1 Compare August 10, 2026 22:56
Adds passthrough for the `onCancel` prop to `ResourceYAMLEditor`

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@logonoff
logonoff force-pushed the CONSOLE-5438-oncancel branch from 6d5ddc1 to df831c5 Compare August 11, 2026 12:37
@vojtechszocs

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 11, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-console
/test e2e-playwright

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

@logonoff

Copy link
Copy Markdown
Member Author

tested onCancel locally in demo plugin and it worked
/verified by @logonoff

/label plugin-api-approved

@openshift-ci openshift-ci Bot added the plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer label Aug 11, 2026
@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Aug 11, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@logonoff: This PR has been marked as verified by @logonoff.

Details

In response to this:

tested onCancel locally in demo plugin and it worked
/verified by @logonoff

/label plugin-api-approved

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.

@logonoff

Copy link
Copy Markdown
Member Author

/test analyze backend frontend images okd-scos-images

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 9166684 into openshift:main Aug 11, 2026
11 checks passed
@logonoff
logonoff deleted the CONSOLE-5438-oncancel branch August 11, 2026 19:50
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. component/core Related to console core functionality component/sdk Related to console-plugin-sdk docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/demo-plugin Related to dynamic-demo-plugin lgtm Indicates that a PR is ready to be merged. plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer plugin-api-changed Categorizes a PR as containing plugin API changes px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants