Skip to content

SRVOCF-1003: improve developer experience and CI tooling - #78

Merged
openshift-merge-bot[bot] merged 8 commits into
openshift:masterfrom
pmeida:SRVOCF-1003-dev-experience-improvement
Aug 4, 2026
Merged

SRVOCF-1003: improve developer experience and CI tooling#78
openshift-merge-bot[bot] merged 8 commits into
openshift:masterfrom
pmeida:SRVOCF-1003-dev-experience-improvement

Conversation

@pmeida

@pmeida pmeida commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Consolidates developer tooling.
Adds Dockerfile.builder for CI usage, containing node, python, yarn and helm - consolidates every ci needed tool in one scr.

$ make help

Usage:
  make <target>
  help                      Show this help

Development
  dev                       Start dev environment (also: dev-stop, dev-randomize-ports)

Frontend
  install-frontend          Install frontend dependencies (yarn install --immutable)
  build-frontend            Build production bundle
  lint-frontend             Run eslint and stylelint
  unit-frontend             Run Vitest unit tests
  type-check                Run TypeScript compiler check
  test-e2e                  Run Playwright e2e tests (ARGS="--headed")
  verify                    Verify i18n freshness and yarn deduplication

Backend
  install-backend           Download Go module dependencies
  build-backend             Compile Go binary to bin/
  unit-backend              Run Go unit tests
  lint-backend              Run golangci-lint
  fmt-backend               Auto-fix lint issues (golangci-lint --fix)

Image
  image                     Build container image

Cluster
  manifests                 Render Helm chart to backend/static/plugin.yaml
  deploy                    Deploy plugin to cluster (defaults to quay.io latest image)
  undeploy                  Remove plugin from cluster
  deploy-dev                Build and deploy to cluster (dev)
  setup-serverless          Install Serverless operator and Knative Serving

Aggregate
  lint                      Lint frontend and backend
  unit                      Run all unit tests
  e2e                       Run Prow e2e flow (CI only)

builder-run.sh

hack/builder-run.sh runs any make target inside the same builder container that CI uses (Dockerfile.builder), allowing developers to locally emulate presubmit checks without installing Go, Node, Yarn, or Helm on the host.

# Basic usage
./hack/builder-run.sh make build
./hack/builder-run.sh make lint
./hack/builder-run.sh make unit

# E2E (requires a cluster with the plugin image accessible)
KUBECONFIG=<kubeconfig PATH> \
PLUGIN_PULL_SPEC=<a publicly accessible image tag> \
BRIDGE_KUBEADMIN_PASSWORD=<password> \
CONTAINER_ENV=PLUGIN_PULL_SPEC,BRIDGE_KUBEADMIN_PASSWORD \
  ./hack/builder-run.sh make e2e

After some fixes to the original e2e flow, I was able to simulate a presubmit of make e2e locally successful.

Other changes

  • All scripts moved from repo root to hack/
  • Standardise logging with a shared logging library (hack/lib/log.sh)
  • Removed .ci-operator.yaml, and root-level wrapper scripts
  • Fix linting raised errors
  • Update old repo/registry pointers
  • Promote usage of make command all around where possible
  • Introduce make setup-serverless as optional tooling
  • drop docker support, use podman directly

Prow configuration

A separate PR to openshift/release will be opened to register the presubmit jobs. Something like:

build_root:
  project_image:
    dockerfile_path: Dockerfile.builder
images:
  items:
  - dockerfile_path: Dockerfile
    to: faas-console-plugin
...
tests:
- as: lint
  commands: make lint
  container:
    from: src
  skip_if_only_changed: \.md$|^(LICENSE|OWNERS)$
- as: unit
  commands: make unit
  container:
    from: src
  skip_if_only_changed: \.md$|^(LICENSE|OWNERS)$
- as: e2e-aws
  skip_if_only_changed: \.md$|^(LICENSE|OWNERS)$|^docs/|^\.claude/
  steps:
    cluster_profile: openshift-org-aws
    env:
      OPERATORS: '[{"name": "serverless-operator", "source": "redhat-operators", "channel":
        "stable", "install_namespace": "openshift-serverless", "operator_group": "openshift-serverless"},
        {"name": "openshift-pipelines-operator-rh", "source": "redhat-operators",
        "channel": "latest", "install_namespace": "openshift-operators"}]'
    test:
    - ref: install-operators
    - as: e2e
      cli: latest
      commands: make e2e
      dependencies:
      - env: PLUGIN_PULL_SPEC
        name: faas-console-plugin
      from: src
      grace_period: 30m0s
      resources:
        requests:
          cpu: 500m
          memory: 2Gi
      timeout: 3h0m0s
    workflow: openshift-e2e-aws

@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 3, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 3, 2026

Copy link
Copy Markdown

@pmeida: This pull request references SRVOCF-1003 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 story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

Consolidates developer tooling, adds a builder container for local CI emulation, and refactors the production Dockerfile for cross-compilation.

Make targets

Usage:
 make <target>
 help                      Show this help

Development
 dev                       Start dev environment (also: dev-stop, dev-randomize-ports)

Frontend
 install-frontend          Install frontend dependencies (yarn install --immutable)
 build-frontend            Build production bundle
 lint-frontend             Run eslint and stylelint
 unit-frontend             Run Vitest unit tests
 type-check                Run TypeScript compiler check
 test-e2e                  Run Playwright e2e tests (ARGS="--headed")
 verify                    Verify i18n freshness and yarn deduplication

Backend
 install-backend           Download Go module dependencies
 build-backend             Compile Go binary to bin/
 unit-backend              Run Go unit tests
 lint-backend              Run golangci-lint
 fmt-backend               Auto-fix lint issues (golangci-lint --fix)

Image
 image                     Build container image

Cluster
 manifests                 Render Helm chart to backend/static/plugin.yaml
 deploy                    Deploy plugin to cluster (defaults to quay.io latest image)
 undeploy                  Remove plugin from cluster
 deploy-dev                Build and deploy to cluster (dev)
 setup-serverless          Install Serverless operator and Knative Serving

Aggregate
 build                     Build frontend and backend
 lint                      Lint frontend and backend
 unit                      Run all unit tests
 e2e                       Run Prow e2e flow (CI only)

builder-run.sh

hack/builder-run.sh runs any make target inside the same builder container that CI uses (Dockerfile.builder), allowing developers to locally emulate presubmit checks without installing Go, Node, Yarn, or Helm on the host.

# Basic usage
./hack/builder-run.sh make build
./hack/builder-run.sh make lint
./hack/builder-run.sh make unit

# E2E (requires a cluster with the plugin image accessible)
KUBECONFIG=<kubeconfig PATH> \
PLUGIN_PULL_SPEC=<a publicly accessible image tag> \
BRIDGE_KUBEADMIN_PASSWORD=<password> \
CONTAINER_ENV=PLUGIN_PULL_SPEC,BRIDGE_KUBEADMIN_PASSWORD \
 ./hack/builder-run.sh make e2e

Key design decisions:

  • Source mounted read-only (/src:ro) and copied into a writable layer inside the container, preventing build artifacts (node_modules, Go cache, telemetry files) from leaking back to the host
  • oc downloaded at runtime inside the container rather than baked into the builder image, mirroring how ci-operator injects it via cli: latest in presubmits
  • CRC auto-detection: when KUBECONFIG references api.crc.testing, the script adds --add-host entries for CRC hostnames (API, console, OAuth)
  • BRIDGE_KUBEADMIN_PASSWORD conversion: the entrypoint writes the password to a temp file and sets KUBEADMIN_PASSWORD_FILE, matching what test-prow-e2e.sh expects without modifying that script
  • Architecture-aware: builds the builder image for the native platform (--platform linux/arm64 on Apple Silicon) and downloads the matching oc binary

Dockerfile changes

  • Production Dockerfile now delegates to Makefile targets (make install-frontend, make build-frontend, make build-backend) instead of duplicating build commands
  • Added --platform=$BUILDPLATFORM to the Go builder stage for native cross-compilation via GOOS/GOARCH, avoiding slow QEMU emulation
  • GOOS and GOARCH set as ENV from ARG TARGETOS TARGETARCH so make build-backend just works

Other changes

  • All scripts moved from repo root to hack/ with a shared logging library (hack/lib/log.sh)
  • Removed .devcontainer/, .github/workflows/ci.yml, .ci-operator.yaml, and root-level wrapper scripts
  • Test mocks updated for Go 1.26 compatibility

Prow configuration

The docs/prow-config.yaml file documents the intended ci-operator configuration but is not included in this PR. A separate PR to openshift/release will be opened to register the presubmit jobs.

Known concerns

  • CRC currently runs console 4.21 (4.23 is not available yet for CRC), but the plugin is built expecting >=4.23.0 (@openshift-console/dynamic-plugin-sdk version 4.23-latest). When the console loads the plugin, it fails to satisfy the shared module version requirement, resulting in a 404 on plugin routes.
  • Tested make deploy and make deploy-dev on a 4.23 AWS cluster (working)
  • Until a 4.23 CRC release is available, local e2e via builder-run.sh will not be fully operational against CRC

Test plan

  • ./hack/builder-run.sh make build completes successfully
  • ./hack/builder-run.sh make lint completes successfully
  • ./hack/builder-run.sh make unit completes successfully
  • make deploy on a 4.23+ cluster deploys the plugin
  • make deploy-dev on a 4.23+ cluster builds, pushes, and deploys
  • E2E via builder-run.sh on a 4.23+ cluster passes

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 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 3, 2026
@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown

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

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 3, 2026
@pmeida
pmeida force-pushed the SRVOCF-1003-dev-experience-improvement branch from 0833ad4 to 62bffd7 Compare August 3, 2026 17:47
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 3, 2026
@pmeida
pmeida force-pushed the SRVOCF-1003-dev-experience-improvement branch 8 times, most recently from ea4a3b1 to 0588b27 Compare August 4, 2026 09:22
@pmeida
pmeida marked this pull request as ready for review August 4, 2026 09:22
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 4, 2026
@openshift-ci
openshift-ci Bot requested review from dsimansk and matejvasek August 4, 2026 09:22
@dsimansk

dsimansk commented Aug 4, 2026

Copy link
Copy Markdown

@pmeida for skip_if_only_changed in CI config, we can include whole tekton pipelines dir .tekton/*.yaml. The change is verified in konflux pipeline and testing in OpenShift CI wouldn't tell us much anyway.

@pmeida
pmeida force-pushed the SRVOCF-1003-dev-experience-improvement branch from 0588b27 to ce479e0 Compare August 4, 2026 09:43
Comment thread hack/builder-run.sh Outdated
@pmeida
pmeida force-pushed the SRVOCF-1003-dev-experience-improvement branch from ce479e0 to 2ee83a9 Compare August 4, 2026 10:13
Scripts were scattered across the repo root with no shared
conventions. The Dockerfile duplicated build logic instead of
using Makefile targets, and there was no way to reproduce CI
presubmit checks locally.

Move all scripts into hack/ with a shared logging library.
Add Dockerfile.builder and builder-run.sh so developers can
run make build, lint, unit, and e2e inside the same container
image that CI uses. Refactor the production Dockerfile to
delegate to Makefile targets and enable native cross-compilation
via --platform=$BUILDPLATFORM with GOOS/GOARCH.

Remove .devcontainer, .github/workflows, .ci-operator.yaml,
and root-level wrapper scripts that are no longer needed.

Signed-off-by: Pedro Almeida <pealmeid@redhat.com>
@pmeida
pmeida force-pushed the SRVOCF-1003-dev-experience-improvement branch from 2ee83a9 to 84146dc Compare August 4, 2026 10:13
Comment thread hack/builder-run.sh Outdated
Comment thread hack/deploy-plugin.sh Outdated
@matejvasek

Copy link
Copy Markdown

I find it little bit confusing to have deploy.sh and deploy-plugin.sh.

- deploy-plugin.sh -> deploy.sh (Helm deploy only)
- deploy.sh -> deploy-dev.sh (build + push + deploy)
- Remove redundant --platform from builder-run.sh and Dockerfile.builder
- Drop --net=host from CRC network opts in builder-run.sh

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@matejvasek

Copy link
Copy Markdown

hack/dev.sh:119 builds the backend as bin/backend:

(cd backend && go build -buildvcs=false -o ../bin/backend .)

but make build-backend (Makefile:8) outputs to bin/plugin-backend:

BACKEND_BIN ?= $(PROJECT_DIR)/bin/plugin-backend

Two different binaries in the same directory. Consider having dev.sh call make build-backend or aligning the output names.

Comment thread hack/builder-run.sh
Comment thread hack/builder-run.sh
Use make build-backend instead of inline go build, and rename
bin/backend references to bin/plugin-backend.

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread hack/deploy.sh Outdated
Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread hack/dev.sh
Comment thread hack/deploy-dev.sh
Signed-off-by: Pedro Almeida pealmeid@redhat.com
Comment thread hack/builder-run.sh Outdated
@pmeida
pmeida force-pushed the SRVOCF-1003-dev-experience-improvement branch from f5cd6e7 to 421e812 Compare August 4, 2026 11:51
pmeida and others added 2 commits August 4, 2026 12:56
Remove Docker fallback logic from all scripts and Makefile.
Update README prerequisites to list only Podman.

Co-Authored-By: Claude <noreply@anthropic.com>
Drop the CONTAINER_ENV comma-separated indirection. The script now
explicitly forwards PLUGIN_PULL_SPEC and BRIDGE_KUBEADMIN_PASSWORD
when set. This also fixes the unbound variable crash under set -u
when CONTAINER_ENV was unset.

Co-Authored-By: Claude <noreply@anthropic.com>
@pmeida
pmeida force-pushed the SRVOCF-1003-dev-experience-improvement branch from 421e812 to bb62984 Compare August 4, 2026 11:56
@matejvasek
matejvasek requested a review from dsimansk August 4, 2026 12:28
@matejvasek

Copy link
Copy Markdown

/lgtm
/hold

PTAL @dsimansk

@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 Aug 4, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 4, 2026
@dsimansk

dsimansk commented Aug 4, 2026

Copy link
Copy Markdown

/unhold

@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 Aug 4, 2026
@dsimansk

dsimansk commented Aug 4, 2026

Copy link
Copy Markdown

/approve
/lgtm

@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, pmeida

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 Aug 4, 2026
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

@pmeida: 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 675ab63 into openshift:master Aug 4, 2026
6 checks passed
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