Skip to content

✨ Replace asciinema with godog-based demo recording#2801

Open
pedjak wants to merge 1 commit into
operator-framework:mainfrom
pedjak:replace-asciinema-with-godog
Open

✨ Replace asciinema with godog-based demo recording#2801
pedjak wants to merge 1 commit into
operator-framework:mainfrom
pedjak:replace-asciinema-with-godog

Conversation

@pedjak

@pedjak pedjak commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Replace standalone shell demo scripts recorded via asciinema with Godog BDD scenarios that generate asciicast v2 files programmatically. This makes demos into verified tests that can never silently break while producing terminal recordings.

Motivation

asciinema.org is unreachable from GitHub Actions runners (Azure) since June 2026, causing the daily demo CI job to fail consistently. Rather than just fixing the upload, this PR converts the entire demo pipeline to use the existing e2e test infrastructure, ensuring demos are always validated against the current codebase.

What changed

Recording infrastructure (test/e2e/steps/asciicast_*.go):

  • AsciiCastRecorder generates asciicast v2 files using stdlib only
  • @demo tag activates recording via godog Before/After hooks
  • Per-step command dedup handles require.Eventually polling transparently
  • k8sClient and k8scliWithInput now accept context.Context, capture stdout/stderr separately with real timing
  • RecordCustom provides human-friendly command display (e.g., kubectl get deployments instead of jsonpath queries)
  • Step text emitted as blue comments, commands in bold green

4 demo scenarios (test/e2e/features/demos.feature):

  • ClusterCatalog Quickstart: queries the operatorhubio catalog API via port-forward + curl | jq
  • SingleNamespace Install Mode: installs mariadb-operator with a separate watch namespace
  • OwnNamespace Install Mode: installs mariadb-operator with watch = install namespace
  • Webhook Support: installs telegraf-operator, verifies mutating webhook sidecar injection

Not converted (no matching demo scenarios):

  • Synthetic User Permissions: feature gate disabled in experimental
  • Helm Chart Support: blocked by OCPBUGS-95281

Makefile & CI:

  • update-demos builds OLM from source using experimental e2e infrastructure, deploys with all feature gates + operatorhubio catalog
  • demo-svg converts asciicast to SVG via svg-term-cli in Docker
  • Demo scenarios excluded from regular e2e runs via ~@demo filter
  • CI uploads asciicast and SVG files as job artifacts on PR
  • CI deploys docs with updated recordings on merge to main

Documentation:

  • Draft howto docs embed recordings via mkdocs-asciinema-player plugin (play/pause/scrub controls)
  • README uses static SVG hosted on GitHub Pages
  • Recordings served from GitHub Pages, removing dependency on asciinema.org

Cleanup:

  • All old demo shell scripts, generate-asciidemo.sh, and hack/demo/ resource files removed

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Copilot AI review requested due to automatic review settings July 2, 2026 15:20
@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 Jul 2, 2026
@netlify

netlify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 7debcdc
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6a468d447ce6a100089b763f
😎 Deploy Preview https://deploy-preview-2801--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the previous hack/demo/* asciinema-driven shell demo pipeline with Godog @demo scenarios that generate asciicast v2 recordings programmatically during e2e execution, and updates docs/CI to publish and consume those recordings without relying on asciinema.org.

Changes:

  • Added a Go-based asciicast v2 recorder with Godog hooks to capture step/command output and timing for @demo scenarios.
  • Introduced new demo feature scenarios + step implementations and excluded demos from normal e2e runs while enabling a dedicated make update-demos pipeline (casts + SVG conversion).
  • Updated documentation and MkDocs configuration to embed/play recordings from the repo’s published docs site; removed legacy demo scripts/resources.

Reviewed changes

Copilot reviewed 35 out of 37 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/e2e/steps/upgrade_steps.go Threads scenario ctx into some kubectl calls and adds demo-friendly RecordCustom output for catalog conditions.
test/e2e/steps/tls_steps.go Updates helpers to new k8sClient(ctx, ...) API and records port-forward commands during demos.
test/e2e/steps/steps.go Changes kubectl execution to be context-aware, capture stdout/stderr separately, and record commands for demos.
test/e2e/steps/proxy_steps.go Updates kubectl helper calls to new k8sClient(ctx, ...) signature.
test/e2e/steps/hooks.go Registers asciicast recording hooks and adds per-scenario cleanup for catalog port-forward.
test/e2e/steps/ha_steps.go Updates kubectl helper calls to new k8sClient(ctx, ...) signature.
test/e2e/steps/demo_steps.go Adds demo-specific step definitions (catalog HTTP queries, RBAC checks, webhook container count check).
test/e2e/steps/asciicast_recorder.go Implements asciicast v2 recording writer and step/command aggregation/dedup logic.
test/e2e/steps/asciicast_hooks.go Adds Godog hooks to start/stop recording for @demo scenarios and record per-step output.
test/e2e/features/demos.feature Adds @demo feature/scenarios for ClusterCatalog quickstart, install modes, and webhook support.
test/e2e/features_test.go Registers demo steps in the Godog scenario initializer.
requirements.txt Adds mkdocs-asciinema-player dependency for docs playback.
README.md Switches demo link from asciinema.org to GitHub Pages-hosted SVG.
mkdocs.yml Enables the asciinema-player MkDocs plugin.
Makefile Excludes @demo from standard e2e and adds update-demos, demo-e2e, and demo-svg targets.
docs/draft/howto/single-ownnamespace-install.md Embeds new .cast recordings via asciinema-player blocks.
docs/draft/howto/enable-webhook-support.md Embeds new .cast recording via asciinema-player blocks.
.gitignore Ignores generated demo artifacts under docs/demos/.
.github/workflows/update-demos.yaml Reworks demo workflow to generate casts/SVGs, upload artifacts, and deploy docs on push to main.
hack/demo/webhook-provider-certmanager-demo-script.sh Removes legacy shell-based demo script.
hack/demo/synthetic-user-cluster-admin-demo-script.sh Removes legacy shell-based demo script.
hack/demo/single-namespace-demo-script.sh Removes legacy shell-based demo script.
hack/demo/own-namespace-demo-script.sh Removes legacy shell-based demo script.
hack/demo/gzip-demo-script.sh Removes legacy shell-based demo script.
hack/demo/catalogd-metas-demo-script.sh Removes legacy shell-based demo script.
hack/demo/catalogd-demo-script.sh Removes legacy shell-based demo script.
hack/demo/graphql-demo-script.sh Removes legacy shell-based demo script.
hack/demo/generate-asciidemo.sh Removes legacy asciinema recording generator script.
hack/demo/graphql-demo-server/main.go Removes legacy demo server used by the old GraphQL demo flow.
hack/demo/resources/webhook-provider-certmanager/webhook-operator-extension.yaml Removes legacy demo resource manifest.
hack/demo/resources/webhook-provider-certmanager/webhook-operator-catalog.yaml Removes legacy demo resource manifest.
hack/demo/resources/webhook-provider-certmanager/validating-webhook-test.yaml Removes legacy demo resource manifest.
hack/demo/resources/webhook-provider-certmanager/mutating-webhook-test.yaml Removes legacy demo resource manifest.
hack/demo/resources/synthetic-user-perms/cegroup-admin-binding.yaml Removes legacy demo resource manifest.
hack/demo/resources/synthetic-user-perms/argocd-clusterextension.yaml Removes legacy demo resource manifest.
hack/demo/resources/single-namespace-demo.yaml Removes legacy demo resource manifest.
hack/demo/resources/own-namespace-demo.yaml Removes legacy demo resource manifest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/e2e/steps/steps.go
Comment thread test/e2e/steps/steps.go
Comment thread Makefile
Comment thread .github/workflows/update-demos.yaml Outdated
Comment thread test/e2e/steps/upgrade_steps.go
Comment thread test/e2e/steps/upgrade_steps.go Outdated
@pedjak pedjak force-pushed the replace-asciinema-with-godog branch from 4caae72 to f3e39f5 Compare July 2, 2026 15:50
Convert terminal demos from standalone shell scripts recorded via
asciinema to Godog BDD scenarios that generate asciicast v2 files
programmatically. This makes demos into verified tests that can
never silently break while producing terminal recordings.

The recording infrastructure captures kubectl commands and their
stdout/stderr with real execution timing during @demo-tagged
scenario execution. Per-step dedup handles polling transparently
so only successful results appear in the recording. Step text is
emitted as comments and commands are colored for readability.

Demo scenarios:
- ClusterCatalog Quickstart: queries the operatorhubio catalog API
- SingleNamespace Install Mode: installs mariadb-operator with a
  separate watch namespace, verifies rolebindings
- OwnNamespace Install Mode: installs mariadb-operator with
  watch namespace equal to install namespace
- Webhook Support: installs telegraf-operator, verifies mutating
  webhook injects sidecar container into test pod

Not converted (no matching demo scenarios):
- Synthetic User Permissions: feature gate disabled in experimental
- Helm Chart Support: blocked by OCPBUGS-95281

The update-demos Makefile target now builds OLM from source using the
experimental e2e infrastructure, deploys with all feature gates and
operatorhubio catalog, runs demo scenarios, converts recordings to
SVG via svg-term-cli, and tears down the cluster. Demo recordings
are embedded in docs via the mkdocs-asciinema-player plugin and
served from GitHub Pages, removing the dependency on asciinema.org
for hosting recordings. Demo scenarios are excluded from regular
e2e test runs via ~@demo filter.

CI workflow (update-demos.yaml):
- On PR: generates demos, uploads asciicast and SVG files as job
  artifacts
- On merge to main: generates demos, deploys docs with updated
  recordings via make deploy-docs

Old demo shell scripts, the asciinema generate-asciidemo.sh wrapper,
and hack/demo/ resource files have been removed.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 2, 2026 16:09
@pedjak pedjak force-pushed the replace-asciinema-with-godog branch from f3e39f5 to 7debcdc Compare July 2, 2026 16:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 36 out of 38 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

test/e2e/steps/tls_steps.go:114

  • portForward now accepts a context.Context but the kubectl port-forward process is started with exec.Command (not exec.CommandContext), so the context is currently ignored. This can leave the port-forward running longer than intended if the scenario context is canceled (timeouts / suite shutdown), and is inconsistent with the new context-aware command helpers.

@pedjak pedjak marked this pull request as ready for review July 2, 2026 19:23
@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 Jul 2, 2026
@openshift-ci openshift-ci Bot requested review from OchiengEd and oceanc80 July 2, 2026 19:23
@pedjak pedjak requested review from dtfranz and perdasilva and removed request for OchiengEd and oceanc80 July 2, 2026 19:24
@tmshort

tmshort commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

/approve

Although I'm wondering if the demo is still useful?

@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tmshort

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 Jul 2, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants