From b1191b979970b8129b871e8ed7d3f8d1758476da Mon Sep 17 00:00:00 2001 From: Rahul Varghese Date: Fri, 1 May 2026 10:01:39 +0530 Subject: [PATCH] feat: rename stack to stack-tectonic - rename the published repo and OCI package to stack-tectonic - replace placeholder composition examples with fixtures adapted from example-platform-repo - add per-composition fixture verification alongside full catalog verification Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- .github/workflows/verify.yml | 35 ++++++ README.md | 19 +-- .../cloudflare-pages-terraform/README.md | 18 +-- .../examples/README.md | 4 +- .../cloudflare-pages-terraform/component.yaml | 31 +++++ .../infra/cloudflare-pages-terraform/main.tf | 87 +++++++++++++ .../website/docs/deployment-paths.md | 98 +++++++++++++++ .../website/docs/getting-started.md | 51 ++++++++ .../website/docusaurus.config.js | 81 ++++++++++++ .../docs-site-git/website/package.json | 22 ++++ .../docs-site-git/website/sidebars.js | 3 + .../tests/README.md | 4 +- .../tests/smoke/component.yaml | 31 +++++ .../README.md | 18 +-- .../examples/README.md | 4 +- .../apps/admin-console/component.yaml | 31 +++++ .../apps/admin-console/package.json | 9 ++ .../apps/admin-console/src/app.js | 8 ++ .../apps/admin-console/wrangler.jsonc | 6 + .../cloudflare-pages-admin-console/main.tf | 87 +++++++++++++ .../examples/admin-console-git/package.json | 17 +++ .../admin-console-git/pnpm-workspace.yaml | 3 + .../admin-console-git/tsconfig.base.json | 14 +++ .../examples/admin-console-git/turbo.json | 27 ++++ .../tests/README.md | 4 +- .../tests/smoke/component.yaml | 31 +++++ compositions/cloudflare-pages-turbo/README.md | 18 +-- .../cloudflare-pages-turbo/examples/README.md | 4 +- .../apps/web-console/component.yaml | 25 ++++ .../web-console/apps/web-console/package.json | 9 ++ .../web-console/apps/web-console/src/app.js | 8 ++ .../apps/web-console/wrangler.jsonc | 6 + .../examples/web-console/package.json | 17 +++ .../examples/web-console/pnpm-workspace.yaml | 3 + .../examples/web-console/tsconfig.base.json | 14 +++ .../examples/web-console/turbo.json | 27 ++++ .../cloudflare-pages-turbo/tests/README.md | 4 +- .../tests/smoke/component.yaml | 25 ++++ compositions/cloudflare-pages/README.md | 18 +-- .../cloudflare-pages/examples/README.md | 4 +- .../examples/docs-site/website/component.yaml | 25 ++++ .../website/docs/deployment-paths.md | 98 +++++++++++++++ .../docs-site/website/docs/getting-started.md | 51 ++++++++ .../docs-site/website/docusaurus.config.js | 81 ++++++++++++ .../examples/docs-site/website/package.json | 22 ++++ .../examples/docs-site/website/sidebars.js | 3 + compositions/cloudflare-pages/tests/README.md | 4 +- .../tests/smoke/component.yaml | 25 ++++ .../cloudflare-worker-turbo/README.md | 18 +-- .../examples/README.md | 4 +- .../api-edge/apps/api-edge/component.yaml | 23 ++++ .../api-edge/apps/api-edge/package.json | 11 ++ .../api-edge/apps/api-edge/src/index.ts | 15 +++ .../api-edge/apps/api-edge/tsconfig.json | 6 + .../api-edge/apps/api-edge/wrangler.jsonc | 10 ++ .../examples/api-edge/package.json | 17 +++ .../examples/api-edge/pnpm-workspace.yaml | 3 + .../examples/api-edge/tsconfig.base.json | 14 +++ .../examples/api-edge/turbo.json | 27 ++++ .../cloudflare-worker-turbo/tests/README.md | 4 +- .../tests/smoke/component.yaml | 23 ++++ compositions/cloudflare-worker/README.md | 18 +-- .../cloudflare-worker/examples/README.md | 4 +- .../apps/identity-worker/component.yaml | 27 ++++ .../apps/identity-worker/package.json | 11 ++ .../apps/identity-worker/src/index.ts | 16 +++ .../apps/identity-worker/tsconfig.json | 6 + .../apps/identity-worker/wrangler.jsonc | 10 ++ .../examples/identity-worker/package.json | 17 +++ .../identity-worker/pnpm-workspace.yaml | 3 + .../identity-worker/tsconfig.base.json | 14 +++ .../examples/identity-worker/turbo.json | 27 ++++ .../cloudflare-worker/tests/README.md | 4 +- .../tests/smoke/component.yaml | 27 ++++ compositions/helm-chart/README.md | 18 +-- compositions/helm-chart/examples/README.md | 4 +- .../charts/hello-chart/chart/Chart.yaml | 6 + .../charts/hello-chart/chart/component.yaml | 25 ++++ .../chart/templates/configmap.yaml | 11 ++ .../charts/hello-chart/chart/values.yaml | 5 + .../deploy/hello-deploy/values.yaml | 5 + compositions/helm-chart/tests/README.md | 4 +- .../helm-chart/tests/smoke/component.yaml | 25 ++++ compositions/helm-values/README.md | 18 +-- compositions/helm-values/examples/README.md | 4 +- .../charts/hello-chart/chart/Chart.yaml | 6 + .../chart/templates/configmap.yaml | 11 ++ .../charts/hello-chart/chart/values.yaml | 5 + .../deploy/hello-deploy/component.yaml | 25 ++++ .../deploy/hello-deploy/values.yaml | 5 + compositions/helm-values/tests/README.md | 4 +- .../helm-values/tests/smoke/component.yaml | 25 ++++ compositions/terraform/README.md | 18 +-- compositions/terraform/examples/README.md | 4 +- .../infra/infra-1/component.yaml | 22 ++++ .../network-foundation/infra/infra-1/main.tf | 21 ++++ compositions/terraform/tests/README.md | 4 +- .../terraform/tests/smoke/component.yaml | 22 ++++ compositions/turbo-package/README.md | 18 +-- compositions/turbo-package/examples/README.md | 4 +- .../examples/platform-sdk/package.json | 17 +++ .../platform-sdk/packages/sdk/component.yaml | 23 ++++ .../platform-sdk/packages/sdk/package.json | 10 ++ .../platform-sdk/packages/sdk/src/index.ts | 3 + .../platform-sdk/packages/sdk/tsconfig.json | 6 + .../examples/platform-sdk/pnpm-workspace.yaml | 3 + .../examples/platform-sdk/tsconfig.base.json | 14 +++ .../examples/platform-sdk/turbo.json | 27 ++++ compositions/turbo-package/tests/README.md | 4 +- .../turbo-package/tests/smoke/component.yaml | 23 ++++ compositions/workspace/README.md | 18 +-- compositions/workspace/compositions.yaml | 10 +- compositions/workspace/examples/README.md | 4 +- .../charts/hello-chart/chart/Chart.yaml | 6 + .../chart/templates/configmap.yaml | 11 ++ .../charts/hello-chart/chart/values.yaml | 5 + .../examples/provider-smoke/component.yaml | 23 ++++ .../deploy/hello-deploy/values.yaml | 5 + .../smoke/kustomize/configmap.yaml | 6 + .../smoke/kustomize/kustomization.yaml | 4 + .../provider-smoke/smoke/provider-smoke.yaml | 22 ++++ .../provider-smoke/smoke/terraform/main.tf | 7 ++ compositions/workspace/tests/README.md | 4 +- .../workspace/tests/smoke/component.yaml | 18 +++ docs/authoring.md | 7 +- docs/getting-started.md | 6 +- docs/using-this-stack-from-oci.md | 6 +- docs/verification.md | 10 +- examples/full-enterprise/intent.yaml | 4 +- examples/monorepo-platform/intent.yaml | 4 +- examples/simple-nextjs/intent.yaml | 4 +- kiox.lock | 2 +- kiox.yaml | 2 +- registry/index.json | 118 +++++++++--------- scripts/generate-readme.sh | 48 +++++-- scripts/verify-composition.sh | 68 ++++++++++ scripts/verify.sh | 7 +- stack.yaml | 8 +- 139 files changed, 2251 insertions(+), 230 deletions(-) create mode 100644 compositions/cloudflare-pages-terraform/examples/docs-site-git/infra/cloudflare-pages-terraform/component.yaml create mode 100644 compositions/cloudflare-pages-terraform/examples/docs-site-git/infra/cloudflare-pages-terraform/main.tf create mode 100644 compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docs/deployment-paths.md create mode 100644 compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docs/getting-started.md create mode 100644 compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docusaurus.config.js create mode 100644 compositions/cloudflare-pages-terraform/examples/docs-site-git/website/package.json create mode 100644 compositions/cloudflare-pages-terraform/examples/docs-site-git/website/sidebars.js create mode 100644 compositions/cloudflare-pages-terraform/tests/smoke/component.yaml create mode 100644 compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/component.yaml create mode 100644 compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/package.json create mode 100644 compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/src/app.js create mode 100644 compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/wrangler.jsonc create mode 100644 compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/infra/cloudflare-pages-admin-console/main.tf create mode 100644 compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/package.json create mode 100644 compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/pnpm-workspace.yaml create mode 100644 compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/tsconfig.base.json create mode 100644 compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/turbo.json create mode 100644 compositions/cloudflare-pages-turbo-terraform/tests/smoke/component.yaml create mode 100644 compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/component.yaml create mode 100644 compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/package.json create mode 100644 compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/src/app.js create mode 100644 compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/wrangler.jsonc create mode 100644 compositions/cloudflare-pages-turbo/examples/web-console/package.json create mode 100644 compositions/cloudflare-pages-turbo/examples/web-console/pnpm-workspace.yaml create mode 100644 compositions/cloudflare-pages-turbo/examples/web-console/tsconfig.base.json create mode 100644 compositions/cloudflare-pages-turbo/examples/web-console/turbo.json create mode 100644 compositions/cloudflare-pages-turbo/tests/smoke/component.yaml create mode 100644 compositions/cloudflare-pages/examples/docs-site/website/component.yaml create mode 100644 compositions/cloudflare-pages/examples/docs-site/website/docs/deployment-paths.md create mode 100644 compositions/cloudflare-pages/examples/docs-site/website/docs/getting-started.md create mode 100644 compositions/cloudflare-pages/examples/docs-site/website/docusaurus.config.js create mode 100644 compositions/cloudflare-pages/examples/docs-site/website/package.json create mode 100644 compositions/cloudflare-pages/examples/docs-site/website/sidebars.js create mode 100644 compositions/cloudflare-pages/tests/smoke/component.yaml create mode 100644 compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/component.yaml create mode 100644 compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/package.json create mode 100644 compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/src/index.ts create mode 100644 compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/tsconfig.json create mode 100644 compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/wrangler.jsonc create mode 100644 compositions/cloudflare-worker-turbo/examples/api-edge/package.json create mode 100644 compositions/cloudflare-worker-turbo/examples/api-edge/pnpm-workspace.yaml create mode 100644 compositions/cloudflare-worker-turbo/examples/api-edge/tsconfig.base.json create mode 100644 compositions/cloudflare-worker-turbo/examples/api-edge/turbo.json create mode 100644 compositions/cloudflare-worker-turbo/tests/smoke/component.yaml create mode 100644 compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/component.yaml create mode 100644 compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/package.json create mode 100644 compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/src/index.ts create mode 100644 compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/tsconfig.json create mode 100644 compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/wrangler.jsonc create mode 100644 compositions/cloudflare-worker/examples/identity-worker/package.json create mode 100644 compositions/cloudflare-worker/examples/identity-worker/pnpm-workspace.yaml create mode 100644 compositions/cloudflare-worker/examples/identity-worker/tsconfig.base.json create mode 100644 compositions/cloudflare-worker/examples/identity-worker/turbo.json create mode 100644 compositions/cloudflare-worker/tests/smoke/component.yaml create mode 100644 compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/Chart.yaml create mode 100644 compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/component.yaml create mode 100644 compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/templates/configmap.yaml create mode 100644 compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/values.yaml create mode 100644 compositions/helm-chart/examples/identity-portal-chart/deploy/hello-deploy/values.yaml create mode 100644 compositions/helm-chart/tests/smoke/component.yaml create mode 100644 compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/Chart.yaml create mode 100644 compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/templates/configmap.yaml create mode 100644 compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/values.yaml create mode 100644 compositions/helm-values/examples/identity-portal-values/deploy/hello-deploy/component.yaml create mode 100644 compositions/helm-values/examples/identity-portal-values/deploy/hello-deploy/values.yaml create mode 100644 compositions/helm-values/tests/smoke/component.yaml create mode 100644 compositions/terraform/examples/network-foundation/infra/infra-1/component.yaml create mode 100644 compositions/terraform/examples/network-foundation/infra/infra-1/main.tf create mode 100644 compositions/terraform/tests/smoke/component.yaml create mode 100644 compositions/turbo-package/examples/platform-sdk/package.json create mode 100644 compositions/turbo-package/examples/platform-sdk/packages/sdk/component.yaml create mode 100644 compositions/turbo-package/examples/platform-sdk/packages/sdk/package.json create mode 100644 compositions/turbo-package/examples/platform-sdk/packages/sdk/src/index.ts create mode 100644 compositions/turbo-package/examples/platform-sdk/packages/sdk/tsconfig.json create mode 100644 compositions/turbo-package/examples/platform-sdk/pnpm-workspace.yaml create mode 100644 compositions/turbo-package/examples/platform-sdk/tsconfig.base.json create mode 100644 compositions/turbo-package/examples/platform-sdk/turbo.json create mode 100644 compositions/turbo-package/tests/smoke/component.yaml create mode 100644 compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/Chart.yaml create mode 100644 compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/templates/configmap.yaml create mode 100644 compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/values.yaml create mode 100644 compositions/workspace/examples/provider-smoke/component.yaml create mode 100644 compositions/workspace/examples/provider-smoke/deploy/hello-deploy/values.yaml create mode 100644 compositions/workspace/examples/provider-smoke/smoke/kustomize/configmap.yaml create mode 100644 compositions/workspace/examples/provider-smoke/smoke/kustomize/kustomization.yaml create mode 100644 compositions/workspace/examples/provider-smoke/smoke/provider-smoke.yaml create mode 100644 compositions/workspace/examples/provider-smoke/smoke/terraform/main.tf create mode 100644 compositions/workspace/tests/smoke/component.yaml create mode 100755 scripts/verify-composition.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3cdd006..4e08003 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: - name: Publish OCI package run: | - kiox -- orun publish ghcr.io/sourceplane/sumo-platform-ops-stack:${STACK_VERSION} \ + kiox -- orun publish ghcr.io/sourceplane/stack-tectonic:${STACK_VERSION} \ --root . \ --version "${STACK_VERSION}" diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index c19600f..34665d4 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -11,14 +11,49 @@ permissions: packages: read jobs: + composition-fixtures: + name: Composition fixture (${{ matrix.composition }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + composition: + - cloudflare-pages + - cloudflare-pages-turbo + - cloudflare-pages-terraform + - cloudflare-pages-turbo-terraform + - cloudflare-worker + - cloudflare-worker-turbo + - terraform + - helm-chart + - helm-values + - turbo-package + - workspace + steps: + - uses: actions/checkout@v4 + + - name: Make helper scripts executable + run: chmod +x scripts/*.sh + + - name: Verify composition fixtures + run: ./scripts/verify-composition.sh "${{ matrix.composition }}" + verify-stack: name: Verify stack catalog + needs: composition-fixtures runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Initialize orun workspace uses: sourceplane/kiox-action@v2.1.2 diff --git a/README.md b/README.md index 4b70895..1310648 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Sumo Platform Ops Stack +# Stack Tectonic Versioned OCI catalog for reusable Orun compositions, blueprints, examples, and release metadata. This repository is the source of truth for the stack published to: -`oci://ghcr.io/sourceplane/sumo-platform-ops-stack:` +`oci://ghcr.io/sourceplane/stack-tectonic:` ## Use the OCI package in `intent.yaml` @@ -13,9 +13,9 @@ Pin the catalog as a composition source in the consumer repository: ```yaml compositions: sources: - - name: sumo-platform-ops + - name: stack-tectonic kind: oci - ref: oci://ghcr.io/sourceplane/sumo-platform-ops-stack:0.10.0 + ref: oci://ghcr.io/sourceplane/stack-tectonic:0.11.0 ``` Keep the `orun` runtime pinned separately in `kiox.yaml`, then plan or run against that intent. The full consumer workflow is in [docs/using-this-stack-from-oci.md](docs/using-this-stack-from-oci.md). @@ -23,7 +23,7 @@ Keep the `orun` runtime pinned separately in `kiox.yaml`, then plan or run again ## Catalog layout ```text -sumo-platform-ops-stack/ +stack-tectonic/ ├── stack.yaml ├── README.md ├── docs/ @@ -62,10 +62,11 @@ Every composition now lives under `compositions//` so docs, examples, test ## Trust signals -- `scripts/verify.sh` validates docs metadata and runs the stack OCI dry-run publish path. +- `scripts/verify-composition.sh` enforces that every exported composition keeps real examples and smoke fixtures beside its contract. +- `scripts/verify.sh` validates generated docs and scores, checks every composition fixture, and runs the stack OCI dry-run publish path. - `scripts/score.sh` generates `registry/index.json` with maturity scores and grades. -- GitHub workflows split verification, docs checks, scorecard generation, and releases into separate pipelines. -- Current scores are intentionally conservative until each composition has runnable examples and deeper smoke coverage. +- Composition fixtures are excerpted or adapted from `example-platform-repo` so the catalog documents real repo shapes instead of synthetic placeholders. +- GitHub workflows split per-composition fixture checks, full catalog verification, docs checks, scorecard generation, and releases into separate pipelines. ## Docs @@ -81,6 +82,6 @@ Every composition now lives under `compositions//` so docs, examples, test 1. Update `stack.yaml`. 2. Run `./scripts/verify.sh`. 3. Merge to `main`. -4. Push a matching tag like `v0.10.0`. +4. Push a matching tag like `v0.11.0`. The release workflow publishes the OCI package, creates the GitHub release, and uploads the generated registry index. diff --git a/compositions/cloudflare-pages-terraform/README.md b/compositions/cloudflare-pages-terraform/README.md index 9864681..8c03a29 100644 --- a/compositions/cloudflare-pages-terraform/README.md +++ b/compositions/cloudflare-pages-terraform/README.md @@ -1,6 +1,6 @@ # cloudflare-pages-terraform -`cloudflare-pages-terraform` is an exported Orun composition in the Sumo Platform Ops catalog. +`cloudflare-pages-terraform` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -12,12 +12,16 @@ Verify static site builds locally and reconcile a Git-backed Cloudflare Pages pr - **Path:** `compositions/cloudflare-pages-terraform` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. -## Next steps +- `examples/docs-site-git` -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +## Test fixtures + +- `tests/smoke` + +## Verification + +`./scripts/verify-composition.sh cloudflare-pages-terraform` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. diff --git a/compositions/cloudflare-pages-terraform/examples/README.md b/compositions/cloudflare-pages-terraform/examples/README.md index e69b0c3..0916391 100644 --- a/compositions/cloudflare-pages-terraform/examples/README.md +++ b/compositions/cloudflare-pages-terraform/examples/README.md @@ -1,5 +1,5 @@ # Examples for cloudflare-pages-terraform -Put consumer-facing example assets for `cloudflare-pages-terraform` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `cloudflare-pages-terraform` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +- `examples/docs-site-git` diff --git a/compositions/cloudflare-pages-terraform/examples/docs-site-git/infra/cloudflare-pages-terraform/component.yaml b/compositions/cloudflare-pages-terraform/examples/docs-site-git/infra/cloudflare-pages-terraform/component.yaml new file mode 100644 index 0000000..bef7993 --- /dev/null +++ b/compositions/cloudflare-pages-terraform/examples/docs-site-git/infra/cloudflare-pages-terraform/component.yaml @@ -0,0 +1,31 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: docs-site-git-source + +spec: + type: cloudflare-pages-terraform + domain: platform-docs + subscribe: + environments: + - production + inputs: + siteDir: ../../website + installCommand: npm ci + buildCommand: npm run docs:build + cloudflareBuildCommand: npm ci && npm run docs:build + outputDir: docs-build + rootDir: website + nodeVersion: "20" + terraformDir: . + terraformVersion: 1.9.8 + projectName: example-platform-docs-terraform + productionBranch: main + repoOwner: sourceplane + repoName: example-platform-repo + labels: + team: platform + layer: foundation + surface: docs + runtime: cloudflare \ No newline at end of file diff --git a/compositions/cloudflare-pages-terraform/examples/docs-site-git/infra/cloudflare-pages-terraform/main.tf b/compositions/cloudflare-pages-terraform/examples/docs-site-git/infra/cloudflare-pages-terraform/main.tf new file mode 100644 index 0000000..de0cd30 --- /dev/null +++ b/compositions/cloudflare-pages-terraform/examples/docs-site-git/infra/cloudflare-pages-terraform/main.tf @@ -0,0 +1,87 @@ +terraform { + required_version = ">= 1.6.0" + + required_providers { + cloudflare = { + source = "cloudflare/cloudflare" + version = "~> 4.32" + } + } +} + +variable "account_id" { + description = "Cloudflare account identifier used by the Pages project" + type = string +} + +variable "project_name" { + description = "Cloudflare Pages project name" + type = string +} + +variable "production_branch" { + description = "Git branch used for production deployments" + type = string +} + +variable "repo_owner" { + description = "GitHub owner connected to the Cloudflare Pages project" + type = string +} + +variable "repo_name" { + description = "GitHub repository connected to the Cloudflare Pages project" + type = string +} + +variable "build_command" { + description = "Build command Cloudflare Pages runs for the site" + type = string +} + +variable "destination_dir" { + description = "Directory Cloudflare Pages publishes after the build" + type = string +} + +variable "root_dir" { + description = "Repository-root relative directory Cloudflare Pages builds from" + type = string +} + +resource "cloudflare_pages_project" "docs" { + account_id = var.account_id + name = var.project_name + production_branch = var.production_branch + + source { + type = "github" + + config { + owner = var.repo_owner + repo_name = var.repo_name + production_branch = var.production_branch + deployments_enabled = true + production_deployment_enabled = true + preview_deployment_setting = "all" + pr_comments_enabled = true + } + } + + build_config { + build_caching = true + build_command = var.build_command + destination_dir = var.destination_dir + root_dir = var.root_dir + } +} + +output "pages_project_name" { + value = cloudflare_pages_project.docs.name + description = "Cloudflare Pages project name" +} + +output "pages_subdomain" { + value = cloudflare_pages_project.docs.subdomain + description = "Cloudflare Pages subdomain assigned to the project" +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docs/deployment-paths.md b/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docs/deployment-paths.md new file mode 100644 index 0000000..98f116b --- /dev/null +++ b/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docs/deployment-paths.md @@ -0,0 +1,98 @@ +--- +title: Deployment Paths +--- + +## Wrangler direct upload {#wrangler-direct-upload} + +The `cloudflare-pages` composition builds the site in CI and then uses `wrangler pages deploy` to +push the generated `docs-build/` directory to a Direct Upload Pages project. + +Key inputs: + +- `siteDir` +- `installCommand` +- `buildCommand` +- `outputDir` +- `projectName` +- `productionBranch` + +That path is useful when you want deployment to follow the build artifact produced by Gluon. + +## Turbo worker deploy {#turbo-worker-deploy} + +The `cloudflare-worker-turbo` composition installs pnpm, runs workspace-level install, build, and +typecheck commands, then uses the app-local Wrangler config to publish a Worker from `apps/*`. + +Key inputs: + +- `workspaceDir` +- `appDir` +- `installCommand` +- `buildCommand` +- `typecheckCommand` +- `deployCommand` +- `pnpmVersion` + +That path is useful when each Worker app owns its own `component.yaml` and `wrangler.jsonc`, but the +real install and build still need to happen from the monorepo root. + +## Turbo Pages direct upload {#turbo-pages-direct-upload} + +The `cloudflare-pages-turbo` composition follows the same workspace-root install and build pattern, +then direct-uploads an app-specific output directory such as `apps/web-console/dist`. + +Key inputs: + +- `workspaceDir` +- `appDir` +- `installCommand` +- `buildCommand` +- `outputDir` +- `projectName` +- `pnpmVersion` + +That path is useful when the Pages app lives under `apps/`, the component manifest should stay next +to the app, and Gluon should still own the final build artifact. + +## Terraform Git source {#terraform-git-source} + +The `cloudflare-pages-terraform` composition validates the same local site build, then reconciles a +`cloudflare_pages_project` resource that points Cloudflare Pages at this GitHub repository. + +Key inputs: + +- `terraformDir` +- `rootDir` +- `cloudflareBuildCommand` +- `repoOwner` +- `repoName` +- `projectName` + +That path is useful when you want the Pages project itself versioned as infrastructure and let +Cloudflare build from Git after the project is connected. + +## Turbo Pages Terraform {#turbo-pages-terraform} + +The `cloudflare-pages-turbo-terraform` composition keeps the component manifest inside an `apps/*` +directory, performs the local pnpm and Turbo build from the workspace root, and then points Terraform +at an `infra/*` directory that owns the Cloudflare Pages project contract. + +Key inputs: + +- `workspaceDir` +- `appDir` +- `outputDir` +- `destinationDir` +- `rootDir` +- `terraformDir` +- `cloudflareBuildCommand` +- `pnpmVersion` + +That path is useful when platform teams want app-local manifests for discovery and ownership, but +still want the Cloudflare Pages project itself versioned under infrastructure code. + +## Choosing between them + +- Use Wrangler when Gluon should own the build artifact and publish it directly. +- Use Terraform when Gluon should manage the Pages project contract and let Cloudflare own the Git-triggered deploys. +- Use the Turbo variants when the reusable manifest should live inside an app or package directory while the install and build still need the monorepo root. \ No newline at end of file diff --git a/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docs/getting-started.md b/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docs/getting-started.md new file mode 100644 index 0000000..d5bc169 --- /dev/null +++ b/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docs/getting-started.md @@ -0,0 +1,51 @@ +--- +title: Getting Started +--- + +## Local build + +Run the docs site the same way the compositions do: + +```bash +cd website +npm ci +npm run docs:build +npm run docs:serve +``` + +The production build is written to `website/docs-build/`. + +## Turbo example builds + +The new `apps/` and `packages/` examples use pnpm and Turbo from the monorepo root: + +```bash +corepack enable +pnpm install --no-frozen-lockfile +pnpm turbo run build --filter=@example/web-console +pnpm turbo run typecheck --filter=@example/api-edge +``` + +Those commands mirror the inputs used by the `cloudflare-worker-turbo`, `cloudflare-pages-turbo`, +`cloudflare-pages-turbo-terraform`, and `turbo-package` compositions. + +## Why Docusaurus here + +Docusaurus is a good fit for this sample because it produces a plain static directory while still +exercising a realistic Node-based documentation toolchain. That makes it useful for both: + +- direct upload workflows that publish prebuilt assets +- Git-connected Pages projects that build inside Cloudflare + +## Credentials used in CI + +The repository expects these secrets in GitHub Actions: + +- `CLOUDFLARE_ACCOUNT_ID` +- `CLOUDFLARE_API_TOKEN` + +The direct-upload job only uses them when it is allowed to publish. The Terraform-backed job uses +the same variables when it needs to plan against or apply Cloudflare resources. + +Worker deploys use the same Cloudflare credentials because Wrangler creates the worker directly from +the app-local manifest under `apps/`. \ No newline at end of file diff --git a/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docusaurus.config.js b/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docusaurus.config.js new file mode 100644 index 0000000..edbc568 --- /dev/null +++ b/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/docusaurus.config.js @@ -0,0 +1,81 @@ +const config = { + title: 'Example Platform Docs', + tagline: 'Static docs deploy paths for Cloudflare Pages through Gluon compositions', + url: 'https://example-platform-docs.pages.dev', + baseUrl: '/', + organizationName: 'sourceplane', + projectName: 'example-platform-repo', + onBrokenLinks: 'throw', + onDuplicateRoutes: 'throw', + markdown: { + hooks: { + onBrokenMarkdownLinks: 'throw', + }, + }, + i18n: { + defaultLocale: 'en', + locales: ['en'], + }, + presets: [ + [ + 'classic', + { + docs: { + path: 'docs', + routeBasePath: '/', + sidebarPath: require.resolve('./sidebars.js'), + }, + blog: false, + theme: { + customCss: require.resolve('./src/css/custom.css'), + }, + }, + ], + ], + themeConfig: { + colorMode: { + defaultMode: 'light', + respectPrefersColorScheme: true, + }, + navbar: { + title: 'Example Platform', + items: [ + { + to: '/', + label: 'Docs', + position: 'left', + }, + { + href: 'https://github.com/sourceplane/example-platform-repo', + label: 'GitHub', + position: 'right', + }, + ], + }, + footer: { + style: 'dark', + links: [ + { + title: 'Paths', + items: [ + { label: 'Wrangler Direct Upload', to: '/deployment-paths#wrangler-direct-upload' }, + { label: 'Terraform Git Source', to: '/deployment-paths#terraform-git-source' }, + ], + }, + { + title: 'Repo', + items: [ + { label: 'Intent', href: 'https://github.com/sourceplane/example-platform-repo/blob/main/intent.yaml' }, + { label: 'Compositions', href: 'https://github.com/sourceplane/example-platform-repo/tree/main/compositions' }, + ], + }, + ], + copyright: `Copyright ${new Date().getFullYear()} sourceplane`, + }, + prism: { + additionalLanguages: ['bash', 'json', 'yaml'], + }, + }, +}; + +module.exports = config; diff --git a/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/package.json b/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/package.json new file mode 100644 index 0000000..2cf01d8 --- /dev/null +++ b/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/package.json @@ -0,0 +1,22 @@ +{ + "name": "example-platform-docs", + "version": "1.0.0", + "private": true, + "description": "Minimal Docusaurus site used to verify Cloudflare Pages compositions in example-platform-repo", + "scripts": { + "docs:start": "docusaurus start", + "docs:build": "docusaurus build --out-dir docs-build", + "docs:serve": "docusaurus serve --dir docs-build" + }, + "overrides": { + "webpack": "5.105.4", + "html-webpack-plugin": "5.6.6" + }, + "dependencies": { + "@docusaurus/core": "3.9.2", + "@docusaurus/preset-classic": "3.9.2", + "@mdx-js/react": "3.1.1", + "react": "19.2.4", + "react-dom": "19.2.4" + } +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/sidebars.js b/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/sidebars.js new file mode 100644 index 0000000..2aea2f9 --- /dev/null +++ b/compositions/cloudflare-pages-terraform/examples/docs-site-git/website/sidebars.js @@ -0,0 +1,3 @@ +module.exports = { + docsSidebar: ['intro', 'getting-started', 'deployment-paths'], +}; \ No newline at end of file diff --git a/compositions/cloudflare-pages-terraform/tests/README.md b/compositions/cloudflare-pages-terraform/tests/README.md index 2b6a975..f86cc04 100644 --- a/compositions/cloudflare-pages-terraform/tests/README.md +++ b/compositions/cloudflare-pages-terraform/tests/README.md @@ -1,5 +1,5 @@ # Tests for cloudflare-pages-terraform -Put composition-specific smoke tests or validation fixtures for `cloudflare-pages-terraform` here. +These files provide contract or smoke fixtures that CI can inspect for `cloudflare-pages-terraform` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +- `tests/smoke` diff --git a/compositions/cloudflare-pages-terraform/tests/smoke/component.yaml b/compositions/cloudflare-pages-terraform/tests/smoke/component.yaml new file mode 100644 index 0000000..bef7993 --- /dev/null +++ b/compositions/cloudflare-pages-terraform/tests/smoke/component.yaml @@ -0,0 +1,31 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: docs-site-git-source + +spec: + type: cloudflare-pages-terraform + domain: platform-docs + subscribe: + environments: + - production + inputs: + siteDir: ../../website + installCommand: npm ci + buildCommand: npm run docs:build + cloudflareBuildCommand: npm ci && npm run docs:build + outputDir: docs-build + rootDir: website + nodeVersion: "20" + terraformDir: . + terraformVersion: 1.9.8 + projectName: example-platform-docs-terraform + productionBranch: main + repoOwner: sourceplane + repoName: example-platform-repo + labels: + team: platform + layer: foundation + surface: docs + runtime: cloudflare \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo-terraform/README.md b/compositions/cloudflare-pages-turbo-terraform/README.md index 4f8028e..2b1f832 100644 --- a/compositions/cloudflare-pages-turbo-terraform/README.md +++ b/compositions/cloudflare-pages-turbo-terraform/README.md @@ -1,6 +1,6 @@ # cloudflare-pages-turbo-terraform -`cloudflare-pages-turbo-terraform` is an exported Orun composition in the Sumo Platform Ops catalog. +`cloudflare-pages-turbo-terraform` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -12,12 +12,16 @@ Verify a static app with Turbo locally and reconcile a Git-backed Cloudflare Pag - **Path:** `compositions/cloudflare-pages-turbo-terraform` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. -## Next steps +- `examples/admin-console-git` -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +## Test fixtures + +- `tests/smoke` + +## Verification + +`./scripts/verify-composition.sh cloudflare-pages-turbo-terraform` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. diff --git a/compositions/cloudflare-pages-turbo-terraform/examples/README.md b/compositions/cloudflare-pages-turbo-terraform/examples/README.md index 80fdd5f..b1d6172 100644 --- a/compositions/cloudflare-pages-turbo-terraform/examples/README.md +++ b/compositions/cloudflare-pages-turbo-terraform/examples/README.md @@ -1,5 +1,5 @@ # Examples for cloudflare-pages-turbo-terraform -Put consumer-facing example assets for `cloudflare-pages-turbo-terraform` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `cloudflare-pages-turbo-terraform` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +- `examples/admin-console-git` diff --git a/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/component.yaml b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/component.yaml new file mode 100644 index 0000000..770db61 --- /dev/null +++ b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/component.yaml @@ -0,0 +1,31 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: admin-console-pages-git + +spec: + type: cloudflare-pages-turbo-terraform + domain: platform-ui + subscribe: + environments: + - staging + - production + inputs: + cloudflareBuildCommand: corepack enable && pnpm turbo run build --filter=@example/admin-console + outputDir: dist + destinationDir: dist + rootDir: . + nodeVersion: "20" + pnpmVersion: "10.12.1" + terraformDir: ../../infra/cloudflare-pages-admin-console + terraformVersion: 1.9.8 + projectName: example-platform-admin-console + productionBranch: main + repoOwner: sourceplane + repoName: example-platform-repo + labels: + team: platform + layer: foundation + surface: admin-console + runtime: cloudflare \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/package.json b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/package.json new file mode 100644 index 0000000..e601fe4 --- /dev/null +++ b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/package.json @@ -0,0 +1,9 @@ +{ + "name": "@example/admin-console", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "build": "node ./scripts/build.mjs" + } +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/src/app.js b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/src/app.js new file mode 100644 index 0000000..25c37e6 --- /dev/null +++ b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/src/app.js @@ -0,0 +1,8 @@ +const panel = document.querySelector(".panel"); + +if (panel) { + const stamp = document.createElement("p"); + stamp.className = "timestamp"; + stamp.textContent = "Managed in Cloudflare through Terraform after Gluon planning."; + panel.append(stamp); +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/wrangler.jsonc b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/wrangler.jsonc new file mode 100644 index 0000000..e2f68c3 --- /dev/null +++ b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/apps/admin-console/wrangler.jsonc @@ -0,0 +1,6 @@ +{ + "$schema": "../../node_modules/wrangler/config-schema.json", + "name": "example-platform-admin-console", + "compatibility_date": "2026-04-25", + "pages_build_output_dir": "dist" +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/infra/cloudflare-pages-admin-console/main.tf b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/infra/cloudflare-pages-admin-console/main.tf new file mode 100644 index 0000000..f4eb061 --- /dev/null +++ b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/infra/cloudflare-pages-admin-console/main.tf @@ -0,0 +1,87 @@ +terraform { + required_version = ">= 1.6.0" + + required_providers { + cloudflare = { + source = "cloudflare/cloudflare" + version = "~> 4.32" + } + } +} + +variable "account_id" { + description = "Cloudflare account identifier used by the Pages project" + type = string +} + +variable "project_name" { + description = "Cloudflare Pages project name" + type = string +} + +variable "production_branch" { + description = "Git branch used for production deployments" + type = string +} + +variable "repo_owner" { + description = "GitHub owner connected to the Cloudflare Pages project" + type = string +} + +variable "repo_name" { + description = "GitHub repository connected to the Cloudflare Pages project" + type = string +} + +variable "build_command" { + description = "Build command Cloudflare Pages runs for the site" + type = string +} + +variable "destination_dir" { + description = "Directory Cloudflare Pages publishes after the build" + type = string +} + +variable "root_dir" { + description = "Repository-root relative directory Cloudflare Pages builds from" + type = string +} + +resource "cloudflare_pages_project" "admin_console" { + account_id = var.account_id + name = var.project_name + production_branch = var.production_branch + + source { + type = "github" + + config { + owner = var.repo_owner + repo_name = var.repo_name + production_branch = var.production_branch + deployments_enabled = true + production_deployment_enabled = true + preview_deployment_setting = "all" + pr_comments_enabled = true + } + } + + build_config { + build_caching = true + build_command = var.build_command + destination_dir = var.destination_dir + root_dir = var.root_dir + } +} + +output "pages_project_name" { + value = cloudflare_pages_project.admin_console.name + description = "Cloudflare Pages project name" +} + +output "pages_subdomain" { + value = cloudflare_pages_project.admin_console.subdomain + description = "Cloudflare Pages subdomain assigned to the project" +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/package.json b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/package.json new file mode 100644 index 0000000..d65acec --- /dev/null +++ b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/package.json @@ -0,0 +1,17 @@ +{ + "name": "example-platform-repo", + "private": true, + "version": "1.0.0", + "description": "Turbo-style Cloudflare deployment examples for gluon component discovery", + "packageManager": "pnpm@10.12.1", + "scripts": { + "build": "turbo run build", + "typecheck": "turbo run typecheck", + "deploy": "turbo run deploy" + }, + "devDependencies": { + "turbo": "2.5.8", + "typescript": "5.9.3", + "wrangler": "4.13.2" + } +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/pnpm-workspace.yaml b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/pnpm-workspace.yaml new file mode 100644 index 0000000..c7eaed9 --- /dev/null +++ b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - apps/* + - packages/* \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/tsconfig.base.json b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/tsconfig.base.json new file mode 100644 index 0000000..e7910f3 --- /dev/null +++ b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/tsconfig.base.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true, + "skipLibCheck": true, + "noEmit": true, + "lib": [ + "ES2022", + "DOM" + ] + } +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/turbo.json b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/turbo.json new file mode 100644 index 0000000..f24d8d7 --- /dev/null +++ b/compositions/cloudflare-pages-turbo-terraform/examples/admin-console-git/turbo.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://turborepo.com/schema.json", + "tasks": { + "build": { + "dependsOn": [ + "^build" + ], + "outputs": [ + "dist/**", + ".wrangler/**" + ] + }, + "typecheck": { + "dependsOn": [ + "^typecheck" + ], + "outputs": [] + }, + "deploy": { + "dependsOn": [ + "build" + ], + "cache": false, + "outputs": [] + } + } +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo-terraform/tests/README.md b/compositions/cloudflare-pages-turbo-terraform/tests/README.md index 69706c9..2362b1e 100644 --- a/compositions/cloudflare-pages-turbo-terraform/tests/README.md +++ b/compositions/cloudflare-pages-turbo-terraform/tests/README.md @@ -1,5 +1,5 @@ # Tests for cloudflare-pages-turbo-terraform -Put composition-specific smoke tests or validation fixtures for `cloudflare-pages-turbo-terraform` here. +These files provide contract or smoke fixtures that CI can inspect for `cloudflare-pages-turbo-terraform` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +- `tests/smoke` diff --git a/compositions/cloudflare-pages-turbo-terraform/tests/smoke/component.yaml b/compositions/cloudflare-pages-turbo-terraform/tests/smoke/component.yaml new file mode 100644 index 0000000..770db61 --- /dev/null +++ b/compositions/cloudflare-pages-turbo-terraform/tests/smoke/component.yaml @@ -0,0 +1,31 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: admin-console-pages-git + +spec: + type: cloudflare-pages-turbo-terraform + domain: platform-ui + subscribe: + environments: + - staging + - production + inputs: + cloudflareBuildCommand: corepack enable && pnpm turbo run build --filter=@example/admin-console + outputDir: dist + destinationDir: dist + rootDir: . + nodeVersion: "20" + pnpmVersion: "10.12.1" + terraformDir: ../../infra/cloudflare-pages-admin-console + terraformVersion: 1.9.8 + projectName: example-platform-admin-console + productionBranch: main + repoOwner: sourceplane + repoName: example-platform-repo + labels: + team: platform + layer: foundation + surface: admin-console + runtime: cloudflare \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo/README.md b/compositions/cloudflare-pages-turbo/README.md index e17f370..d173e7d 100644 --- a/compositions/cloudflare-pages-turbo/README.md +++ b/compositions/cloudflare-pages-turbo/README.md @@ -1,6 +1,6 @@ # cloudflare-pages-turbo -`cloudflare-pages-turbo` is an exported Orun composition in the Sumo Platform Ops catalog. +`cloudflare-pages-turbo` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -12,12 +12,16 @@ Build a static app with Turbo and direct-upload it to Cloudflare Pages - **Path:** `compositions/cloudflare-pages-turbo` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. -## Next steps +- `examples/web-console` -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +## Test fixtures + +- `tests/smoke` + +## Verification + +`./scripts/verify-composition.sh cloudflare-pages-turbo` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. diff --git a/compositions/cloudflare-pages-turbo/examples/README.md b/compositions/cloudflare-pages-turbo/examples/README.md index 60ff5c4..b08e76f 100644 --- a/compositions/cloudflare-pages-turbo/examples/README.md +++ b/compositions/cloudflare-pages-turbo/examples/README.md @@ -1,5 +1,5 @@ # Examples for cloudflare-pages-turbo -Put consumer-facing example assets for `cloudflare-pages-turbo` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `cloudflare-pages-turbo` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +- `examples/web-console` diff --git a/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/component.yaml b/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/component.yaml new file mode 100644 index 0000000..e537dc1 --- /dev/null +++ b/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/component.yaml @@ -0,0 +1,25 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: web-console-pages + +spec: + type: cloudflare-pages-turbo + domain: platform-ui + subscribe: + environments: + - preview + - staging + - production + inputs: + outputDir: dist + projectName: example-platform-web-console + nodeVersion: "20" + pnpmVersion: "10.12.1" + productionBranch: main + labels: + team: platform + layer: delivery + surface: web-console + runtime: cloudflare \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/package.json b/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/package.json new file mode 100644 index 0000000..40aaaa2 --- /dev/null +++ b/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/package.json @@ -0,0 +1,9 @@ +{ + "name": "@example/web-console", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "build": "node ./scripts/build.mjs" + } +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/src/app.js b/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/src/app.js new file mode 100644 index 0000000..ad59686 --- /dev/null +++ b/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/src/app.js @@ -0,0 +1,8 @@ +const panel = document.querySelector(".panel"); + +if (panel) { + const stamp = document.createElement("p"); + stamp.className = "timestamp"; + stamp.textContent = `Build source: apps/web-console at ${new Date().toISOString()}`; + panel.append(stamp); +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/wrangler.jsonc b/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/wrangler.jsonc new file mode 100644 index 0000000..67e99e2 --- /dev/null +++ b/compositions/cloudflare-pages-turbo/examples/web-console/apps/web-console/wrangler.jsonc @@ -0,0 +1,6 @@ +{ + "$schema": "../../node_modules/wrangler/config-schema.json", + "name": "example-platform-web-console", + "compatibility_date": "2026-04-25", + "pages_build_output_dir": "dist" +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo/examples/web-console/package.json b/compositions/cloudflare-pages-turbo/examples/web-console/package.json new file mode 100644 index 0000000..d65acec --- /dev/null +++ b/compositions/cloudflare-pages-turbo/examples/web-console/package.json @@ -0,0 +1,17 @@ +{ + "name": "example-platform-repo", + "private": true, + "version": "1.0.0", + "description": "Turbo-style Cloudflare deployment examples for gluon component discovery", + "packageManager": "pnpm@10.12.1", + "scripts": { + "build": "turbo run build", + "typecheck": "turbo run typecheck", + "deploy": "turbo run deploy" + }, + "devDependencies": { + "turbo": "2.5.8", + "typescript": "5.9.3", + "wrangler": "4.13.2" + } +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo/examples/web-console/pnpm-workspace.yaml b/compositions/cloudflare-pages-turbo/examples/web-console/pnpm-workspace.yaml new file mode 100644 index 0000000..c7eaed9 --- /dev/null +++ b/compositions/cloudflare-pages-turbo/examples/web-console/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - apps/* + - packages/* \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo/examples/web-console/tsconfig.base.json b/compositions/cloudflare-pages-turbo/examples/web-console/tsconfig.base.json new file mode 100644 index 0000000..e7910f3 --- /dev/null +++ b/compositions/cloudflare-pages-turbo/examples/web-console/tsconfig.base.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true, + "skipLibCheck": true, + "noEmit": true, + "lib": [ + "ES2022", + "DOM" + ] + } +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo/examples/web-console/turbo.json b/compositions/cloudflare-pages-turbo/examples/web-console/turbo.json new file mode 100644 index 0000000..f24d8d7 --- /dev/null +++ b/compositions/cloudflare-pages-turbo/examples/web-console/turbo.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://turborepo.com/schema.json", + "tasks": { + "build": { + "dependsOn": [ + "^build" + ], + "outputs": [ + "dist/**", + ".wrangler/**" + ] + }, + "typecheck": { + "dependsOn": [ + "^typecheck" + ], + "outputs": [] + }, + "deploy": { + "dependsOn": [ + "build" + ], + "cache": false, + "outputs": [] + } + } +} \ No newline at end of file diff --git a/compositions/cloudflare-pages-turbo/tests/README.md b/compositions/cloudflare-pages-turbo/tests/README.md index f9bf735..24bf237 100644 --- a/compositions/cloudflare-pages-turbo/tests/README.md +++ b/compositions/cloudflare-pages-turbo/tests/README.md @@ -1,5 +1,5 @@ # Tests for cloudflare-pages-turbo -Put composition-specific smoke tests or validation fixtures for `cloudflare-pages-turbo` here. +These files provide contract or smoke fixtures that CI can inspect for `cloudflare-pages-turbo` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +- `tests/smoke` diff --git a/compositions/cloudflare-pages-turbo/tests/smoke/component.yaml b/compositions/cloudflare-pages-turbo/tests/smoke/component.yaml new file mode 100644 index 0000000..e537dc1 --- /dev/null +++ b/compositions/cloudflare-pages-turbo/tests/smoke/component.yaml @@ -0,0 +1,25 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: web-console-pages + +spec: + type: cloudflare-pages-turbo + domain: platform-ui + subscribe: + environments: + - preview + - staging + - production + inputs: + outputDir: dist + projectName: example-platform-web-console + nodeVersion: "20" + pnpmVersion: "10.12.1" + productionBranch: main + labels: + team: platform + layer: delivery + surface: web-console + runtime: cloudflare \ No newline at end of file diff --git a/compositions/cloudflare-pages/README.md b/compositions/cloudflare-pages/README.md index 41c5eaa..da7b056 100644 --- a/compositions/cloudflare-pages/README.md +++ b/compositions/cloudflare-pages/README.md @@ -1,6 +1,6 @@ # cloudflare-pages -`cloudflare-pages` is an exported Orun composition in the Sumo Platform Ops catalog. +`cloudflare-pages` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -12,12 +12,16 @@ Build static site assets and direct-upload them to Cloudflare Pages with Wrangle - **Path:** `compositions/cloudflare-pages` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. -## Next steps +- `examples/docs-site` -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +## Test fixtures + +- `tests/smoke` + +## Verification + +`./scripts/verify-composition.sh cloudflare-pages` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. diff --git a/compositions/cloudflare-pages/examples/README.md b/compositions/cloudflare-pages/examples/README.md index 48c559a..53b3594 100644 --- a/compositions/cloudflare-pages/examples/README.md +++ b/compositions/cloudflare-pages/examples/README.md @@ -1,5 +1,5 @@ # Examples for cloudflare-pages -Put consumer-facing example assets for `cloudflare-pages` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `cloudflare-pages` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +- `examples/docs-site` diff --git a/compositions/cloudflare-pages/examples/docs-site/website/component.yaml b/compositions/cloudflare-pages/examples/docs-site/website/component.yaml new file mode 100644 index 0000000..2a301a5 --- /dev/null +++ b/compositions/cloudflare-pages/examples/docs-site/website/component.yaml @@ -0,0 +1,25 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: docs-site-direct-upload + +spec: + type: cloudflare-pages + domain: platform-docs + subscribe: + environments: + - production + inputs: + siteDir: . + installCommand: npm ci + buildCommand: npm run docs:build + outputDir: docs-build + projectName: example-platform-docs-wrangler + nodeVersion: "20" + productionBranch: main + labels: + team: platform + layer: delivery + surface: docs + runtime: cloudflare diff --git a/compositions/cloudflare-pages/examples/docs-site/website/docs/deployment-paths.md b/compositions/cloudflare-pages/examples/docs-site/website/docs/deployment-paths.md new file mode 100644 index 0000000..98f116b --- /dev/null +++ b/compositions/cloudflare-pages/examples/docs-site/website/docs/deployment-paths.md @@ -0,0 +1,98 @@ +--- +title: Deployment Paths +--- + +## Wrangler direct upload {#wrangler-direct-upload} + +The `cloudflare-pages` composition builds the site in CI and then uses `wrangler pages deploy` to +push the generated `docs-build/` directory to a Direct Upload Pages project. + +Key inputs: + +- `siteDir` +- `installCommand` +- `buildCommand` +- `outputDir` +- `projectName` +- `productionBranch` + +That path is useful when you want deployment to follow the build artifact produced by Gluon. + +## Turbo worker deploy {#turbo-worker-deploy} + +The `cloudflare-worker-turbo` composition installs pnpm, runs workspace-level install, build, and +typecheck commands, then uses the app-local Wrangler config to publish a Worker from `apps/*`. + +Key inputs: + +- `workspaceDir` +- `appDir` +- `installCommand` +- `buildCommand` +- `typecheckCommand` +- `deployCommand` +- `pnpmVersion` + +That path is useful when each Worker app owns its own `component.yaml` and `wrangler.jsonc`, but the +real install and build still need to happen from the monorepo root. + +## Turbo Pages direct upload {#turbo-pages-direct-upload} + +The `cloudflare-pages-turbo` composition follows the same workspace-root install and build pattern, +then direct-uploads an app-specific output directory such as `apps/web-console/dist`. + +Key inputs: + +- `workspaceDir` +- `appDir` +- `installCommand` +- `buildCommand` +- `outputDir` +- `projectName` +- `pnpmVersion` + +That path is useful when the Pages app lives under `apps/`, the component manifest should stay next +to the app, and Gluon should still own the final build artifact. + +## Terraform Git source {#terraform-git-source} + +The `cloudflare-pages-terraform` composition validates the same local site build, then reconciles a +`cloudflare_pages_project` resource that points Cloudflare Pages at this GitHub repository. + +Key inputs: + +- `terraformDir` +- `rootDir` +- `cloudflareBuildCommand` +- `repoOwner` +- `repoName` +- `projectName` + +That path is useful when you want the Pages project itself versioned as infrastructure and let +Cloudflare build from Git after the project is connected. + +## Turbo Pages Terraform {#turbo-pages-terraform} + +The `cloudflare-pages-turbo-terraform` composition keeps the component manifest inside an `apps/*` +directory, performs the local pnpm and Turbo build from the workspace root, and then points Terraform +at an `infra/*` directory that owns the Cloudflare Pages project contract. + +Key inputs: + +- `workspaceDir` +- `appDir` +- `outputDir` +- `destinationDir` +- `rootDir` +- `terraformDir` +- `cloudflareBuildCommand` +- `pnpmVersion` + +That path is useful when platform teams want app-local manifests for discovery and ownership, but +still want the Cloudflare Pages project itself versioned under infrastructure code. + +## Choosing between them + +- Use Wrangler when Gluon should own the build artifact and publish it directly. +- Use Terraform when Gluon should manage the Pages project contract and let Cloudflare own the Git-triggered deploys. +- Use the Turbo variants when the reusable manifest should live inside an app or package directory while the install and build still need the monorepo root. \ No newline at end of file diff --git a/compositions/cloudflare-pages/examples/docs-site/website/docs/getting-started.md b/compositions/cloudflare-pages/examples/docs-site/website/docs/getting-started.md new file mode 100644 index 0000000..d5bc169 --- /dev/null +++ b/compositions/cloudflare-pages/examples/docs-site/website/docs/getting-started.md @@ -0,0 +1,51 @@ +--- +title: Getting Started +--- + +## Local build + +Run the docs site the same way the compositions do: + +```bash +cd website +npm ci +npm run docs:build +npm run docs:serve +``` + +The production build is written to `website/docs-build/`. + +## Turbo example builds + +The new `apps/` and `packages/` examples use pnpm and Turbo from the monorepo root: + +```bash +corepack enable +pnpm install --no-frozen-lockfile +pnpm turbo run build --filter=@example/web-console +pnpm turbo run typecheck --filter=@example/api-edge +``` + +Those commands mirror the inputs used by the `cloudflare-worker-turbo`, `cloudflare-pages-turbo`, +`cloudflare-pages-turbo-terraform`, and `turbo-package` compositions. + +## Why Docusaurus here + +Docusaurus is a good fit for this sample because it produces a plain static directory while still +exercising a realistic Node-based documentation toolchain. That makes it useful for both: + +- direct upload workflows that publish prebuilt assets +- Git-connected Pages projects that build inside Cloudflare + +## Credentials used in CI + +The repository expects these secrets in GitHub Actions: + +- `CLOUDFLARE_ACCOUNT_ID` +- `CLOUDFLARE_API_TOKEN` + +The direct-upload job only uses them when it is allowed to publish. The Terraform-backed job uses +the same variables when it needs to plan against or apply Cloudflare resources. + +Worker deploys use the same Cloudflare credentials because Wrangler creates the worker directly from +the app-local manifest under `apps/`. \ No newline at end of file diff --git a/compositions/cloudflare-pages/examples/docs-site/website/docusaurus.config.js b/compositions/cloudflare-pages/examples/docs-site/website/docusaurus.config.js new file mode 100644 index 0000000..edbc568 --- /dev/null +++ b/compositions/cloudflare-pages/examples/docs-site/website/docusaurus.config.js @@ -0,0 +1,81 @@ +const config = { + title: 'Example Platform Docs', + tagline: 'Static docs deploy paths for Cloudflare Pages through Gluon compositions', + url: 'https://example-platform-docs.pages.dev', + baseUrl: '/', + organizationName: 'sourceplane', + projectName: 'example-platform-repo', + onBrokenLinks: 'throw', + onDuplicateRoutes: 'throw', + markdown: { + hooks: { + onBrokenMarkdownLinks: 'throw', + }, + }, + i18n: { + defaultLocale: 'en', + locales: ['en'], + }, + presets: [ + [ + 'classic', + { + docs: { + path: 'docs', + routeBasePath: '/', + sidebarPath: require.resolve('./sidebars.js'), + }, + blog: false, + theme: { + customCss: require.resolve('./src/css/custom.css'), + }, + }, + ], + ], + themeConfig: { + colorMode: { + defaultMode: 'light', + respectPrefersColorScheme: true, + }, + navbar: { + title: 'Example Platform', + items: [ + { + to: '/', + label: 'Docs', + position: 'left', + }, + { + href: 'https://github.com/sourceplane/example-platform-repo', + label: 'GitHub', + position: 'right', + }, + ], + }, + footer: { + style: 'dark', + links: [ + { + title: 'Paths', + items: [ + { label: 'Wrangler Direct Upload', to: '/deployment-paths#wrangler-direct-upload' }, + { label: 'Terraform Git Source', to: '/deployment-paths#terraform-git-source' }, + ], + }, + { + title: 'Repo', + items: [ + { label: 'Intent', href: 'https://github.com/sourceplane/example-platform-repo/blob/main/intent.yaml' }, + { label: 'Compositions', href: 'https://github.com/sourceplane/example-platform-repo/tree/main/compositions' }, + ], + }, + ], + copyright: `Copyright ${new Date().getFullYear()} sourceplane`, + }, + prism: { + additionalLanguages: ['bash', 'json', 'yaml'], + }, + }, +}; + +module.exports = config; diff --git a/compositions/cloudflare-pages/examples/docs-site/website/package.json b/compositions/cloudflare-pages/examples/docs-site/website/package.json new file mode 100644 index 0000000..2cf01d8 --- /dev/null +++ b/compositions/cloudflare-pages/examples/docs-site/website/package.json @@ -0,0 +1,22 @@ +{ + "name": "example-platform-docs", + "version": "1.0.0", + "private": true, + "description": "Minimal Docusaurus site used to verify Cloudflare Pages compositions in example-platform-repo", + "scripts": { + "docs:start": "docusaurus start", + "docs:build": "docusaurus build --out-dir docs-build", + "docs:serve": "docusaurus serve --dir docs-build" + }, + "overrides": { + "webpack": "5.105.4", + "html-webpack-plugin": "5.6.6" + }, + "dependencies": { + "@docusaurus/core": "3.9.2", + "@docusaurus/preset-classic": "3.9.2", + "@mdx-js/react": "3.1.1", + "react": "19.2.4", + "react-dom": "19.2.4" + } +} \ No newline at end of file diff --git a/compositions/cloudflare-pages/examples/docs-site/website/sidebars.js b/compositions/cloudflare-pages/examples/docs-site/website/sidebars.js new file mode 100644 index 0000000..2aea2f9 --- /dev/null +++ b/compositions/cloudflare-pages/examples/docs-site/website/sidebars.js @@ -0,0 +1,3 @@ +module.exports = { + docsSidebar: ['intro', 'getting-started', 'deployment-paths'], +}; \ No newline at end of file diff --git a/compositions/cloudflare-pages/tests/README.md b/compositions/cloudflare-pages/tests/README.md index bfe24a1..f9cf262 100644 --- a/compositions/cloudflare-pages/tests/README.md +++ b/compositions/cloudflare-pages/tests/README.md @@ -1,5 +1,5 @@ # Tests for cloudflare-pages -Put composition-specific smoke tests or validation fixtures for `cloudflare-pages` here. +These files provide contract or smoke fixtures that CI can inspect for `cloudflare-pages` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +- `tests/smoke` diff --git a/compositions/cloudflare-pages/tests/smoke/component.yaml b/compositions/cloudflare-pages/tests/smoke/component.yaml new file mode 100644 index 0000000..2a301a5 --- /dev/null +++ b/compositions/cloudflare-pages/tests/smoke/component.yaml @@ -0,0 +1,25 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: docs-site-direct-upload + +spec: + type: cloudflare-pages + domain: platform-docs + subscribe: + environments: + - production + inputs: + siteDir: . + installCommand: npm ci + buildCommand: npm run docs:build + outputDir: docs-build + projectName: example-platform-docs-wrangler + nodeVersion: "20" + productionBranch: main + labels: + team: platform + layer: delivery + surface: docs + runtime: cloudflare diff --git a/compositions/cloudflare-worker-turbo/README.md b/compositions/cloudflare-worker-turbo/README.md index 54c5b52..b6b5e5d 100644 --- a/compositions/cloudflare-worker-turbo/README.md +++ b/compositions/cloudflare-worker-turbo/README.md @@ -1,6 +1,6 @@ # cloudflare-worker-turbo -`cloudflare-worker-turbo` is an exported Orun composition in the Sumo Platform Ops catalog. +`cloudflare-worker-turbo` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -12,12 +12,16 @@ Verify a Cloudflare Worker app and deploy it from the production branch - **Path:** `compositions/cloudflare-worker-turbo` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. -## Next steps +- `examples/api-edge` -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +## Test fixtures + +- `tests/smoke` + +## Verification + +`./scripts/verify-composition.sh cloudflare-worker-turbo` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. diff --git a/compositions/cloudflare-worker-turbo/examples/README.md b/compositions/cloudflare-worker-turbo/examples/README.md index 46f652c..7cc7512 100644 --- a/compositions/cloudflare-worker-turbo/examples/README.md +++ b/compositions/cloudflare-worker-turbo/examples/README.md @@ -1,5 +1,5 @@ # Examples for cloudflare-worker-turbo -Put consumer-facing example assets for `cloudflare-worker-turbo` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `cloudflare-worker-turbo` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +- `examples/api-edge` diff --git a/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/component.yaml b/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/component.yaml new file mode 100644 index 0000000..ae4d423 --- /dev/null +++ b/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/component.yaml @@ -0,0 +1,23 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: api-edge-worker + +spec: + type: cloudflare-worker-turbo + domain: platform-runtime + subscribe: + environments: + - dev + - staging + - production + inputs: + nodeVersion: "20" + pnpmVersion: "10.12.1" + productionBranch: main + labels: + team: platform + layer: runtime + surface: api + runtime: cloudflare \ No newline at end of file diff --git a/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/package.json b/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/package.json new file mode 100644 index 0000000..392629a --- /dev/null +++ b/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/package.json @@ -0,0 +1,11 @@ +{ + "name": "@example/api-edge", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "build": "tsc -p tsconfig.json --noEmit", + "typecheck": "tsc -p tsconfig.json --noEmit", + "deploy": "wrangler deploy --config wrangler.jsonc" + } +} \ No newline at end of file diff --git a/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/src/index.ts b/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/src/index.ts new file mode 100644 index 0000000..371079f --- /dev/null +++ b/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/src/index.ts @@ -0,0 +1,15 @@ +interface Env { + API_NAME?: string; +} + +export default { + async fetch(request: Request, env: Env): Promise { + const url = new URL(request.url); + + return Response.json({ + ok: true, + path: url.pathname, + service: env.API_NAME ?? "api-edge", + }); + }, +}; \ No newline at end of file diff --git a/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/tsconfig.json b/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/tsconfig.json new file mode 100644 index 0000000..32a6156 --- /dev/null +++ b/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "include": [ + "src/**/*.ts" + ] +} \ No newline at end of file diff --git a/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/wrangler.jsonc b/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/wrangler.jsonc new file mode 100644 index 0000000..637ddf9 --- /dev/null +++ b/compositions/cloudflare-worker-turbo/examples/api-edge/apps/api-edge/wrangler.jsonc @@ -0,0 +1,10 @@ +{ + "$schema": "../../node_modules/wrangler/config-schema.json", + "name": "example-platform-api-edge", + "main": "src/index.ts", + "compatibility_date": "2026-04-25", + "workers_dev": true, + "observability": { + "enabled": true + } +} \ No newline at end of file diff --git a/compositions/cloudflare-worker-turbo/examples/api-edge/package.json b/compositions/cloudflare-worker-turbo/examples/api-edge/package.json new file mode 100644 index 0000000..d65acec --- /dev/null +++ b/compositions/cloudflare-worker-turbo/examples/api-edge/package.json @@ -0,0 +1,17 @@ +{ + "name": "example-platform-repo", + "private": true, + "version": "1.0.0", + "description": "Turbo-style Cloudflare deployment examples for gluon component discovery", + "packageManager": "pnpm@10.12.1", + "scripts": { + "build": "turbo run build", + "typecheck": "turbo run typecheck", + "deploy": "turbo run deploy" + }, + "devDependencies": { + "turbo": "2.5.8", + "typescript": "5.9.3", + "wrangler": "4.13.2" + } +} \ No newline at end of file diff --git a/compositions/cloudflare-worker-turbo/examples/api-edge/pnpm-workspace.yaml b/compositions/cloudflare-worker-turbo/examples/api-edge/pnpm-workspace.yaml new file mode 100644 index 0000000..c7eaed9 --- /dev/null +++ b/compositions/cloudflare-worker-turbo/examples/api-edge/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - apps/* + - packages/* \ No newline at end of file diff --git a/compositions/cloudflare-worker-turbo/examples/api-edge/tsconfig.base.json b/compositions/cloudflare-worker-turbo/examples/api-edge/tsconfig.base.json new file mode 100644 index 0000000..e7910f3 --- /dev/null +++ b/compositions/cloudflare-worker-turbo/examples/api-edge/tsconfig.base.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true, + "skipLibCheck": true, + "noEmit": true, + "lib": [ + "ES2022", + "DOM" + ] + } +} \ No newline at end of file diff --git a/compositions/cloudflare-worker-turbo/examples/api-edge/turbo.json b/compositions/cloudflare-worker-turbo/examples/api-edge/turbo.json new file mode 100644 index 0000000..f24d8d7 --- /dev/null +++ b/compositions/cloudflare-worker-turbo/examples/api-edge/turbo.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://turborepo.com/schema.json", + "tasks": { + "build": { + "dependsOn": [ + "^build" + ], + "outputs": [ + "dist/**", + ".wrangler/**" + ] + }, + "typecheck": { + "dependsOn": [ + "^typecheck" + ], + "outputs": [] + }, + "deploy": { + "dependsOn": [ + "build" + ], + "cache": false, + "outputs": [] + } + } +} \ No newline at end of file diff --git a/compositions/cloudflare-worker-turbo/tests/README.md b/compositions/cloudflare-worker-turbo/tests/README.md index 5c4f2c3..5322964 100644 --- a/compositions/cloudflare-worker-turbo/tests/README.md +++ b/compositions/cloudflare-worker-turbo/tests/README.md @@ -1,5 +1,5 @@ # Tests for cloudflare-worker-turbo -Put composition-specific smoke tests or validation fixtures for `cloudflare-worker-turbo` here. +These files provide contract or smoke fixtures that CI can inspect for `cloudflare-worker-turbo` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +- `tests/smoke` diff --git a/compositions/cloudflare-worker-turbo/tests/smoke/component.yaml b/compositions/cloudflare-worker-turbo/tests/smoke/component.yaml new file mode 100644 index 0000000..ae4d423 --- /dev/null +++ b/compositions/cloudflare-worker-turbo/tests/smoke/component.yaml @@ -0,0 +1,23 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: api-edge-worker + +spec: + type: cloudflare-worker-turbo + domain: platform-runtime + subscribe: + environments: + - dev + - staging + - production + inputs: + nodeVersion: "20" + pnpmVersion: "10.12.1" + productionBranch: main + labels: + team: platform + layer: runtime + surface: api + runtime: cloudflare \ No newline at end of file diff --git a/compositions/cloudflare-worker/README.md b/compositions/cloudflare-worker/README.md index a6c0b8d..8408509 100644 --- a/compositions/cloudflare-worker/README.md +++ b/compositions/cloudflare-worker/README.md @@ -1,6 +1,6 @@ # cloudflare-worker -`cloudflare-worker` is an exported Orun composition in the Sumo Platform Ops catalog. +`cloudflare-worker` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -12,12 +12,16 @@ Verify a Cloudflare Worker app and deploy it from the production branch - **Path:** `compositions/cloudflare-worker` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. -## Next steps +- `examples/identity-worker` -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +## Test fixtures + +- `tests/smoke` + +## Verification + +`./scripts/verify-composition.sh cloudflare-worker` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. diff --git a/compositions/cloudflare-worker/examples/README.md b/compositions/cloudflare-worker/examples/README.md index 612dba3..6ce50ab 100644 --- a/compositions/cloudflare-worker/examples/README.md +++ b/compositions/cloudflare-worker/examples/README.md @@ -1,5 +1,5 @@ # Examples for cloudflare-worker -Put consumer-facing example assets for `cloudflare-worker` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `cloudflare-worker` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +- `examples/identity-worker` diff --git a/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/component.yaml b/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/component.yaml new file mode 100644 index 0000000..01b1240 --- /dev/null +++ b/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/component.yaml @@ -0,0 +1,27 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: identity-worker + +spec: + type: cloudflare-worker + domain: platform-identity + subscribe: + environments: + - dev + - staging + - production + inputs: + installCommand: pnpm install --no-frozen-lockfile + buildCommand: pnpm exec turbo run build --filter=./ + typecheckCommand: pnpm exec turbo run typecheck --filter=./ + deployCommand: pnpm run deploy + nodeVersion: "20" + pnpmVersion: "10.12.1" + productionBranch: main + labels: + team: platform + layer: runtime + surface: identity + runtime: cloudflare \ No newline at end of file diff --git a/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/package.json b/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/package.json new file mode 100644 index 0000000..9e50779 --- /dev/null +++ b/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/package.json @@ -0,0 +1,11 @@ +{ + "name": "@example/identity-worker", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "build": "tsc -p tsconfig.json --noEmit", + "typecheck": "tsc -p tsconfig.json --noEmit", + "deploy": "wrangler deploy --config wrangler.jsonc" + } +} \ No newline at end of file diff --git a/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/src/index.ts b/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/src/index.ts new file mode 100644 index 0000000..4476079 --- /dev/null +++ b/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/src/index.ts @@ -0,0 +1,16 @@ +interface Env { + TENANT_HEADER?: string; +} + +export default { + async fetch(request: Request, env: Env): Promise { + const tenantHeader = env.TENANT_HEADER ?? "x-tenant-id"; + const tenantId = request.headers.get(tenantHeader) ?? "anonymous"; + + return Response.json({ + ok: true, + service: "identity-worker", + tenantId, + }); + }, +}; \ No newline at end of file diff --git a/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/tsconfig.json b/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/tsconfig.json new file mode 100644 index 0000000..32a6156 --- /dev/null +++ b/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "include": [ + "src/**/*.ts" + ] +} \ No newline at end of file diff --git a/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/wrangler.jsonc b/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/wrangler.jsonc new file mode 100644 index 0000000..b6085e7 --- /dev/null +++ b/compositions/cloudflare-worker/examples/identity-worker/apps/identity-worker/wrangler.jsonc @@ -0,0 +1,10 @@ +{ + "$schema": "../../node_modules/wrangler/config-schema.json", + "name": "example-platform-identity-worker", + "main": "src/index.ts", + "compatibility_date": "2026-04-25", + "workers_dev": true, + "observability": { + "enabled": true + } +} \ No newline at end of file diff --git a/compositions/cloudflare-worker/examples/identity-worker/package.json b/compositions/cloudflare-worker/examples/identity-worker/package.json new file mode 100644 index 0000000..d65acec --- /dev/null +++ b/compositions/cloudflare-worker/examples/identity-worker/package.json @@ -0,0 +1,17 @@ +{ + "name": "example-platform-repo", + "private": true, + "version": "1.0.0", + "description": "Turbo-style Cloudflare deployment examples for gluon component discovery", + "packageManager": "pnpm@10.12.1", + "scripts": { + "build": "turbo run build", + "typecheck": "turbo run typecheck", + "deploy": "turbo run deploy" + }, + "devDependencies": { + "turbo": "2.5.8", + "typescript": "5.9.3", + "wrangler": "4.13.2" + } +} \ No newline at end of file diff --git a/compositions/cloudflare-worker/examples/identity-worker/pnpm-workspace.yaml b/compositions/cloudflare-worker/examples/identity-worker/pnpm-workspace.yaml new file mode 100644 index 0000000..c7eaed9 --- /dev/null +++ b/compositions/cloudflare-worker/examples/identity-worker/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - apps/* + - packages/* \ No newline at end of file diff --git a/compositions/cloudflare-worker/examples/identity-worker/tsconfig.base.json b/compositions/cloudflare-worker/examples/identity-worker/tsconfig.base.json new file mode 100644 index 0000000..e7910f3 --- /dev/null +++ b/compositions/cloudflare-worker/examples/identity-worker/tsconfig.base.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true, + "skipLibCheck": true, + "noEmit": true, + "lib": [ + "ES2022", + "DOM" + ] + } +} \ No newline at end of file diff --git a/compositions/cloudflare-worker/examples/identity-worker/turbo.json b/compositions/cloudflare-worker/examples/identity-worker/turbo.json new file mode 100644 index 0000000..f24d8d7 --- /dev/null +++ b/compositions/cloudflare-worker/examples/identity-worker/turbo.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://turborepo.com/schema.json", + "tasks": { + "build": { + "dependsOn": [ + "^build" + ], + "outputs": [ + "dist/**", + ".wrangler/**" + ] + }, + "typecheck": { + "dependsOn": [ + "^typecheck" + ], + "outputs": [] + }, + "deploy": { + "dependsOn": [ + "build" + ], + "cache": false, + "outputs": [] + } + } +} \ No newline at end of file diff --git a/compositions/cloudflare-worker/tests/README.md b/compositions/cloudflare-worker/tests/README.md index 77c9978..30b3661 100644 --- a/compositions/cloudflare-worker/tests/README.md +++ b/compositions/cloudflare-worker/tests/README.md @@ -1,5 +1,5 @@ # Tests for cloudflare-worker -Put composition-specific smoke tests or validation fixtures for `cloudflare-worker` here. +These files provide contract or smoke fixtures that CI can inspect for `cloudflare-worker` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +- `tests/smoke` diff --git a/compositions/cloudflare-worker/tests/smoke/component.yaml b/compositions/cloudflare-worker/tests/smoke/component.yaml new file mode 100644 index 0000000..01b1240 --- /dev/null +++ b/compositions/cloudflare-worker/tests/smoke/component.yaml @@ -0,0 +1,27 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: identity-worker + +spec: + type: cloudflare-worker + domain: platform-identity + subscribe: + environments: + - dev + - staging + - production + inputs: + installCommand: pnpm install --no-frozen-lockfile + buildCommand: pnpm exec turbo run build --filter=./ + typecheckCommand: pnpm exec turbo run typecheck --filter=./ + deployCommand: pnpm run deploy + nodeVersion: "20" + pnpmVersion: "10.12.1" + productionBranch: main + labels: + team: platform + layer: runtime + surface: identity + runtime: cloudflare \ No newline at end of file diff --git a/compositions/helm-chart/README.md b/compositions/helm-chart/README.md index cf96fe5..1f06a60 100644 --- a/compositions/helm-chart/README.md +++ b/compositions/helm-chart/README.md @@ -1,6 +1,6 @@ # helm-chart -`helm-chart` is an exported Orun composition in the Sumo Platform Ops catalog. +`helm-chart` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -12,12 +12,16 @@ Helm chart validation jobs for chart components - **Path:** `compositions/helm-chart` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. -## Next steps +- `examples/identity-portal-chart` -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +## Test fixtures + +- `tests/smoke` + +## Verification + +`./scripts/verify-composition.sh helm-chart` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. diff --git a/compositions/helm-chart/examples/README.md b/compositions/helm-chart/examples/README.md index 20b416a..e8fa4fd 100644 --- a/compositions/helm-chart/examples/README.md +++ b/compositions/helm-chart/examples/README.md @@ -1,5 +1,5 @@ # Examples for helm-chart -Put consumer-facing example assets for `helm-chart` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `helm-chart` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +- `examples/identity-portal-chart` diff --git a/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/Chart.yaml b/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/Chart.yaml new file mode 100644 index 0000000..8da9933 --- /dev/null +++ b/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: identity-portal +description: Helm chart for the customer identity portal +type: application +version: 0.1.0 +appVersion: "1.0.0" \ No newline at end of file diff --git a/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/component.yaml b/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/component.yaml new file mode 100644 index 0000000..b7574e4 --- /dev/null +++ b/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/component.yaml @@ -0,0 +1,25 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: identity-portal-chart + +spec: + type: helm-chart + domain: customer-identity + subscribe: + environments: + - development + - staging + inputs: + chartPath: . + valuesFile: ../../../deploy/hello-deploy/values.yaml + releaseName: identity-portal + helmVersion: v3.15.4 + labels: + team: platform + layer: delivery + domain: identity + release: identity-portal + dependsOn: + - component: identity-portal-values \ No newline at end of file diff --git a/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/templates/configmap.yaml b/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/templates/configmap.yaml new file mode 100644 index 0000000..80fd892 --- /dev/null +++ b/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/templates/configmap.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ default .Chart.Name .Values.nameOverride }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +data: + message: {{ .Values.config.message | quote }} + environment: {{ .Values.config.environment | quote }} + color: {{ .Values.config.color | quote }} \ No newline at end of file diff --git a/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/values.yaml b/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/values.yaml new file mode 100644 index 0000000..d3272b6 --- /dev/null +++ b/compositions/helm-chart/examples/identity-portal-chart/charts/hello-chart/chart/values.yaml @@ -0,0 +1,5 @@ +nameOverride: identity-portal +config: + message: identity portal application configuration + environment: shared + color: blue \ No newline at end of file diff --git a/compositions/helm-chart/examples/identity-portal-chart/deploy/hello-deploy/values.yaml b/compositions/helm-chart/examples/identity-portal-chart/deploy/hello-deploy/values.yaml new file mode 100644 index 0000000..e71ead5 --- /dev/null +++ b/compositions/helm-chart/examples/identity-portal-chart/deploy/hello-deploy/values.yaml @@ -0,0 +1,5 @@ +nameOverride: identity-portal +config: + message: identity portal delivery values + environment: development + color: amber \ No newline at end of file diff --git a/compositions/helm-chart/tests/README.md b/compositions/helm-chart/tests/README.md index 7923997..b9d1f75 100644 --- a/compositions/helm-chart/tests/README.md +++ b/compositions/helm-chart/tests/README.md @@ -1,5 +1,5 @@ # Tests for helm-chart -Put composition-specific smoke tests or validation fixtures for `helm-chart` here. +These files provide contract or smoke fixtures that CI can inspect for `helm-chart` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +- `tests/smoke` diff --git a/compositions/helm-chart/tests/smoke/component.yaml b/compositions/helm-chart/tests/smoke/component.yaml new file mode 100644 index 0000000..b7574e4 --- /dev/null +++ b/compositions/helm-chart/tests/smoke/component.yaml @@ -0,0 +1,25 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: identity-portal-chart + +spec: + type: helm-chart + domain: customer-identity + subscribe: + environments: + - development + - staging + inputs: + chartPath: . + valuesFile: ../../../deploy/hello-deploy/values.yaml + releaseName: identity-portal + helmVersion: v3.15.4 + labels: + team: platform + layer: delivery + domain: identity + release: identity-portal + dependsOn: + - component: identity-portal-values \ No newline at end of file diff --git a/compositions/helm-values/README.md b/compositions/helm-values/README.md index 9d01276..3ac29fa 100644 --- a/compositions/helm-values/README.md +++ b/compositions/helm-values/README.md @@ -1,6 +1,6 @@ # helm-values -`helm-values` is an exported Orun composition in the Sumo Platform Ops catalog. +`helm-values` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -12,12 +12,16 @@ Helm values validation jobs for deployment files - **Path:** `compositions/helm-values` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. -## Next steps +- `examples/identity-portal-values` -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +## Test fixtures + +- `tests/smoke` + +## Verification + +`./scripts/verify-composition.sh helm-values` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. diff --git a/compositions/helm-values/examples/README.md b/compositions/helm-values/examples/README.md index 3fc29f9..7788840 100644 --- a/compositions/helm-values/examples/README.md +++ b/compositions/helm-values/examples/README.md @@ -1,5 +1,5 @@ # Examples for helm-values -Put consumer-facing example assets for `helm-values` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `helm-values` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +- `examples/identity-portal-values` diff --git a/compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/Chart.yaml b/compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/Chart.yaml new file mode 100644 index 0000000..8da9933 --- /dev/null +++ b/compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: identity-portal +description: Helm chart for the customer identity portal +type: application +version: 0.1.0 +appVersion: "1.0.0" \ No newline at end of file diff --git a/compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/templates/configmap.yaml b/compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/templates/configmap.yaml new file mode 100644 index 0000000..80fd892 --- /dev/null +++ b/compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/templates/configmap.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ default .Chart.Name .Values.nameOverride }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +data: + message: {{ .Values.config.message | quote }} + environment: {{ .Values.config.environment | quote }} + color: {{ .Values.config.color | quote }} \ No newline at end of file diff --git a/compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/values.yaml b/compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/values.yaml new file mode 100644 index 0000000..d3272b6 --- /dev/null +++ b/compositions/helm-values/examples/identity-portal-values/charts/hello-chart/chart/values.yaml @@ -0,0 +1,5 @@ +nameOverride: identity-portal +config: + message: identity portal application configuration + environment: shared + color: blue \ No newline at end of file diff --git a/compositions/helm-values/examples/identity-portal-values/deploy/hello-deploy/component.yaml b/compositions/helm-values/examples/identity-portal-values/deploy/hello-deploy/component.yaml new file mode 100644 index 0000000..cddc642 --- /dev/null +++ b/compositions/helm-values/examples/identity-portal-values/deploy/hello-deploy/component.yaml @@ -0,0 +1,25 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: identity-portal-values + +spec: + type: helm-values + domain: customer-identity + subscribe: + environments: + - development + - staging + inputs: + chartPath: ../../charts/hello-chart/chart + valuesFile: values.yaml + releaseName: identity-portal + helmVersion: v3.15.4 + labels: + team: platform + layer: delivery + domain: identity + release: identity-portal + dependsOn: + - component: network-foundation \ No newline at end of file diff --git a/compositions/helm-values/examples/identity-portal-values/deploy/hello-deploy/values.yaml b/compositions/helm-values/examples/identity-portal-values/deploy/hello-deploy/values.yaml new file mode 100644 index 0000000..e71ead5 --- /dev/null +++ b/compositions/helm-values/examples/identity-portal-values/deploy/hello-deploy/values.yaml @@ -0,0 +1,5 @@ +nameOverride: identity-portal +config: + message: identity portal delivery values + environment: development + color: amber \ No newline at end of file diff --git a/compositions/helm-values/tests/README.md b/compositions/helm-values/tests/README.md index 1e8ab54..ce3056b 100644 --- a/compositions/helm-values/tests/README.md +++ b/compositions/helm-values/tests/README.md @@ -1,5 +1,5 @@ # Tests for helm-values -Put composition-specific smoke tests or validation fixtures for `helm-values` here. +These files provide contract or smoke fixtures that CI can inspect for `helm-values` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +- `tests/smoke` diff --git a/compositions/helm-values/tests/smoke/component.yaml b/compositions/helm-values/tests/smoke/component.yaml new file mode 100644 index 0000000..cddc642 --- /dev/null +++ b/compositions/helm-values/tests/smoke/component.yaml @@ -0,0 +1,25 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: identity-portal-values + +spec: + type: helm-values + domain: customer-identity + subscribe: + environments: + - development + - staging + inputs: + chartPath: ../../charts/hello-chart/chart + valuesFile: values.yaml + releaseName: identity-portal + helmVersion: v3.15.4 + labels: + team: platform + layer: delivery + domain: identity + release: identity-portal + dependsOn: + - component: network-foundation \ No newline at end of file diff --git a/compositions/terraform/README.md b/compositions/terraform/README.md index c26791b..4a77832 100644 --- a/compositions/terraform/README.md +++ b/compositions/terraform/README.md @@ -1,6 +1,6 @@ # terraform -`terraform` is an exported Orun composition in the Sumo Platform Ops catalog. +`terraform` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -12,12 +12,16 @@ Terraform validation jobs for infra components - **Path:** `compositions/terraform` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. -## Next steps +- `examples/network-foundation` -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +## Test fixtures + +- `tests/smoke` + +## Verification + +`./scripts/verify-composition.sh terraform` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. diff --git a/compositions/terraform/examples/README.md b/compositions/terraform/examples/README.md index ce8d586..8950b7e 100644 --- a/compositions/terraform/examples/README.md +++ b/compositions/terraform/examples/README.md @@ -1,5 +1,5 @@ # Examples for terraform -Put consumer-facing example assets for `terraform` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `terraform` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +- `examples/network-foundation` diff --git a/compositions/terraform/examples/network-foundation/infra/infra-1/component.yaml b/compositions/terraform/examples/network-foundation/infra/infra-1/component.yaml new file mode 100644 index 0000000..d63d128 --- /dev/null +++ b/compositions/terraform/examples/network-foundation/infra/infra-1/component.yaml @@ -0,0 +1,22 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: network-foundation + +spec: + type: terraform + domain: platform-foundation + subscribe: + environments: + - development + - staging + - production + inputs: + stackName: network-foundation + terraformDir: . + terraformVersion: 1.9.8 + labels: + team: platform + layer: foundation + stack: network \ No newline at end of file diff --git a/compositions/terraform/examples/network-foundation/infra/infra-1/main.tf b/compositions/terraform/examples/network-foundation/infra/infra-1/main.tf new file mode 100644 index 0000000..dcc30c2 --- /dev/null +++ b/compositions/terraform/examples/network-foundation/infra/infra-1/main.tf @@ -0,0 +1,21 @@ +terraform { + required_version = ">= 1.6.0" +} + +locals { + stack_name = "network-foundation" + owner = "platform" + environment = "shared" +} + +output "stack_name" { + value = local.stack_name +} + +output "owner" { + value = local.owner +} + +output "environment" { + value = local.environment +} \ No newline at end of file diff --git a/compositions/terraform/tests/README.md b/compositions/terraform/tests/README.md index 77abfdf..89a8abe 100644 --- a/compositions/terraform/tests/README.md +++ b/compositions/terraform/tests/README.md @@ -1,5 +1,5 @@ # Tests for terraform -Put composition-specific smoke tests or validation fixtures for `terraform` here. +These files provide contract or smoke fixtures that CI can inspect for `terraform` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +- `tests/smoke` diff --git a/compositions/terraform/tests/smoke/component.yaml b/compositions/terraform/tests/smoke/component.yaml new file mode 100644 index 0000000..d63d128 --- /dev/null +++ b/compositions/terraform/tests/smoke/component.yaml @@ -0,0 +1,22 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: network-foundation + +spec: + type: terraform + domain: platform-foundation + subscribe: + environments: + - development + - staging + - production + inputs: + stackName: network-foundation + terraformDir: . + terraformVersion: 1.9.8 + labels: + team: platform + layer: foundation + stack: network \ No newline at end of file diff --git a/compositions/turbo-package/README.md b/compositions/turbo-package/README.md index dcd8a25..9f7a252 100644 --- a/compositions/turbo-package/README.md +++ b/compositions/turbo-package/README.md @@ -1,6 +1,6 @@ # turbo-package -`turbo-package` is an exported Orun composition in the Sumo Platform Ops catalog. +`turbo-package` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -12,12 +12,16 @@ Verify a shared package in a pnpm and Turbo monorepo - **Path:** `compositions/turbo-package` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. -## Next steps +- `examples/platform-sdk` -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +## Test fixtures + +- `tests/smoke` + +## Verification + +`./scripts/verify-composition.sh turbo-package` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. diff --git a/compositions/turbo-package/examples/README.md b/compositions/turbo-package/examples/README.md index 606136a..cdd50f1 100644 --- a/compositions/turbo-package/examples/README.md +++ b/compositions/turbo-package/examples/README.md @@ -1,5 +1,5 @@ # Examples for turbo-package -Put consumer-facing example assets for `turbo-package` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `turbo-package` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +- `examples/platform-sdk` diff --git a/compositions/turbo-package/examples/platform-sdk/package.json b/compositions/turbo-package/examples/platform-sdk/package.json new file mode 100644 index 0000000..d65acec --- /dev/null +++ b/compositions/turbo-package/examples/platform-sdk/package.json @@ -0,0 +1,17 @@ +{ + "name": "example-platform-repo", + "private": true, + "version": "1.0.0", + "description": "Turbo-style Cloudflare deployment examples for gluon component discovery", + "packageManager": "pnpm@10.12.1", + "scripts": { + "build": "turbo run build", + "typecheck": "turbo run typecheck", + "deploy": "turbo run deploy" + }, + "devDependencies": { + "turbo": "2.5.8", + "typescript": "5.9.3", + "wrangler": "4.13.2" + } +} \ No newline at end of file diff --git a/compositions/turbo-package/examples/platform-sdk/packages/sdk/component.yaml b/compositions/turbo-package/examples/platform-sdk/packages/sdk/component.yaml new file mode 100644 index 0000000..a2bcd94 --- /dev/null +++ b/compositions/turbo-package/examples/platform-sdk/packages/sdk/component.yaml @@ -0,0 +1,23 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: platform-sdk + +spec: + type: turbo-package + domain: platform-packages + subscribe: + environments: + - dev + - development + - staging + - production + inputs: + nodeVersion: "20" + pnpmVersion: "10.12.1" + labels: + team: platform + layer: shared + surface: sdk + runtime: node \ No newline at end of file diff --git a/compositions/turbo-package/examples/platform-sdk/packages/sdk/package.json b/compositions/turbo-package/examples/platform-sdk/packages/sdk/package.json new file mode 100644 index 0000000..3951719 --- /dev/null +++ b/compositions/turbo-package/examples/platform-sdk/packages/sdk/package.json @@ -0,0 +1,10 @@ +{ + "name": "@example/sdk", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "build": "tsc -p tsconfig.json --noEmit", + "typecheck": "tsc -p tsconfig.json --noEmit" + } +} \ No newline at end of file diff --git a/compositions/turbo-package/examples/platform-sdk/packages/sdk/src/index.ts b/compositions/turbo-package/examples/platform-sdk/packages/sdk/src/index.ts new file mode 100644 index 0000000..e3959e4 --- /dev/null +++ b/compositions/turbo-package/examples/platform-sdk/packages/sdk/src/index.ts @@ -0,0 +1,3 @@ +export function createPlatformClient(baseUrl: string): string { + return new URL("/v1", baseUrl).toString(); +} \ No newline at end of file diff --git a/compositions/turbo-package/examples/platform-sdk/packages/sdk/tsconfig.json b/compositions/turbo-package/examples/platform-sdk/packages/sdk/tsconfig.json new file mode 100644 index 0000000..32a6156 --- /dev/null +++ b/compositions/turbo-package/examples/platform-sdk/packages/sdk/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "include": [ + "src/**/*.ts" + ] +} \ No newline at end of file diff --git a/compositions/turbo-package/examples/platform-sdk/pnpm-workspace.yaml b/compositions/turbo-package/examples/platform-sdk/pnpm-workspace.yaml new file mode 100644 index 0000000..c7eaed9 --- /dev/null +++ b/compositions/turbo-package/examples/platform-sdk/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - apps/* + - packages/* \ No newline at end of file diff --git a/compositions/turbo-package/examples/platform-sdk/tsconfig.base.json b/compositions/turbo-package/examples/platform-sdk/tsconfig.base.json new file mode 100644 index 0000000..e7910f3 --- /dev/null +++ b/compositions/turbo-package/examples/platform-sdk/tsconfig.base.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true, + "skipLibCheck": true, + "noEmit": true, + "lib": [ + "ES2022", + "DOM" + ] + } +} \ No newline at end of file diff --git a/compositions/turbo-package/examples/platform-sdk/turbo.json b/compositions/turbo-package/examples/platform-sdk/turbo.json new file mode 100644 index 0000000..f24d8d7 --- /dev/null +++ b/compositions/turbo-package/examples/platform-sdk/turbo.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://turborepo.com/schema.json", + "tasks": { + "build": { + "dependsOn": [ + "^build" + ], + "outputs": [ + "dist/**", + ".wrangler/**" + ] + }, + "typecheck": { + "dependsOn": [ + "^typecheck" + ], + "outputs": [] + }, + "deploy": { + "dependsOn": [ + "build" + ], + "cache": false, + "outputs": [] + } + } +} \ No newline at end of file diff --git a/compositions/turbo-package/tests/README.md b/compositions/turbo-package/tests/README.md index 3d99e1d..7d0c3db 100644 --- a/compositions/turbo-package/tests/README.md +++ b/compositions/turbo-package/tests/README.md @@ -1,5 +1,5 @@ # Tests for turbo-package -Put composition-specific smoke tests or validation fixtures for `turbo-package` here. +These files provide contract or smoke fixtures that CI can inspect for `turbo-package` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +- `tests/smoke` diff --git a/compositions/turbo-package/tests/smoke/component.yaml b/compositions/turbo-package/tests/smoke/component.yaml new file mode 100644 index 0000000..a2bcd94 --- /dev/null +++ b/compositions/turbo-package/tests/smoke/component.yaml @@ -0,0 +1,23 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: platform-sdk + +spec: + type: turbo-package + domain: platform-packages + subscribe: + environments: + - dev + - development + - staging + - production + inputs: + nodeVersion: "20" + pnpmVersion: "10.12.1" + labels: + team: platform + layer: shared + surface: sdk + runtime: node \ No newline at end of file diff --git a/compositions/workspace/README.md b/compositions/workspace/README.md index fb52f7c..56f9732 100644 --- a/compositions/workspace/README.md +++ b/compositions/workspace/README.md @@ -1,6 +1,6 @@ # workspace -`workspace` is an exported Orun composition in the Sumo Platform Ops catalog. +`workspace` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -12,12 +12,16 @@ Workspace-backed provider smoke jobs - **Path:** `compositions/workspace` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. -## Next steps +- `examples/provider-smoke` -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +## Test fixtures + +- `tests/smoke` + +## Verification + +`./scripts/verify-composition.sh workspace` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. diff --git a/compositions/workspace/compositions.yaml b/compositions/workspace/compositions.yaml index 9bde020..036827c 100644 --- a/compositions/workspace/compositions.yaml +++ b/compositions/workspace/compositions.yaml @@ -77,8 +77,8 @@ spec: run: torkflow view --workflow {{.workflowFile}} onFailure: stop inputs: - chartPath: services/hello-app - valuesFile: services/hello-app/values.yaml - kustomizeDir: website/smoke/kustomize - terraformDir: website/smoke/terraform - workflowFile: website/smoke/provider-smoke.yaml + chartPath: charts/hello-chart/chart + valuesFile: deploy/hello-deploy/values.yaml + kustomizeDir: smoke/kustomize + terraformDir: smoke/terraform + workflowFile: smoke/provider-smoke.yaml diff --git a/compositions/workspace/examples/README.md b/compositions/workspace/examples/README.md index 74023c0..ad03279 100644 --- a/compositions/workspace/examples/README.md +++ b/compositions/workspace/examples/README.md @@ -1,5 +1,5 @@ # Examples for workspace -Put consumer-facing example assets for `workspace` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `workspace` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +- `examples/provider-smoke` diff --git a/compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/Chart.yaml b/compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/Chart.yaml new file mode 100644 index 0000000..8da9933 --- /dev/null +++ b/compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: identity-portal +description: Helm chart for the customer identity portal +type: application +version: 0.1.0 +appVersion: "1.0.0" \ No newline at end of file diff --git a/compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/templates/configmap.yaml b/compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/templates/configmap.yaml new file mode 100644 index 0000000..80fd892 --- /dev/null +++ b/compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/templates/configmap.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ default .Chart.Name .Values.nameOverride }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +data: + message: {{ .Values.config.message | quote }} + environment: {{ .Values.config.environment | quote }} + color: {{ .Values.config.color | quote }} \ No newline at end of file diff --git a/compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/values.yaml b/compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/values.yaml new file mode 100644 index 0000000..d3272b6 --- /dev/null +++ b/compositions/workspace/examples/provider-smoke/charts/hello-chart/chart/values.yaml @@ -0,0 +1,5 @@ +nameOverride: identity-portal +config: + message: identity portal application configuration + environment: shared + color: blue \ No newline at end of file diff --git a/compositions/workspace/examples/provider-smoke/component.yaml b/compositions/workspace/examples/provider-smoke/component.yaml new file mode 100644 index 0000000..453169f --- /dev/null +++ b/compositions/workspace/examples/provider-smoke/component.yaml @@ -0,0 +1,23 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: provider-smoke + +spec: + type: workspace + domain: platform-foundation + subscribe: + environments: + - development + - staging + inputs: + chartPath: charts/hello-chart/chart + valuesFile: deploy/hello-deploy/values.yaml + kustomizeDir: smoke/kustomize + terraformDir: smoke/terraform + workflowFile: smoke/provider-smoke.yaml + labels: + team: platform + layer: foundation + surface: provider-smoke diff --git a/compositions/workspace/examples/provider-smoke/deploy/hello-deploy/values.yaml b/compositions/workspace/examples/provider-smoke/deploy/hello-deploy/values.yaml new file mode 100644 index 0000000..e71ead5 --- /dev/null +++ b/compositions/workspace/examples/provider-smoke/deploy/hello-deploy/values.yaml @@ -0,0 +1,5 @@ +nameOverride: identity-portal +config: + message: identity portal delivery values + environment: development + color: amber \ No newline at end of file diff --git a/compositions/workspace/examples/provider-smoke/smoke/kustomize/configmap.yaml b/compositions/workspace/examples/provider-smoke/smoke/kustomize/configmap.yaml new file mode 100644 index 0000000..e7328d3 --- /dev/null +++ b/compositions/workspace/examples/provider-smoke/smoke/kustomize/configmap.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: workspace-provider-smoke +data: + source: kustomize \ No newline at end of file diff --git a/compositions/workspace/examples/provider-smoke/smoke/kustomize/kustomization.yaml b/compositions/workspace/examples/provider-smoke/smoke/kustomize/kustomization.yaml new file mode 100644 index 0000000..490c6c9 --- /dev/null +++ b/compositions/workspace/examples/provider-smoke/smoke/kustomize/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - configmap.yaml \ No newline at end of file diff --git a/compositions/workspace/examples/provider-smoke/smoke/provider-smoke.yaml b/compositions/workspace/examples/provider-smoke/smoke/provider-smoke.yaml new file mode 100644 index 0000000..b52ad9b --- /dev/null +++ b/compositions/workspace/examples/provider-smoke/smoke/provider-smoke.yaml @@ -0,0 +1,22 @@ +apiVersion: torkflow/v1 +kind: Workflow +metadata: + name: provider-smoke + id: provider-smoke +spec: + maxParallelSteps: 1 + steps: + - name: Summarize_Intent + actionRef: core.js + parameters: + script: "({ message: 'provider-native dry-run flow' })" + outboundEdges: + - nextStepName: Print_Result + + - name: Print_Result + actionRef: core.stdout + parameters: + title: Provider Smoke + format: text + payload: + message: "{{ Steps.Summarize_Intent.message }}" \ No newline at end of file diff --git a/compositions/workspace/examples/provider-smoke/smoke/terraform/main.tf b/compositions/workspace/examples/provider-smoke/smoke/terraform/main.tf new file mode 100644 index 0000000..cee63b0 --- /dev/null +++ b/compositions/workspace/examples/provider-smoke/smoke/terraform/main.tf @@ -0,0 +1,7 @@ +terraform { + required_version = ">= 1.6.0" +} + +locals { + smoke_message = "workspace-provider-smoke" +} \ No newline at end of file diff --git a/compositions/workspace/tests/README.md b/compositions/workspace/tests/README.md index 2d79e13..eade93c 100644 --- a/compositions/workspace/tests/README.md +++ b/compositions/workspace/tests/README.md @@ -1,5 +1,5 @@ # Tests for workspace -Put composition-specific smoke tests or validation fixtures for `workspace` here. +These files provide contract or smoke fixtures that CI can inspect for `workspace` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +- `tests/smoke` diff --git a/compositions/workspace/tests/smoke/component.yaml b/compositions/workspace/tests/smoke/component.yaml new file mode 100644 index 0000000..dd2e53f --- /dev/null +++ b/compositions/workspace/tests/smoke/component.yaml @@ -0,0 +1,18 @@ +apiVersion: sourceplane.io/v1 +kind: Component + +metadata: + name: provider-smoke + +spec: + type: workspace + domain: platform-foundation + subscribe: + environments: + - development + inputs: + chartPath: charts/hello-chart/chart + valuesFile: deploy/hello-deploy/values.yaml + kustomizeDir: smoke/kustomize + terraformDir: smoke/terraform + workflowFile: smoke/provider-smoke.yaml diff --git a/docs/authoring.md b/docs/authoring.md index a151908..306f553 100644 --- a/docs/authoring.md +++ b/docs/authoring.md @@ -4,8 +4,9 @@ 1. Create `compositions//compositions.yaml`. 2. Describe the contract in `spec.description`, `spec.inputSchema`, and `spec.jobs`. -3. Run `./scripts/generate-readme.sh` to scaffold the local README, examples, and tests placeholders. -4. Run `./scripts/score.sh` and `./scripts/verify.sh`. +3. Add at least one realistic fixture under `examples/` and one smoke or contract fixture under `tests/`, preferably excerpted or adapted from a consumer-style repo. +4. Run `./scripts/generate-readme.sh` to refresh the generated composition README summaries. +5. Run `./scripts/score.sh` and `./scripts/verify.sh`. ## Add a blueprint @@ -17,5 +18,5 @@ - Prefer atomic compositions over variant explosions. - Use blueprints for recommended assemblies. -- Add runnable example assets to improve the generated maturity score. +- Keep example and test fixtures close enough to real repositories that they can guide consumers and feed CI trust signals. - Keep the OCI consumption story pinned to released versions, not floating refs. diff --git a/docs/getting-started.md b/docs/getting-started.md index 21b8c4b..6285d66 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -1,6 +1,6 @@ # Getting started -`sumo-platform-ops-stack` is a versioned Orun stack catalog. Consumer repositories pin it as an OCI composition source, then declare local `component.yaml` manifests that use the exported composition types. +`stack-tectonic` is a versioned Orun stack catalog. Consumer repositories pin it as an OCI composition source, then declare local `component.yaml` manifests that use the exported composition types. ## 1. Pin the runtime @@ -13,9 +13,9 @@ Declare this stack in `intent.yaml`: ```yaml compositions: sources: - - name: sumo-platform-ops + - name: stack-tectonic kind: oci - ref: oci://ghcr.io/sourceplane/sumo-platform-ops-stack:0.10.0 + ref: oci://ghcr.io/sourceplane/stack-tectonic:0.11.0 ``` ## 3. Discover local components diff --git a/docs/using-this-stack-from-oci.md b/docs/using-this-stack-from-oci.md index 93fcee8..2b9c128 100644 --- a/docs/using-this-stack-from-oci.md +++ b/docs/using-this-stack-from-oci.md @@ -45,9 +45,9 @@ metadata: compositions: sources: - - name: sumo-platform-ops + - name: stack-tectonic kind: oci - ref: oci://ghcr.io/sourceplane/sumo-platform-ops-stack:0.10.0 + ref: oci://ghcr.io/sourceplane/stack-tectonic:0.11.0 discovery: roots: @@ -63,7 +63,7 @@ environments: The important line is the OCI source: ```yaml -ref: oci://ghcr.io/sourceplane/sumo-platform-ops-stack:0.10.0 +ref: oci://ghcr.io/sourceplane/stack-tectonic:0.11.0 ``` Pin a released version instead of `latest` so plans stay reproducible. diff --git a/docs/verification.md b/docs/verification.md index 4adcbe2..ab54ecc 100644 --- a/docs/verification.md +++ b/docs/verification.md @@ -4,10 +4,16 @@ The repository uses a split verification model so the stack can scale as a catal ## Verify workflow -`verify.yml` runs `./scripts/verify.sh`, which: +`verify.yml` splits verification into two lanes: + +- a composition matrix that runs `./scripts/verify-composition.sh ` for every exported type +- a full catalog lane that runs `./scripts/verify.sh` + +The full catalog lane: - checks generated composition docs are up to date - checks the generated registry index is current +- checks every composition has example and test fixtures beyond placeholder READMEs - runs the same OCI dry-run publish path used by release automation ## Docs workflow @@ -20,7 +26,7 @@ The repository uses a split verification model so the stack can scale as a catal ## Release workflow -`release.yml` validates the tag against `stack.yaml`, regenerates the scorecard, publishes the OCI package, and attaches the registry index to the GitHub release. +`release.yml` validates the tag against `stack.yaml`, reruns the full catalog verification, publishes the OCI package, and attaches the registry index to the GitHub release. ## Score model diff --git a/examples/full-enterprise/intent.yaml b/examples/full-enterprise/intent.yaml index 9f81567..e58cdeb 100644 --- a/examples/full-enterprise/intent.yaml +++ b/examples/full-enterprise/intent.yaml @@ -5,9 +5,9 @@ metadata: compositions: sources: - - name: sumo-platform-ops + - name: stack-tectonic kind: oci - ref: oci://ghcr.io/sourceplane/sumo-platform-ops-stack:0.10.0 + ref: oci://ghcr.io/sourceplane/stack-tectonic:0.11.0 discovery: roots: diff --git a/examples/monorepo-platform/intent.yaml b/examples/monorepo-platform/intent.yaml index d1a05d0..559a047 100644 --- a/examples/monorepo-platform/intent.yaml +++ b/examples/monorepo-platform/intent.yaml @@ -5,9 +5,9 @@ metadata: compositions: sources: - - name: sumo-platform-ops + - name: stack-tectonic kind: oci - ref: oci://ghcr.io/sourceplane/sumo-platform-ops-stack:0.10.0 + ref: oci://ghcr.io/sourceplane/stack-tectonic:0.11.0 discovery: roots: diff --git a/examples/simple-nextjs/intent.yaml b/examples/simple-nextjs/intent.yaml index dc45a73..90328a7 100644 --- a/examples/simple-nextjs/intent.yaml +++ b/examples/simple-nextjs/intent.yaml @@ -5,9 +5,9 @@ metadata: compositions: sources: - - name: sumo-platform-ops + - name: stack-tectonic kind: oci - ref: oci://ghcr.io/sourceplane/sumo-platform-ops-stack:0.10.0 + ref: oci://ghcr.io/sourceplane/stack-tectonic:0.11.0 discovery: roots: diff --git a/kiox.lock b/kiox.lock index a126d7c..86d7626 100644 --- a/kiox.lock +++ b/kiox.lock @@ -1,7 +1,7 @@ apiVersion: kiox.io/v1 kind: WorkspaceLock metadata: - name: sumo-platform-ops-stack + name: stack-tectonic providers: - alias: orun provider: sourceplane/orun diff --git a/kiox.yaml b/kiox.yaml index 6da5824..1493c1a 100644 --- a/kiox.yaml +++ b/kiox.yaml @@ -1,7 +1,7 @@ apiVersion: kiox.io/v1 kind: Workspace metadata: - name: sumo-platform-ops-stack + name: stack-tectonic providers: orun: source: ghcr.io/sourceplane/orun:v0.9.6 diff --git a/registry/index.json b/registry/index.json index 1f782bf..b7ba696 100644 --- a/registry/index.json +++ b/registry/index.json @@ -1,9 +1,9 @@ { "stack": { - "name": "sumo-platform-ops-stack", - "title": "Sumo Platform Ops Stack", - "version": "0.10.0", - "oci": "oci://ghcr.io/sourceplane/sumo-platform-ops-stack:0.10.0" + "name": "stack-tectonic", + "title": "Stack Tectonic", + "version": "0.11.0", + "oci": "oci://ghcr.io/sourceplane/stack-tectonic:0.11.0" }, "catalog": { "compositions": [ @@ -13,9 +13,9 @@ "path": "compositions/cloudflare-pages", "description": "Build static site assets and direct-upload them to Cloudflare Pages with Wrangler", "category": "hosting", - "verified": false, - "score": 60, - "grade": "C", + "verified": true, + "score": 100, + "grade": "A+", "tags": [ "cloudflare", "hosting", @@ -23,8 +23,8 @@ ], "signals": { "readme": true, - "exampleAssets": 0, - "testAssets": 0, + "exampleAssets": 6, + "testAssets": 1, "verifyWorkflow": true, "releaseWorkflow": true, "scorecardWorkflow": true, @@ -38,9 +38,9 @@ "path": "compositions/cloudflare-pages-terraform", "description": "Verify static site builds locally and reconcile a Git-backed Cloudflare Pages project with Terraform", "category": "platform", - "verified": false, - "score": 60, - "grade": "C", + "verified": true, + "score": 100, + "grade": "A+", "tags": [ "cloudflare", "pages", @@ -49,8 +49,8 @@ ], "signals": { "readme": true, - "exampleAssets": 0, - "testAssets": 0, + "exampleAssets": 7, + "testAssets": 1, "verifyWorkflow": true, "releaseWorkflow": true, "scorecardWorkflow": true, @@ -64,9 +64,9 @@ "path": "compositions/cloudflare-pages-turbo", "description": "Build a static app with Turbo and direct-upload it to Cloudflare Pages", "category": "hosting", - "verified": false, - "score": 60, - "grade": "C", + "verified": true, + "score": 100, + "grade": "A+", "tags": [ "cloudflare", "hosting", @@ -75,8 +75,8 @@ ], "signals": { "readme": true, - "exampleAssets": 0, - "testAssets": 0, + "exampleAssets": 8, + "testAssets": 1, "verifyWorkflow": true, "releaseWorkflow": true, "scorecardWorkflow": true, @@ -90,9 +90,9 @@ "path": "compositions/cloudflare-pages-turbo-terraform", "description": "Verify a static app with Turbo locally and reconcile a Git-backed Cloudflare Pages project with Terraform", "category": "platform", - "verified": false, - "score": 60, - "grade": "C", + "verified": true, + "score": 100, + "grade": "A+", "tags": [ "cloudflare", "pages", @@ -102,8 +102,8 @@ ], "signals": { "readme": true, - "exampleAssets": 0, - "testAssets": 0, + "exampleAssets": 9, + "testAssets": 1, "verifyWorkflow": true, "releaseWorkflow": true, "scorecardWorkflow": true, @@ -117,9 +117,9 @@ "path": "compositions/cloudflare-worker", "description": "Verify a Cloudflare Worker app and deploy it from the production branch", "category": "edge", - "verified": false, - "score": 60, - "grade": "C", + "verified": true, + "score": 100, + "grade": "A+", "tags": [ "cloudflare", "edge", @@ -127,8 +127,8 @@ ], "signals": { "readme": true, - "exampleAssets": 0, - "testAssets": 0, + "exampleAssets": 9, + "testAssets": 1, "verifyWorkflow": true, "releaseWorkflow": true, "scorecardWorkflow": true, @@ -142,9 +142,9 @@ "path": "compositions/cloudflare-worker-turbo", "description": "Verify a Cloudflare Worker app and deploy it from the production branch", "category": "edge", - "verified": false, - "score": 60, - "grade": "C", + "verified": true, + "score": 100, + "grade": "A+", "tags": [ "cloudflare", "edge", @@ -153,8 +153,8 @@ ], "signals": { "readme": true, - "exampleAssets": 0, - "testAssets": 0, + "exampleAssets": 9, + "testAssets": 1, "verifyWorkflow": true, "releaseWorkflow": true, "scorecardWorkflow": true, @@ -168,9 +168,9 @@ "path": "compositions/helm-chart", "description": "Helm chart validation jobs for chart components", "category": "kubernetes", - "verified": false, - "score": 60, - "grade": "C", + "verified": true, + "score": 100, + "grade": "A+", "tags": [ "chart", "helm", @@ -178,8 +178,8 @@ ], "signals": { "readme": true, - "exampleAssets": 0, - "testAssets": 0, + "exampleAssets": 5, + "testAssets": 1, "verifyWorkflow": true, "releaseWorkflow": true, "scorecardWorkflow": true, @@ -193,9 +193,9 @@ "path": "compositions/helm-values", "description": "Helm values validation jobs for deployment files", "category": "kubernetes", - "verified": false, - "score": 60, - "grade": "C", + "verified": true, + "score": 100, + "grade": "A+", "tags": [ "helm", "kubernetes", @@ -203,8 +203,8 @@ ], "signals": { "readme": true, - "exampleAssets": 0, - "testAssets": 0, + "exampleAssets": 5, + "testAssets": 1, "verifyWorkflow": true, "releaseWorkflow": true, "scorecardWorkflow": true, @@ -218,17 +218,17 @@ "path": "compositions/terraform", "description": "Terraform validation jobs for infra components", "category": "infrastructure", - "verified": false, - "score": 60, - "grade": "C", + "verified": true, + "score": 100, + "grade": "A+", "tags": [ "infrastructure", "terraform" ], "signals": { "readme": true, - "exampleAssets": 0, - "testAssets": 0, + "exampleAssets": 2, + "testAssets": 1, "verifyWorkflow": true, "releaseWorkflow": true, "scorecardWorkflow": true, @@ -242,9 +242,9 @@ "path": "compositions/turbo-package", "description": "Verify a shared package in a pnpm and Turbo monorepo", "category": "developer-experience", - "verified": false, - "score": 60, - "grade": "C", + "verified": true, + "score": 100, + "grade": "A+", "tags": [ "developer-experience", "package", @@ -252,8 +252,8 @@ ], "signals": { "readme": true, - "exampleAssets": 0, - "testAssets": 0, + "exampleAssets": 8, + "testAssets": 1, "verifyWorkflow": true, "releaseWorkflow": true, "scorecardWorkflow": true, @@ -267,17 +267,17 @@ "path": "compositions/workspace", "description": "Workspace-backed provider smoke jobs", "category": "developer-experience", - "verified": false, - "score": 60, - "grade": "C", + "verified": true, + "score": 100, + "grade": "A+", "tags": [ "developer-experience", "workspace" ], "signals": { "readme": true, - "exampleAssets": 0, - "testAssets": 0, + "exampleAssets": 9, + "testAssets": 1, "verifyWorkflow": true, "releaseWorkflow": true, "scorecardWorkflow": true, diff --git a/scripts/generate-readme.sh b/scripts/generate-readme.sh index 3a6f27d..aa4d9cd 100755 --- a/scripts/generate-readme.sh +++ b/scripts/generate-readme.sh @@ -32,15 +32,37 @@ def write_or_check(path: Path, content: str) -> None: path.write_text(normalized) +def top_level_assets(directory: Path) -> list[str]: + if not directory.exists(): + return [] + items: set[str] = set() + for path in directory.rglob("*"): + if not path.is_file() or path.name.lower() == "readme.md": + continue + rel = path.relative_to(directory) + items.add(rel.parts[0]) + return sorted(items) + + +def render_asset_list(directory_name: str, items: list[str], empty_message: str) -> str: + if not items: + return f"- {empty_message}" + return "\n".join(f"- `{directory_name}/{item}`" for item in items) + + for contract in sorted((root / "compositions").glob("*/compositions.yaml")): text = contract.read_text() name = extract(r"^ name:\s*(.+)$", text) description = extract(r"^ description:\s*(.+)$", text) comp_dir = contract.parent + example_items = top_level_assets(comp_dir / "examples") + test_items = top_level_assets(comp_dir / "tests") + example_list = render_asset_list("examples", example_items, "Add a sample fixture under examples/.") + test_list = render_asset_list("tests", test_items, "Add a smoke or contract fixture under tests/.") readme = f"""# {name} -`{name}` is an exported Orun composition in the Sumo Platform Ops catalog. +`{name}` is an exported Orun composition in the Stack Tectonic catalog. ## Purpose @@ -52,29 +74,33 @@ for contract in sorted((root / "compositions").glob("*/compositions.yaml")): - **Path:** `{comp_dir.relative_to(root)}` - **Definition:** `compositions.yaml` -## Catalog status +## Example fixtures + +These sample assets are excerpted or adapted from `example-platform-repo` so the contract is documented with realistic consumer-repo shapes. + +{example_list} + +## Test fixtures -This folder is intentionally self-contained so examples, smoke coverage, and future registry metadata can live beside the composition contract. +{test_list} -## Next steps +## Verification -- add runnable example assets under `examples/` -- add composition-specific smoke coverage under `tests/` -- keep the contract description in `compositions.yaml` aligned with the repo scorecard +`./scripts/verify-composition.sh {name}` checks that this composition keeps its contract, fixture, and generated-doc scaffolding intact. """ examples_readme = f"""# Examples for {name} -Put consumer-facing example assets for `{name}` here. +These fixtures are excerpted or adapted from `example-platform-repo` to show how `{name}` looks inside a consumer repository. -The scorecard only counts example assets beyond this placeholder README. +{example_list} """ tests_readme = f"""# Tests for {name} -Put composition-specific smoke tests or validation fixtures for `{name}` here. +These files provide contract or smoke fixtures that CI can inspect for `{name}` without requiring a full consumer repository checkout. -The scorecard only counts test assets beyond this placeholder README. +{test_list} """ write_or_check(comp_dir / "README.md", readme) diff --git a/scripts/verify-composition.sh b/scripts/verify-composition.sh new file mode 100755 index 0000000..567d5e7 --- /dev/null +++ b/scripts/verify-composition.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +composition_name="${1:?usage: verify-composition.sh }" +composition_dir="$repo_root/compositions/$composition_name" + +python3 - "$composition_dir" "$composition_name" <<'PY' +from pathlib import Path +import re +import sys + +comp_dir = Path(sys.argv[1]) +name = sys.argv[2] + +if not comp_dir.exists(): + raise SystemExit(f"missing composition directory: {comp_dir}") + +contract_path = comp_dir / "compositions.yaml" +if not contract_path.exists(): + raise SystemExit(f"missing contract: {contract_path}") + +contract_text = contract_path.read_text() + +def require(condition: bool, message: str) -> None: + if not condition: + raise SystemExit(message) + +require( + re.search(rf"(?m)^ name:\s*{re.escape(name)}\s*$", contract_text) is not None, + f"contract metadata.name does not match directory for {name}", +) +require( + re.search(rf"(?m)^ type:\s*{re.escape(name)}\s*$", contract_text) is not None, + f"contract spec.type does not match directory for {name}", +) + +for relative_path in ("README.md", "examples/README.md", "tests/README.md"): + require((comp_dir / relative_path).exists(), f"missing required file: {comp_dir / relative_path}") + +def non_readme_files(directory: Path) -> list[Path]: + return sorted( + path + for path in directory.rglob("*") + if path.is_file() and path.name.lower() != "readme.md" + ) + +example_assets = non_readme_files(comp_dir / "examples") +test_assets = non_readme_files(comp_dir / "tests") + +require(example_assets, f"{name} is missing example assets beyond README.md") +require(test_assets, f"{name} is missing test assets beyond README.md") + +def has_matching_component(directory: Path) -> bool: + for path in directory.rglob("component.yaml"): + text = path.read_text() + if re.search(rf"(?m)^ type:\s*{re.escape(name)}\s*$", text): + return True + return False + +require(has_matching_component(comp_dir / "examples"), f"{name} examples do not include a matching component.yaml") +require(has_matching_component(comp_dir / "tests"), f"{name} tests do not include a matching component.yaml") + +print( + f"{name}: {len(example_assets)} example assets, {len(test_assets)} test assets, " + f"fixtures verified" +) +PY diff --git a/scripts/verify.sh b/scripts/verify.sh index 84e0157..a5de096 100755 --- a/scripts/verify.sh +++ b/scripts/verify.sh @@ -7,10 +7,15 @@ cd "$repo_root" ./scripts/generate-readme.sh --check ./scripts/score.sh --check +for contract in "$repo_root"/compositions/*/compositions.yaml; do + composition_name="$(basename "$(dirname "$contract")")" + ./scripts/verify-composition.sh "$composition_name" +done + stack_version="$(awk '/^ version: /{print $2}' stack.yaml)" test -n "$stack_version" -kiox -- orun publish "ghcr.io/sourceplane/sumo-platform-ops-stack:${stack_version}" \ +kiox -- orun publish "ghcr.io/sourceplane/stack-tectonic:${stack_version}" \ --dry-run \ --root . \ --version "$stack_version" diff --git a/stack.yaml b/stack.yaml index d5721e1..942972d 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,9 +1,9 @@ apiVersion: orun.io/v1 kind: Stack metadata: - name: sumo-platform-ops-stack - title: Sumo Platform Ops Stack - version: 0.10.0 + name: stack-tectonic + title: Stack Tectonic + version: 0.11.0 description: Versioned OCI-hosted catalog of platform compositions and blueprints for Sourceplane repositories. owner: sourceplane tags: @@ -16,5 +16,5 @@ metadata: registry: host: ghcr.io namespace: sourceplane - repository: sumo-platform-ops-stack + repository: stack-tectonic visibility: public