Skip to content

ROX-29845: Add start-console script to enable local plugin dev#16094

Merged
dvail merged 1 commit intomasterfrom
dv/ROX-29845-add-start-console-dev-script
Jul 25, 2025
Merged

ROX-29845: Add start-console script to enable local plugin dev#16094
dvail merged 1 commit intomasterfrom
dv/ROX-29845-add-start-console-dev-script

Conversation

@dvail
Copy link
Copy Markdown
Contributor

@dvail dvail commented Jul 18, 2025

Description

Adds the start-ocp-console.sh script which runs a local version of the OCP console configured for plugin development.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

Follow the steps described in the README changes and visit http://localhost:9000/security-TODO (placeholder URL)
image

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Jul 18, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@red-hat-konflux
Copy link
Copy Markdown
Contributor

Caution

There are some errors in your PipelineRun template.

PipelineRun Error
quay-proxy no kind "ImageDigestMirrorSet" is registered for version "config.openshift.io/v1" in scheme "k8s.io/client-go/kubernetes/scheme/register.go:83"

@dvail dvail force-pushed the dv/ROX-29845-add-start-console-dev-script branch from 081487f to 0e16c8e Compare July 18, 2025 17:16
@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Jul 18, 2025

Images are ready for the commit at e835448.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.9.x-310-ge835448dba.

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.69%. Comparing base (f2680c7) to head (e835448).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #16094      +/-   ##
==========================================
- Coverage   48.69%   48.69%   -0.01%     
==========================================
  Files        2606     2606              
  Lines      191776   191776              
==========================================
- Hits        93388    93383       -5     
- Misses      91058    91062       +4     
- Partials     7330     7331       +1     
Flag Coverage Δ
go-unit-tests 48.69% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dvail dvail force-pushed the dv/ROX-29845-add-start-console-dev-script branch from e6f96db to 63646a8 Compare July 22, 2025 15:22
@dvail dvail force-pushed the dv/ROX-29843-ocp-plugin-conf-poc branch from 9c07abb to 25da342 Compare July 23, 2025 12:10
@dvail dvail force-pushed the dv/ROX-29845-add-start-console-dev-script branch from 63646a8 to 1941fcb Compare July 23, 2025 12:10
@dvail dvail force-pushed the dv/ROX-29843-ocp-plugin-conf-poc branch from 25da342 to e381ca8 Compare July 23, 2025 19:11
@dvail dvail force-pushed the dv/ROX-29845-add-start-console-dev-script branch 3 times, most recently from dcf8a52 to 64d0116 Compare July 23, 2025 19:54
@dvail dvail marked this pull request as ready for review July 23, 2025 20:51
@dvail dvail requested a review from a team as a code owner July 23, 2025 20:51
@dvail dvail force-pushed the dv/ROX-29845-add-start-console-dev-script branch from 64d0116 to eff3e46 Compare July 23, 2025 21:05
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @dvail - I've reviewed your changes - here's some feedback:

  • Consider adding a help flag and basic argument parsing to start-ocp-console.sh (e.g. --console-image, --port, --plugin) so users can easily customize settings without editing the script.
  • Instead of hard-coding PLUGIN_NAME in the script, dynamically read it from package.json or allow an override via environment variable to support multiple plugins more easily.
  • Add pre-flight checks at the top of start-ocp-console.sh to verify required commands (oc, podman/docker) are installed and that the user is logged in, failing fast with a clear error message if not.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding a help flag and basic argument parsing to start-ocp-console.sh (e.g. --console-image, --port, --plugin) so users can easily customize settings without editing the script.
- Instead of hard-coding PLUGIN_NAME in the script, dynamically read it from package.json or allow an override via environment variable to support multiple plugins more easily.
- Add pre-flight checks at the top of start-ocp-console.sh to verify required commands (oc, podman/docker) are installed and that the user is logged in, failing fast with a clear error message if not.

## Individual Comments

### Comment 1
<location> `ui/apps/platform/scripts/get-auth-token.sh:27` </location>
<code_context>
     "${api_endpoint}/v1/apitokens/generate" \
     -X POST \
-    -d '{"name": "ui_tests", "role": "Admin"}' \
+    -d "{\"name\": \"${api_token_name}\", \"role\": \"${api_token_role}\"}" \
     | jq -r '.token // ""')"
 else
</code_context>

<issue_to_address>
Escaping JSON in shell can be error-prone if variables contain special characters.

If api_token_name or api_token_role includes quotes or backslashes, the JSON may become invalid. Use jq or a similar tool to safely build the JSON payload, especially if these variables are user-controlled.
</issue_to_address>

### Comment 2
<location> `ui/apps/platform/scripts/start-ocp-console.sh:5` </location>
<code_context>
+
+set -euo pipefail
+
+CONSOLE_IMAGE=${CONSOLE_IMAGE:="quay.io/openshift/origin-console:latest"}
+CONSOLE_PORT=${CONSOLE_PORT:=9000}
+CONSOLE_IMAGE_PLATFORM=${CONSOLE_IMAGE_PLATFORM:="linux/amd64"}
+
+# Plugin metadata is declared in package.json
</code_context>

<issue_to_address>
Default value assignment syntax is non-standard and may not work in all shells.

Use VAR="${VAR:-default}" for assignments to ensure POSIX compatibility across different shells.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Base automatically changed from dv/ROX-29843-ocp-plugin-conf-poc to master July 24, 2025 20:19
@dvail dvail requested a review from a team as a code owner July 24, 2025 20:19
@dvail dvail force-pushed the dv/ROX-29845-add-start-console-dev-script branch from eff3e46 to e835448 Compare July 24, 2025 20:19
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Jul 24, 2025

@dvail: The following tests 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/ocp-4-12-nongroovy-e2e-tests e835448 link false /test ocp-4-12-nongroovy-e2e-tests
ci/prow/ocp-4-19-nongroovy-e2e-tests e835448 link false /test ocp-4-19-nongroovy-e2e-tests
ci/prow/ocp-4-18-nongroovy-e2e-tests e835448 link false /test ocp-4-18-nongroovy-e2e-tests

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.

@dvail dvail merged commit 4d372a0 into master Jul 25, 2025
136 of 167 checks passed
@dvail dvail deleted the dv/ROX-29845-add-start-console-dev-script branch July 25, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants