Skip to content

Conversation

vojtechszocs
Copy link
Contributor

@vojtechszocs vojtechszocs commented Oct 1, 2025

Created in collaboration with @Leo6Leo

This fixes a bug where a dynamic plugin would use its own copy of getConsoleRequestHeaders function, in which case the code always returns undefined. Instead, calling this function should always return an object with relevant HTTP headers.

To verify the changes, modify dynamic-demo-plugin/src/components/UtilityConsumer.tsx file as follows:

  • add the following import:
    // Do NOT use non-index import '@openshift-console/dynamic-plugin-sdk/lib/utils/fetch'
    import { getConsoleRequestHeaders } from '@openshift-console/dynamic-plugin-sdk';
  • add the following code into ConsoleFetchConsumer component:
    const [data, setData] = React.useState();
    // new code below
    const consoleHeaders = getConsoleRequestHeaders();
    console.log('# consoleHeaders', consoleHeaders); // log to browser console
  • run Console Bridge server with demo plugin enabled (demo plugin server should run on port 9001):
    ./bin/bridge -plugins console-demo-plugin=http://localhost:9001/ -i18n-namespaces=plugin__console-demo-plugin
  • on Console page, expand nav menu section "Demo Plugin" and click on "Test Utilities"
  • open browser dev tools and check that # consoleHeaders have been logged as expected

@vojtechszocs vojtechszocs changed the title Expose getConsoleRequestHeaders function via Console plugin API OCPBUGS-60969: Expose getConsoleRequestHeaders function via Console plugin API Oct 1, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 1, 2025
@openshift-ci-robot
Copy link
Contributor

@vojtechszocs: This pull request references Jira Issue OCPBUGS-60969, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.21.0) matches configured target version for branch (4.21.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

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-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Oct 1, 2025
@openshift-ci openshift-ci bot requested review from jhadvig, spadgett and yapei October 1, 2025 18:46
@openshift-ci openshift-ci bot added component/sdk Related to console-plugin-sdk plugin-api-changed Categorizes a PR as containing plugin API changes approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 1, 2025
Copy link
Contributor

@Leo6Leo Leo6Leo left a comment

Choose a reason for hiding this comment

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

Only a minor comment on the function description, otherwise lgtm. Tested locally, the header is being created correctly with the right store instance. Thanks for the fix! @vojtechszocs

@Leo6Leo
Copy link
Contributor

Leo6Leo commented Oct 3, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 3, 2025
@Leo6Leo
Copy link
Contributor

Leo6Leo commented Oct 3, 2025

/label tide/merge-method-squash

QE approval + verify:
/assign @yapei

@openshift-ci openshift-ci bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Oct 3, 2025
@vojtechszocs
Copy link
Contributor Author

/hold

Seeing some webpack build warnings, looking into it.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 3, 2025
@vojtechszocs
Copy link
Contributor Author

/hold cancel

I've confirmed the webpack build warnings are also present without this PR, we can fix these later on.

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 3, 2025
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 3, 2025
@Leo6Leo
Copy link
Contributor

Leo6Leo commented Oct 3, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 3, 2025
Copy link
Contributor

openshift-ci bot commented Oct 3, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Leo6Leo, vojtechszocs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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

@vojtechszocs
Copy link
Contributor Author

/retest

@Leo6Leo
Copy link
Contributor

Leo6Leo commented Oct 6, 2025

/retest
From the error logs of the CI, it seems just flaky tests.

Copy link
Contributor

openshift-ci bot commented Oct 6, 2025

@vojtechszocs: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn 6842678 link false /test okd-scos-e2e-aws-ovn

Full PR test history. Your PR dashboard.

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.

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/sdk Related to console-plugin-sdk jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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. plugin-api-changed Categorizes a PR as containing plugin API changes tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants