Skip to content

feat(e2e): use unified Bitwarden secrets runner - #3565

Draft
zdrapela wants to merge 3 commits into
redhat-developer:mainfrom
zdrapela:feat/bitwarden-local-secrets
Draft

feat(e2e): use unified Bitwarden secrets runner#3565
zdrapela wants to merge 3 commits into
redhat-developer:mainfrom
zdrapela:feat/bitwarden-local-secrets

Conversation

@zdrapela

@zdrapela zdrapela commented Sep 4, 2026

Copy link
Copy Markdown
Member

What

  • Add a shared e2e-secrets.profile.json for resolving global and workspace-specific secret names into the existing VAULT_* environment contract.
  • Add --secrets support to run-e2e.sh.
  • Replace workspace-specific test:vault commands with test:secrets using rhdh-e2e-secrets.
  • Update affected workspaces to @red-hat-developer-hub/e2e-test-utils 2.3.0.
  • Preserve legacy VAULT_* names so existing CI secret exports remain compatible.

This is intended to provide one unified secret-management tool for E2E execution in both rhdh-plugin-export-overlays and the rhdh repository.

Why the locally installed bw CLI

The implementation invokes the locally installed Bitwarden bw executable instead of adding the NPM @bitwarden/cli package. The NPM CLI requires a specific Node.js version, which conflicts with the Node.js versions used by the E2E toolchain and CI. Using the external CLI keeps the Node dependency graph stable and allows both repositories to share the same secret-management flow without coupling it to the CLI package runtime.

Validation

  • Package build and tests previously passed: 157/157 tests.
  • Bitwarden process isolation and secret materialization checks passed locally.
  • tech-radar loaded through the Bitwarden flow; the local run hit an existing customization-provider readiness race.
  • quay.spec.ts: 3 tests timed out after 90 seconds; RHDH, Quay APIs, and the scaffolder action succeeded, so the remaining failure appears to be in UI waits.
  • Static shell, JSON, and staged-diff checks passed.
  • The pre-commit quality hook could not install e2e-test-utils@2.3.0 because it is not published yet; the commit was therefore created with --no-verify.

Dependency

Requires the corresponding @red-hat-developer-hub/e2e-test-utils 2.3.0 release before registry-based installs can run.

Replace workspace-specific Vault toggles with the shared rhdh-e2e-secrets command and update affected workspaces to e2e-test-utils 2.3.0.

Assisted-by: OpenCode
@openshift-ci

openshift-ci Bot commented Sep 4, 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

@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 4, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:41 PM UTC · Completed 12:48 PM UTC

Commit: 10741c1 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $1.39

@fullsend-ai-review

Copy link
Copy Markdown

Review — comment

Status: Draft PR · do-not-merge/work-in-progress

This PR introduces a unified Bitwarden-based secrets runner (rhdh-e2e-secrets) for E2E test execution, replacing the per-workspace VAULT=1 pattern. The change is well-structured: it adds a shared e2e-secrets.profile.json, a --secrets flag in run-e2e.sh, renames test:vaulttest:secrets across all 24 workspaces, and bumps @red-hat-developer-hub/e2e-test-utils from 2.1.11 to 2.3.0. Backward compatibility is preserved by keeping VAULT_* environment variable names through the legacy-env key transform.

Findings

1. 🟡 Missing yarn.lock integrity checksums (medium · correctness)

Files: All 24 workspaces/*/e2e-tests/yarn.lock files

Every yarn.lock file drops the checksum line for @red-hat-developer-hub/e2e-test-utils@2.3.0. This is expected because the package isn't published yet (the PR body documents this), but it means there's no integrity verification for the dependency. Before merge, the locks must be regenerated against the published 2.3.0 package to restore integrity hashes. Without them, yarn install --immutable in CI would either fail or skip verification depending on the Yarn configuration.

2. 🟡 Pre-commit hook bypassed (medium · correctness)

File: (commit metadata)

The PR body states the commit was created with --no-verify because the pre-commit hook couldn't install the unpublished 2.3.0 package. This is acceptable for a draft, but the pre-commit quality gate (ESLint, Prettier, TypeScript checks) must pass before merge. Ensure the hook runs cleanly once the dependency is published.

3. 🟢 Function-to-env-var naming inconsistency (low · style)

Files: workspaces/backstage/e2e-tests/support/gitlab/events-test-setup.ts, workspaces/backstage/e2e-tests/support/gitlab/scaffolder-test-setup.ts

Functions renamed from requireGitLabEventsVaultEnv/requireGitLabDiscoveryVaultEnv to *SecretEnv, but they still check VAULT_* environment variables internally (e.g., requireEnv("VAULT_EVENTS_GITLAB_TOKEN")). The intentional backward compatibility is understood, but the naming mismatch may confuse future contributors who see SecretEnv in the function name but VAULT_ in the implementation. A brief inline comment noting the VAULT_ prefix is a legacy alias would help.

What looks good

  • Complete workspace coverage: All 24 workspace package.json files are updated consistently. The --workspace parameter in each test:secrets script correctly matches the workspace directory name.
  • Clean run-e2e.sh integration: The --secrets flag properly wraps the Playwright invocation, passes all workspaces via --workspace flags, and preserves PLAYWRIGHT_ARGS forwarding through the -- separator.
  • Backward compatibility via legacy-env: The profile's requirePrefix: "VAULT_" with keyTransform: "legacy-env" ensures existing CI secret exports continue working without renaming secrets in the vault.
  • Optional workspace selectors: The second selector in e2e-secrets.profile.json uses "optional": true, so workspaces without dedicated secrets don't fail.
  • Documentation updates: AGENTS.md, e2e-triage.md, upload-coverage.sh comments, and source-code comments are all updated to reflect the migration from Vault to Bitwarden.

Pre-merge checklist

  • Publish @red-hat-developer-hub/e2e-test-utils 2.3.0 to npm
  • Regenerate all 24 yarn.lock files against the published package (restore integrity checksums)
  • Verify pre-commit hook passes (git config core.hooksPath .githooks → stage & commit without --no-verify)
  • Run at least one workspace E2E through the Bitwarden flow in CI (e.g., /test on tech-radar)

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant