refactor(fleet-deploy): collapse smoke companion to one trait, one method #299
Open
johnride
wants to merge 1 commits from
refactor/smoke-companion-minimal into feat/smoke-test-contract
pull from: refactor/smoke-companion-minimal
merge into: NationTech:feat/smoke-test-contract
NationTech:master
NationTech:feat/fleet-ch2-operator-recovery
NationTech:feat/fleet-device-exec-logs
NationTech:feat/zitadel-web-pkce-and-human-user
NationTech:feat/jwt-bearer-openbao-auth
NationTech:feat/fleet-ch5-graceful-deploy-upgrade
NationTech:feat/fleet-ch4-agent-upgrade
NationTech:feat/fleet-ch3-log-streaming
NationTech:feat/add-claims-for-openbao
NationTech:refactor/move-zitadel-jwt-to-module
NationTech:feat/fleet-operator-real-data
NationTech:docs/fleet-secrets-device-access
NationTech:chore/fleet-operator-prune-mock-dtos
NationTech:chore/rename-release-to-publish
NationTech:refactor/config-namespace-env-var
NationTech:feat/fleet-staging-openbao
NationTech:feat/auth-add-next-url-redirect
NationTech:pr/harmony-sso-example
NationTech:feat/unified-config-and-secrets
NationTech:ci/fleet-argo-cd
NationTech:ci/fleet-operator-release-pipeline
NationTech:feat/on-device-key-gen
NationTech:feat/install-gitea
NationTech:feat/v0-3-logs-companion
NationTech:feat/smoke-test-contract
NationTech:feat/iobench-redpanda-profile
NationTech:feat/v0-3-dashboard-role-enforcement
NationTech:feat/v0-3-init-containers
NationTech:feat/v0-3-operator-restart-baseline
NationTech:feat/fleet-e2e-x86
NationTech:feat/ceph-score
NationTech:feat/opnsense-bootstrap-score
NationTech:feat/fleet-e2e
NationTech:feat/fleet-e2e-harness-and-ping
NationTech:feat/dashboard-auth
NationTech:feat/fleet-operator-web-frontend
NationTech:feat/deploy_fleet_server_side
NationTech:feat/openwebui
NationTech:feat/iot-aggregation-scale
NationTech:feat/iot-operator-helm-chart
NationTech:feat/removesideeffect
NationTech:feat/test-alert-receivers-sttest
NationTech:feat/brocade-client-add-vlans
NationTech:feat/agent-desired-state
NationTech:feat/opnsense-dns-implementation
NationTech:feat/named-config-instances
NationTech:worktree-bridge-cse_012j1jB37XfjXvDGHUjHrKSj
NationTech:chore/leftover-adr
NationTech:feat/config_e2e_zitadel_openbao
NationTech:example/vllm
NationTech:feat/config_sqlite
NationTech:chore/roadmap
NationTech:feature/kvm-module
NationTech:feat/rustfs
NationTech:feat/harmony_assets
NationTech:feat/brocade_assisted_setup
NationTech:feat/cluster_alerting_score
NationTech:e2e-tests-multicluster
NationTech:fix/refactor_alert_receivers
NationTech:feat/change-node-readiness-strategy
NationTech:feat/zitadel
NationTech:feat/improve-inventory-discovery
NationTech:fix/monitoring_abstractions_openshift
NationTech:feat/nats-jetstream
NationTech:adr-nats-creds
NationTech:feat/st_test
NationTech:feat/dockerAutoinstall
NationTech:chore/cleanup_hacluster
NationTech:doc/cert-management
NationTech:feat/certificate_management
NationTech:adr/017-staleness-failover
NationTech:fix/nats_non_root
NationTech:feat/rebuild_inventory
NationTech:fix/opnsense_update
NationTech:feat/unshedulable_control_planes
NationTech:feat/worker_okd_install
NationTech:doc-and-braindump
NationTech:fix/pxe_install
NationTech:switch-client
NationTech:okd_enable_user_workload_monitoring
NationTech:configure-switch
NationTech:fix/clippy
NationTech:feat/gen-ca-cert
NationTech:feat/okd_default_ingress_class
NationTech:fix/add_routes_to_domain
NationTech:secrets-prompt-editor
NationTech:feat/multisiteApplication
NationTech:feat/ceph-install-score
NationTech:feat/ceph-osd-score
NationTech:feat/ceph_validate_health
NationTech:better-indicatif-progress-grouped
NationTech:feat/crd-alertmanager-configs
NationTech:better-cli
NationTech:opnsense_upgrade
NationTech:feat/monitoring-application-feature
NationTech:dev/postgres
NationTech:feat/cd/localdeploymentdemo
NationTech:feat/webhook_receiver
NationTech:feat/kube-prometheus
NationTech:feat/init_k8s_tenant
NationTech:feat/discord-webhook-receiver
NationTech:feat/kube-prometheus-monitor
NationTech:feat/tenantScore
NationTech:feat/teams-integration
NationTech:feat/slack-notifs
NationTech:monitoring
NationTech:runtime-profiles
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "refactor/smoke-companion-minimal"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaces the seven-file
companion/smoke/directory (Probe trait +ProbeAttempt + ProbeOutcome + ProbeFailure + ProbeName + RetryPolicy +
run_probe + SmokeSuite + SmokeStage + SmokeReport + SmokeTest +
SmokeAssemblyError, ~1500 LOC) with a single
companion/smoke.rs.Net delta: +638 / -1578.
The earlier draft was cardinality matching gone overboard. For what
is, in the end, "after deploy, run an async function and surface a
pipeline report", we now ship:
SmokeTest<T>trait — one async methodverify(&T) -> SmokeReport.Implementers write a regular async fn; no probe abstraction to
learn, no suite builder, no policy value type.
SmokeReport { checks: Vec<CheckReport> }— the pipeline data thedashboard renders top-to-bottom. A report passes iff it has at
least one check AND every check passed (a smoke impl that forgets
to push checks fails loudly, not silently).
CheckReport { name, passed, detail }+pass / pass_with / failconstructors.
poll_untilandtcp_reachable— free functions, not traits.Implementers call them inside
verifywhen useful. A futurehttp_healthyork8s_pod_readylives in this file as anotherasync fn -> CheckReport, not as another trait impl.deploy/deploy_with_smoke— free functions, returningDeployOutcome { interpret, smoke }.deploy_with_smokeblocksthe deploy on smoke success (ADR-023 P4).
Per the PR #292 review: the SmokeTest's associated type is now
type Interpret: Interpret<T>(wastype Score: Score<T>). Onesmoke impl can cover every Score that shares an Interpret —
HelmChartScore + NatsHelmChartScore both verified by one
HelmChartSmokeTest. Pairing is convention-only in v0.3 because
Score::create_interpretstill returnsBox<dyn Interpret<T>>;closing the loop is an additive
type InterpretonScore, deferred.Tests (12 in this module):
when any check fails
Replaces the seven-file `companion/smoke/` directory (Probe trait + ProbeAttempt + ProbeOutcome + ProbeFailure + ProbeName + RetryPolicy + run_probe + SmokeSuite + SmokeStage + SmokeReport + SmokeTest + SmokeAssemblyError, ~1500 LOC) with a single `companion/smoke.rs`. Net delta: +638 / -1578. The earlier draft was cardinality matching gone overboard. For what is, in the end, "after deploy, run an async function and surface a pipeline report", we now ship: * `SmokeTest<T>` trait — one async method `verify(&T) -> SmokeReport`. Implementers write a regular async fn; no probe abstraction to learn, no suite builder, no policy value type. * `SmokeReport { checks: Vec<CheckReport> }` — the pipeline data the dashboard renders top-to-bottom. A report passes iff it has at least one check AND every check passed (a smoke impl that forgets to push checks fails loudly, not silently). * `CheckReport { name, passed, detail }` + `pass / pass_with / fail` constructors. * `poll_until` and `tcp_reachable` — free functions, not traits. Implementers call them inside `verify` when useful. A future `http_healthy` or `k8s_pod_ready` lives in this file as another `async fn -> CheckReport`, not as another trait impl. * `deploy` / `deploy_with_smoke` — free functions, returning `DeployOutcome { interpret, smoke }`. `deploy_with_smoke` blocks the deploy on smoke success (ADR-023 P4). Per the PR #292 review: the SmokeTest's associated type is now `type Interpret: Interpret<T>` (was `type Score: Score<T>`). One smoke impl can cover every Score that shares an Interpret — HelmChartScore + NatsHelmChartScore both verified by one HelmChartSmokeTest. Pairing is convention-only in v0.3 because `Score::create_interpret` still returns `Box<dyn Interpret<T>>`; closing the loop is an additive `type Interpret` on `Score`, deferred. Tests (12 in this module): - deploy runs interpret and returns the underlying Outcome - deploy_with_smoke runs smoke only after interpret succeeds - deploy_with_smoke returns SmokeFailed (with interpret preserved) when any check fails - deploy_with_smoke rejects an empty report — no silent pass-through - deploy_with_smoke skips smoke entirely when interpret fails - SmokeReport::passed semantics (nonempty + all pass) - poll_until pass-on-success, fail-on-budget - tcp_reachable pass against a real loopback listener - tcp_reachable fail with timeout against TEST-NET-1@@ -0,0 +82,4 @@async fn verify(&self, topology: &T) -> SmokeReport;}/// Aggregated smoke result. Dashboards render `checks` top-to-bottom.SmokeTest companion is not specifically for "Dashboards"... Its to be able to have smoke testing done after deploying any kind of stuff. The "Dashboard" specificity which is everywhere in the comments in this file should be removed.
@@ -0,0 +138,4 @@}}pub fn fail(name: &'static str, detail: impl Into<String>) -> Self {should maybe be named "fail_with" to be consistent with pass / pass_with as it needs "detail"
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.