feat: prep for new packs — runHooksFirst, ork migrate, guides restructure, autoscaler cross-source#180
Closed
iAlexeze wants to merge 10 commits into
Closed
feat: prep for new packs — runHooksFirst, ork migrate, guides restructure, autoscaler cross-source#180iAlexeze wants to merge 10 commits into
iAlexeze wants to merge 10 commits into
Conversation
…migrate rewriter - types: add RunHooksFirst field to HookDeclaration; default false (templates run first) - reconciler: implement runHooksFirst dispatch — hybrid pattern runs declared templates before the hook unless runHooksFirst: true is set in the Katalog - katalog: register custom: block GVKs into the scheme so the fake dynamic client can create and retrieve them during simulate (previously failed silently) - simulate: prepend reactor on fake dynamic client to record ops before the tracker handles them — AddReactor was appended after the tracker and never fired - migrate: new package — AST rewriter from controller-runtime Reconcile signature to Orkestra constructor; handles signature, return types, req.NamespacedName, req.String(), Status().Update() flags, SetupWithManager removal, struct rewrite, import cleanup
… packs; add ork migrate command
- move registry-guide/under guides/ - sidebar: collapse three separate guide entries into one Guides entry - getting-started: rename 06-registry-guide.md → 06-registry.md - faqs: link hooks/constructor answers to migration guide; ecosystem FAQ links to ecosystem guide
…larations - autoscaler: crossSourceFor() — when an autoscale condition has no explicit source: block, look up the matching cross: declaration from operatorBox.cross; matches by decl.As alias OR decl.Crd so camelCase aliases (e.g. paymentSystem) correctly resolve against kebab-case crd names (e.g. payment-system); only selects entries with endpoint or type: metrics — cr/health/events entries are skipped - reconciler: thread crd.OperatorBox.Cross into NewAutoscaler so crossSourceFor has the declarations available at evaluation time - devserver: GET /autoscale-metrics returns a metrics payload (baseline: queueDepth 12, overloaded: 98); POST /autoscale-metrics/flip toggles state — used by 05-from-external-api to simulate an external payment system queue without a real service
…-external-api added 04-sibling-in-cluster: - remove duplicate source: block from autoscale when: condition; cross: declaration is now the single source of truth — no repetition needed (requires fix above) - README: cross-cluster section — external cluster uses an ingress URL at the /katalog route; Orkestra points its cross: endpoint there; no code change 05-from-external-api (new): - autoscale from any external HTTP endpoint, not an Orkestra runtime - cross: declares the endpoint and alias once; autoscale condition references the field path cross.paymentSystem.metrics.queueDepth with no source: on the condition - dev server simulates the payment system; flip via POST /autoscale-metrics/flip - as: paymentSystem (camelCase) — best practice for cross aliases
…(), removes , rewrites the struct, flags and with TODOs. Logging imports are left untouched. Output compiles; resolve TODOs and simulate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pkg/migrate— AST rewriter forork migrate; rewrites controller-runtime Reconcile to Orkestra constructor signature; does not touch loggingrunHooksFirstonHookDeclaration— declared templates run before the hook by default (hybrid 90/10 pattern); setrunHooksFirst: trueto reversecustom:block GVKs registered in scheme so fake dynamic client handles ecosystem resources correctlyork migrateCLI command wired updocumentation/guides/— single sidebar entry covering registry, migration, and ecosystem guidessource:block resolve source fromoperatorBox.cross:declarations; alias and crd name both matched;type: metricsentry required on the cross declaration used for autoscaleGET /autoscale-metrics+POST /autoscale-metrics/flipfor simulating external metric sources locally04-sibling-in-clusterupdated:type: metricsdocumented on cross entry; cross-cluster section added05-from-external-api(new): autoscale from any external HTTP endpoint viacross:declarationTest plan
ork migraterewrites a controller-runtime reconciler; TODOs are accurate; logging import is preservedrunHooksFirst: truein a hybrid katalog — hook fires before templatesrunHooksFirst: false(default) — templates fire first, hook is additiveork simulateon an operator withcustom:block resources — ops recorded correctlyork runon05-from-external-api; confirm workers 2→8 afterPOST /autoscale-metrics/flip;/katalog/processorshowsworkers: 8ork runon04-sibling-in-cluster; Processor scales when Loader queue depth exceeds 60