Skip to content

Add operator PR testing workflow#4

Merged
sciabarracom merged 9 commits intoapache:mainfrom
luigidematteis:main
Mar 10, 2026
Merged

Add operator PR testing workflow#4
sciabarracom merged 9 commits intoapache:mainfrom
luigidematteis:main

Conversation

@luigidematteis
Copy link
Contributor

Description

This PR adds a new workflow for testing operator PRs end-to-end.

Operator PR test workflow (operator-pr-test.yaml)

New repository_dispatch-driven workflow that receives events from the operator repo when a maintainer comments /testing <platform> on a PR. It:

  • Clones the operator PR branch with --recurse-submodules (picking up the olaris/ task submodule)
  • Builds the operator Docker image from the PR code
  • Pushes it to GHCR under the testing repo's namespace (ghcr.io/<owner>/openserverless-testing:pr-<num>-<sha>)
  • Patches opsroot.json to point to the just-built image via jq
  • Sets OPS_ROOT to the submodule path so ops uses the PR's task definitions
  • Runs the full acceptance test suite against the specified platform

Uses ${{ github.repository_owner }} throughout, so the same workflow works on forks and upstream without changes.

Secrets and environment variables

  • Secrets are loaded at runtime from 1Password vault OpenServerless/TESTING using 1password/load-secrets-action@v2 (Linux/Mac) and shyim/1password-load-secrets-action@v1 (Windows)
  • The only GitHub Secret required is OP_SERVICE_ACCOUNT_TOKEN (authenticates the 1Password action)
  • NGROK_TOKEN remains as a GitHub Secret (not stored in 1Password)
  • OPS_REPO and OPS_BRANCH are configurable via repository variables

SSH via DNS hostnames

  • 1-deploy.sh uses K3S_AMD_APIHOST / K3S_ARM_APIHOST as the SSH target

Bug fix in tests.yaml

  • Fixed platform name parsing for dispatch-based triggers: the sed pattern was incorrectly stripping platform suffixes (e.g. "amd" from "k3s-amd") when no timestamp was present
  • Removed branches-ignore: '*' from the push trigger (redundant filter that caused the workflow to fire on branch pushes)

Deploy script updates (tests/1-deploy.sh)

  • k3s-amd/k3s-arm blocks use K3S_AMD_APIHOST / K3S_ARM_APIHOST for both ops config apihost and ops setup server (SSH target)
  • SSH connection uses SSH_USER variable (defaults to root)
  • Kubeconfig setup reads from K8S_KUBECONFIG_B64 for generic K8s platforms

1Password vault fields required

1Password vault "OpenServerless" / item "TESTING"
  ├── K3S_AMD_APIHOST      DNS FQDN for k3s AMD
  ├── K3S_ARM_APIHOST      DNS FQDN for k3s ARM
  ├── K8S_KUBECONFIG_B64   Base64-encoded kubeconfig for K8s clusters
  ├── K8S_APIHOST          DNS FQDN for generic K8s
  ├── ID_RSA_B64           Base64-encoded SSH key for VM access
  ├── APIHOST              Fallback DNS FQDN
  └── NGROK_PASSWORD       ngrok password (debug)

GitHub Secrets required

Secret Purpose
OP_SERVICE_ACCOUNT_TOKEN Authenticates 1Password access at runtime
NGROK_TOKEN ngrok auth token (debug)

Companion PR

This PR works together with a PR on openserverless-operator that:

  • Adds openserverless-task as a git submodule at olaris/
  • Adds trigger-testing.yaml workflow (dispatches operator-pr-test events to this repo)
  • Requires OPENSERVERLESS_TESTING_PAT secret on the operator repo

luigidematteis and others added 9 commits February 27, 2026 17:43
Replace 1Password secret loading with GitHub Actions secrets and
variables. Retarget infrastructure from AWS/Azure/GCP to Hetzner
(single VMs for k3s, managed K8s cluster via kubeconfig).

Changes:
- .github/workflows/tests.yaml: remove 1password/load-secrets-action
  from all three OS jobs (linux/windows/mac), replace with workflow-level
  env block using ${{ secrets.* }} and ${{ vars.* }}.
- tests/1-deploy.sh: rename k3s -> k3s-amd with explicit K3S_AMD_IP,
  add k8s platform (generic kubeconfig-based cluster),
  implement apihost env var hierarchy (<PLATFORM>_APIHOST -> APIHOST ->
  hardcoded default), comment out mk8s/eks/aks/gke/osh types.
- tests/all.sh: update platform whitelist (k3s-amd, k3s-arm, k8s),
  fix OPS_BRANCH to read from environment instead of hardcoding main,
  update TYPE extraction.

Tag format: <platform>-<run-id> (e.g. k3s-amd-test1, k8s-run3)
Active platforms: kind, k3s-amd, k3s-arm, k8s
Commented out: mk8s, eks, aks, gke, osh

Signed-off-by: Luigi De Matteis <ldematteis123@gmail.com>
Signed-off-by: Luigi De Matteis <ldematteis123@gmail.com>
The branches-ignore: '*' under push was causing spurious workflow runs
on branch pushes. With only tags filter present, branch pushes are
already excluded by GitHub Actions.
Add operator PR testing workflow and migrate secrets to GitHub
The sed pattern stripped the last dash-separated component, turning
"k3s-amd" into "k3s" when no timestamp suffix was present. Now only
strips a trailing numeric suffix (the timestamp added by tag-based
triggers), leaving clean platform names like "k3s-amd" unchanged.
Replace GitHub Secrets env vars with 1Password load-secrets-action
in all three workflow jobs (linux, windows, mac) and operator-pr-test.
Only OP_SERVICE_ACCOUNT_TOKEN and NGROK_TOKEN remain as GitHub Secrets.
…secrets

The k3s-amd and k3s-arm deploy scripts now use K3S_AMD_APIHOST / K3S_ARM_APIHOST
as the SSH target, removing the need for K3S_AMD_IP and K3S_ARM_IP secrets.
DNS hostnames resolve to the same address and reduce the number of secrets
to maintain in the 1Password vault.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants