Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 30 additions & 134 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,145 +1,41 @@
## Changelog – Orkestra v0.3.8
# **CHANGELOG — ONCOP Integration (Orkestra Native Cross‑Operator Protocol)**

### ork doctor + ork doctor deploy — Local to production in minutes
### **Added — ONCOP v1 (Orkestra Native Cross‑Operator Protocol)**
Introduced ONCOP as the unified, typed, cross‑operator observation protocol for Orkestra. ONCOP replaces ad‑hoc HTTP integrations and hard‑coded URLs with a declarative, URL‑inferable, cache‑aware protocol used across autoscaling, status fields, and template resolution.

Developers can now deploy any project to Kubernetes with three commands, no operator knowledge required.
Key components:

#### ork doctor
- **Typed observation surfaces**
Added first‑class ONCOP types:
`metrics`, `health`, `cr`, `info`, `events`
Each type maps to a deterministic URL shape under `/katalog/<crd>`.

Examines the current directory and reports what Orkestra found: Dockerfile, Git commit, language (Go, Node.js, Java, Python, Ruby, Rust), port, `.env` variables split into Secrets and ConfigMaps, frontend detection, SMTP/Slack presence, and missing CLI tools. If SMTP or Slack credentials are present but `--notify-me` was not set, it surfaces a hint.
- **URL inference engine**
Implemented `BuildONCOPURL` to construct ONCOP URLs from `CrossCRDDeclaration` using:
`source.host`, `source.type`, `crd`, `selector.namespace`, `selector.name`.

```bash
ork doctor
ork doctor init --name my-api
ork doctor init --name my-api --notify-me --add-ingress
```
- **Cross‑operator resolver integration**
Updated `readCross()` to support ONCOP host‑based reads as Path 2, after informer registry and before raw endpoint fallback.
Responses injected into `.cross.<as>` for templates, autoscale conditions, and status fields.

`ork doctor init` generates three files:
- `.orkestra/katalog.yaml` — all Kubernetes resources Orkestra manages; edit freely
- `.orkestra/app.yaml` — the ConfigMap CR the developer owns
- `.orkestra/values.yaml` — Helm values for the Orkestra operator
- **New ONCOP type: `cr`**
Added `type: cr` for CR‑specific detail (`status`, `spec`, `children`, `metrics`).
Distinguishes CR detail from CRD‑level `info`.

#### ork doctor deploy
- **Autoscaler ONCOP support**
Autoscale conditions now resolve `cross.<crd>.metrics.*` via ONCOP metrics endpoint with optional caching (`cacheFor:`).

Builds the Docker image, pushes it, runs `ork kompose` to merge all registered katalogs, generates the cluster bundle, installs or verifies the Orkestra operator via Helm, patches the image in the CR, and watches the rollout.
- **Resolver enhancements**
Added `ParseCrossField` and extraction helpers (`ExtractCrossCRD`, `ExtractCrossCategory`, `ExtractCrossFieldName`, `ExtractCrossNamespace`) to unify cross‑field parsing.

```bash
ork doctor deploy --registry ghcr.io/myorg
ork doctor deploy --registry ghcr.io/myorg --dev # spins up a local kind cluster
ork doctor deploy --registry ghcr.io/myorg --dry-run
```
- **Fallback semantics**
Resolution priority formalised as:
`informer registry → ONCOP host → raw endpoint → empty result`.

Key behaviours:
- **Auto-installs `kubectl` and `helm`** if missing — developers need only Docker and the `ork` CLI
- **Auto-installs ingress controller** (nginx) when the project has a frontend
- **Multi-project kompose**: all deployed projects are registered in `~/.orkestra/deploy/komposer.yaml` by absolute local path; `ork kompose` merges them into `__runtime_katalog_do_not_edit.yml` before bundle generation — no git commit or GitHub access needed
- **Kompose errors surface first**: any malformed or unreadable katalog fails before touching the cluster
- **Deploy state** written to `~/.orkestra/deploy/state.json` before every image patch; previous image always available for instant rollback
- **Internal service URL checklist** printed after every deploy so developers can wire projects together (`export MY_API_URL=...`)
- **Control Center fallback**: when `controlCenterHost` is empty, prints the `kubectl port-forward` command for local access
- **Cross‑binary caching**
Added per‑source caching for ONCOP responses to avoid repeated remote calls.

#### ork doctor deploy rollback

Restores the previous image by reading `~/.orkestra/deploy/state.json` (annotation fallback for backward compatibility). Swaps current and previous before patching so every rollback is reversible.

```bash
ork doctor deploy rollback
ork doctor deploy rollback --image ghcr.io/myorg/my-api:v1.2.0
```

#### Out-of-the-box developer notifications

Every katalog generated by `ork doctor init` ships with a `notify:` block on the deployment readiness condition. When replicas are not ready within the notification interval (default 15 minutes), Orkestra sends the `developer` team the exact `kubectl logs` command and a `ork doctor deploy rollback` hint.

Wire the `developer` team with `ork doctor init --notify-me`:
- Reads the developer's Git author email from `git log -1`
- Reads SMTP and Slack credentials from `.env`
- Generates a `notification:` block in `katalog.yaml` with `defaults.interval: 15m` and a `developer` team
- Creates an `orkestra-notification` Secret in `orkestra-system` during deploy — credentials never touch the Katalog YAML
- Adds `runtime.extraEnvFrom` to `values.yaml` so `pkg/konfig` reads the credentials as env vars

#### Developer example pack

New pack at `examples/developer/` with five progressive examples:

| Example | What it teaches |
|---------|----------------|
| 01 — One project | First deploy, Control Center walkthrough |
| 02 — Frontend + backend | Multi-project deploy, internal service URL wiring |
| 03 — Rollback and Ingress | Breaking a deploy and restoring it, public URL |
| 04 — Notifications | SMTP/Slack wiring, triggering and observing a notification |
| 05 — Deletion protection | Default protection, correct decommission sequence |

Registered in `embed.go`, `init_packs.go`, CI packaging, and release workflows.

---

## Changelog – Orkestra v0.2.9

### ✨ New `ork generate katalog` – scaffold a Katalog in seconds

Scaffold a production‑ready `katalog.yaml` with sensible defaults, optional typed‑mode placeholders, and built‑in security, notification, and provider blocks. No more memorising the schema.

**Flags:**
- `--add-hook` – typed mode with a `hooks` declaration (comment)
- `--add-constructor` – typed mode with a `constructor` declaration (`default: false`)
- `--typed` – both hook and constructor sections commented; you choose one
- `--add-security` – add namespace & deletion protection stubs
- `--add-notification` – add Slack/email notification example
- `--add-provider <aws|azure|gcp>` – add cloud provider configuration

**Example:**
```bash
ork generate katalog --add-hook --add-security --add-provider aws -o my-katalog.yaml
```

[Read the full command reference](https://docs.orkestra.io/reference/cli/generate-katalog)

---

### 🚀 Complete CI/CD for typed operators (hooks & constructors)

Two new E2E workflows now run in GitHub Actions for the **advanced pack**:

- **09-hooks** – typed hooks for a `Database` CRD (StatefulSet + Service + optional CronJob)
- **10-constructors** – custom constructor for a `Pipeline` CRD (state machine with Jobs)

Both workflows:
- Generate the typed registry (`ork generate registry`)
- Show the expected validation failure with the standard `ork` binary
- Build a custom `ork` binary that includes the user’s Go code
- Build, tag (with `hooks-` or `constructor-` prefix), and push a container image to `ghcr.io/orkspace/orkestra-typed-extensions`
- Deploy the image via Helm, apply the CR, and verify resource creation
- Test cleanup via owner reference garbage collection

These workflows prove that typed operators are **fully automatable** – from `git push` to a running cluster – using the same Orkestra GitHub Action that works for dynamic operators.

---

### 🔧 Action improvements

- New input `generate-registry` – runs `ork generate registry` after `init`
- New output `registry_file` – path to the generated registry (for inspection)
- `namespace` input now defaults to `orkestra-system` and is passed to `generate configmap` and `generate bundle`
- Support for custom `image_repo` and `image_tag` in typed E2E workflows

---

### 🐛 Fixes

- `mode:` is now automatically inferred when `apiTypes.location` is set (no need to write `mode: typed` manually)
- Registry generation no longer requires `init=true` – works with any existing Katalog
- The stub `pkg/runtime/zz_generated_runtime_registry.go` now includes structured debug logging (`logger.Debug()`) to help diagnose registration issues

---

### 📖 Documentation

- New command reference for `ork generate katalog`
- Updated typed extensions guide (`09-hooks` and `10-constructors`) with step‑by‑step instructions and the full E2E workflow

---

### Upgrading

No upgrade required if you’re using `ork generate bundle` or `ork run`. For typed operators, simply regenerate your registry file with the new `ork generate registry` (the output format has not changed).
### **Impact**
ONCOP enables consistent, declarative, cross‑operator observation across Orkestra.
Autoscalers, status fields, and templates now consume cross‑operator data without bespoke integrations or hard‑coded URLs.
Operators implementing ONCOP become first‑class participants in the Orkestra ecosystem.
Loading
Loading