@tdk-landscape/tdk-cli-core 1.3.53 → 1.3.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/cli/dist/commands/doctor.js +21 -3
- package/cli/dist/commands/upgrade.js +7 -7
- package/cli/dist/generator/extension-fetch.js +16 -9
- package/cli/dist/utils/spinner.js +39 -0
- package/cli/package.json +1 -2
- package/package.json +16 -2
- package/.claude/skills/layer-autoresearch/SKILL.md +0 -48
- package/.claude/skills/tdk-troubleshoot/SKILL.md +0 -222
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -40
- package/.github/ISSUE_TEMPLATE/config.yml +0 -11
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -18
- package/.github/ISSUE_TEMPLATE/premium_license.yml +0 -43
- package/.github/dependabot.yml +0 -33
- package/.github/pull_request_template.md +0 -5
- package/.github/workflows/ci.yml +0 -200
- package/.github/workflows/release-binaries.yml +0 -139
- package/.github/zizmor.yml +0 -9
- package/.pre-commit-config.yaml +0 -57
- package/CODE_OF_CONDUCT.md +0 -9
- package/CONTRIBUTING.md +0 -42
- package/Makefile +0 -92
- package/SECURITY.md +0 -17
- package/benchmarks/results/container-scale-2026-09-25T20-54-49-736Z.json +0 -45
- package/benchmarks/results/container-scale-2026-09-25T21-01-20-540Z.json +0 -150
- package/benchmarks/results/container-scale-2026-09-25T21-15-01-441Z.json +0 -73
- package/benchmarks/results/container-scale-2026-09-25T22-09-01-630Z.json +0 -77
- package/benchmarks/results/container-scale-2026-09-25T22-18-28-371Z.json +0 -202
- package/cli/AGENTS.md +0 -390
- package/cli/DESIGN.md +0 -735
- package/cli/README.md +0 -292
- package/cli/biome.json +0 -40
- package/cli/dependency-graph.svg +0 -1135
- package/cli/dist/cli.d.ts +0 -3
- package/cli/dist/cli.d.ts.map +0 -1
- package/cli/dist/cli.js.map +0 -1
- package/cli/dist/commands/completion.d.ts +0 -3
- package/cli/dist/commands/completion.d.ts.map +0 -1
- package/cli/dist/commands/completion.js.map +0 -1
- package/cli/dist/commands/config.d.ts +0 -3
- package/cli/dist/commands/config.d.ts.map +0 -1
- package/cli/dist/commands/config.js.map +0 -1
- package/cli/dist/commands/doctor.d.ts +0 -19
- package/cli/dist/commands/doctor.d.ts.map +0 -1
- package/cli/dist/commands/doctor.js.map +0 -1
- package/cli/dist/commands/down.d.ts +0 -3
- package/cli/dist/commands/down.d.ts.map +0 -1
- package/cli/dist/commands/down.js.map +0 -1
- package/cli/dist/commands/help.d.ts +0 -2
- package/cli/dist/commands/help.d.ts.map +0 -1
- package/cli/dist/commands/help.js.map +0 -1
- package/cli/dist/commands/networks.d.ts +0 -3
- package/cli/dist/commands/networks.d.ts.map +0 -1
- package/cli/dist/commands/networks.js.map +0 -1
- package/cli/dist/commands/project.d.ts +0 -9
- package/cli/dist/commands/project.d.ts.map +0 -1
- package/cli/dist/commands/project.js.map +0 -1
- package/cli/dist/commands/projects.d.ts +0 -3
- package/cli/dist/commands/projects.d.ts.map +0 -1
- package/cli/dist/commands/projects.js.map +0 -1
- package/cli/dist/commands/resource.d.ts +0 -69
- package/cli/dist/commands/resource.d.ts.map +0 -1
- package/cli/dist/commands/resource.js.map +0 -1
- package/cli/dist/commands/resources.d.ts +0 -3
- package/cli/dist/commands/resources.d.ts.map +0 -1
- package/cli/dist/commands/resources.js.map +0 -1
- package/cli/dist/commands/stack.d.ts +0 -3
- package/cli/dist/commands/stack.d.ts.map +0 -1
- package/cli/dist/commands/stack.js.map +0 -1
- package/cli/dist/commands/stacks.d.ts +0 -3
- package/cli/dist/commands/stacks.d.ts.map +0 -1
- package/cli/dist/commands/stacks.js.map +0 -1
- package/cli/dist/commands/status.d.ts +0 -3
- package/cli/dist/commands/status.d.ts.map +0 -1
- package/cli/dist/commands/status.js.map +0 -1
- package/cli/dist/commands/ui.d.ts +0 -3
- package/cli/dist/commands/ui.d.ts.map +0 -1
- package/cli/dist/commands/ui.js.map +0 -1
- package/cli/dist/commands/up.d.ts +0 -3
- package/cli/dist/commands/up.d.ts.map +0 -1
- package/cli/dist/commands/up.js.map +0 -1
- package/cli/dist/commands/upgrade.d.ts +0 -14
- package/cli/dist/commands/upgrade.d.ts.map +0 -1
- package/cli/dist/commands/upgrade.js.map +0 -1
- package/cli/dist/commands/version.d.ts +0 -3
- package/cli/dist/commands/version.d.ts.map +0 -1
- package/cli/dist/commands/version.js.map +0 -1
- package/cli/dist/components/Accessible.d.ts +0 -8
- package/cli/dist/components/Accessible.d.ts.map +0 -1
- package/cli/dist/components/Accessible.js.map +0 -1
- package/cli/dist/components/BaseTooltip.d.ts +0 -4
- package/cli/dist/components/BaseTooltip.d.ts.map +0 -1
- package/cli/dist/components/BaseTooltip.js.map +0 -1
- package/cli/dist/components/DetailPanel.d.ts +0 -4
- package/cli/dist/components/DetailPanel.d.ts.map +0 -1
- package/cli/dist/components/DetailPanel.js.map +0 -1
- package/cli/dist/components/FileTree.d.ts +0 -4
- package/cli/dist/components/FileTree.d.ts.map +0 -1
- package/cli/dist/components/FileTree.js.map +0 -1
- package/cli/dist/components/ResourceSelectInput.d.ts +0 -4
- package/cli/dist/components/ResourceSelectInput.d.ts.map +0 -1
- package/cli/dist/components/ResourceSelectInput.js.map +0 -1
- package/cli/dist/components/ResourceTable.d.ts +0 -4
- package/cli/dist/components/ResourceTable.d.ts.map +0 -1
- package/cli/dist/components/ResourceTable.js.map +0 -1
- package/cli/dist/components/TabBar.d.ts +0 -4
- package/cli/dist/components/TabBar.d.ts.map +0 -1
- package/cli/dist/components/TabBar.js.map +0 -1
- package/cli/dist/components/Tooltip.d.ts +0 -12
- package/cli/dist/components/Tooltip.d.ts.map +0 -1
- package/cli/dist/components/Tooltip.js.map +0 -1
- package/cli/dist/components/index.d.ts +0 -8
- package/cli/dist/components/index.d.ts.map +0 -1
- package/cli/dist/components/index.js.map +0 -1
- package/cli/dist/config/platform-standards.d.ts +0 -159
- package/cli/dist/config/platform-standards.d.ts.map +0 -1
- package/cli/dist/config/platform-standards.js.map +0 -1
- package/cli/dist/generator/extension-fetch.d.ts +0 -25
- package/cli/dist/generator/extension-fetch.d.ts.map +0 -1
- package/cli/dist/generator/extension-fetch.js.map +0 -1
- package/cli/dist/generator/template-engine.d.ts +0 -62
- package/cli/dist/generator/template-engine.d.ts.map +0 -1
- package/cli/dist/generator/template-engine.js.map +0 -1
- package/cli/dist/index.d.ts +0 -11
- package/cli/dist/index.d.ts.map +0 -1
- package/cli/dist/index.js.map +0 -1
- package/cli/dist/types/index.d.ts +0 -257
- package/cli/dist/types/index.d.ts.map +0 -1
- package/cli/dist/types/index.js.map +0 -1
- package/cli/dist/utils/cache.d.ts +0 -19
- package/cli/dist/utils/cache.d.ts.map +0 -1
- package/cli/dist/utils/cache.js.map +0 -1
- package/cli/dist/utils/command-helpers.d.ts +0 -17
- package/cli/dist/utils/command-helpers.d.ts.map +0 -1
- package/cli/dist/utils/command-helpers.js.map +0 -1
- package/cli/dist/utils/constants.d.ts +0 -53
- package/cli/dist/utils/constants.d.ts.map +0 -1
- package/cli/dist/utils/constants.js.map +0 -1
- package/cli/dist/utils/discovery-context.d.ts +0 -4
- package/cli/dist/utils/discovery-context.d.ts.map +0 -1
- package/cli/dist/utils/discovery-context.js.map +0 -1
- package/cli/dist/utils/docker.d.ts +0 -4
- package/cli/dist/utils/docker.d.ts.map +0 -1
- package/cli/dist/utils/docker.js.map +0 -1
- package/cli/dist/utils/doctor-runtime.d.ts +0 -81
- package/cli/dist/utils/doctor-runtime.d.ts.map +0 -1
- package/cli/dist/utils/doctor-runtime.js.map +0 -1
- package/cli/dist/utils/env-validator.d.ts +0 -15
- package/cli/dist/utils/env-validator.d.ts.map +0 -1
- package/cli/dist/utils/env-validator.js.map +0 -1
- package/cli/dist/utils/errors.d.ts +0 -31
- package/cli/dist/utils/errors.d.ts.map +0 -1
- package/cli/dist/utils/errors.js.map +0 -1
- package/cli/dist/utils/file-helpers.d.ts +0 -14
- package/cli/dist/utils/file-helpers.d.ts.map +0 -1
- package/cli/dist/utils/file-helpers.js.map +0 -1
- package/cli/dist/utils/formatting.d.ts +0 -30
- package/cli/dist/utils/formatting.d.ts.map +0 -1
- package/cli/dist/utils/formatting.js.map +0 -1
- package/cli/dist/utils/paths.d.ts +0 -3
- package/cli/dist/utils/paths.d.ts.map +0 -1
- package/cli/dist/utils/paths.js.map +0 -1
- package/cli/dist/utils/port-assignment.d.ts +0 -6
- package/cli/dist/utils/port-assignment.d.ts.map +0 -1
- package/cli/dist/utils/port-assignment.js.map +0 -1
- package/cli/dist/utils/project-features.d.ts +0 -23
- package/cli/dist/utils/project-features.d.ts.map +0 -1
- package/cli/dist/utils/project-features.js.map +0 -1
- package/cli/dist/utils/project-templates.d.ts +0 -7
- package/cli/dist/utils/project-templates.d.ts.map +0 -1
- package/cli/dist/utils/project-templates.js.map +0 -1
- package/cli/dist/utils/prompt.d.ts +0 -28
- package/cli/dist/utils/prompt.d.ts.map +0 -1
- package/cli/dist/utils/prompt.js.map +0 -1
- package/cli/dist/utils/resource-features.d.ts +0 -29
- package/cli/dist/utils/resource-features.d.ts.map +0 -1
- package/cli/dist/utils/resource-features.js.map +0 -1
- package/cli/dist/utils/service-urls.d.ts +0 -30
- package/cli/dist/utils/service-urls.d.ts.map +0 -1
- package/cli/dist/utils/service-urls.js.map +0 -1
- package/cli/dist/utils/services.d.ts +0 -18
- package/cli/dist/utils/services.d.ts.map +0 -1
- package/cli/dist/utils/services.js.map +0 -1
- package/cli/dist/utils/stack-features.d.ts +0 -22
- package/cli/dist/utils/stack-features.d.ts.map +0 -1
- package/cli/dist/utils/stack-features.js.map +0 -1
- package/cli/dist/utils/tar.d.ts +0 -7
- package/cli/dist/utils/tar.d.ts.map +0 -1
- package/cli/dist/utils/tar.js.map +0 -1
- package/cli/dist/utils/tilt.d.ts +0 -20
- package/cli/dist/utils/tilt.d.ts.map +0 -1
- package/cli/dist/utils/tilt.js.map +0 -1
- package/cli/dist/utils/validation.d.ts +0 -16
- package/cli/dist/utils/validation.d.ts.map +0 -1
- package/cli/dist/utils/validation.js.map +0 -1
- package/cli/knip.json +0 -6
- package/cli/pnpm-lock.yaml +0 -2305
- package/cli/pnpm-workspace.yaml +0 -2
- package/cli/src/cli.ts +0 -72
- package/cli/src/commands/__tests__/always-enabled-infra.test.ts +0 -109
- package/cli/src/commands/__tests__/config.test.ts +0 -146
- package/cli/src/commands/__tests__/doctor.test.ts +0 -730
- package/cli/src/commands/__tests__/error-handling.test.ts +0 -78
- package/cli/src/commands/__tests__/phases-model.test.ts +0 -161
- package/cli/src/commands/__tests__/project-resource-features-e2e.test.ts +0 -187
- package/cli/src/commands/__tests__/project.test.ts +0 -68
- package/cli/src/commands/__tests__/resource.test.ts +0 -226
- package/cli/src/commands/__tests__/saas-starter-integration.test.ts +0 -194
- package/cli/src/commands/__tests__/stack-features-e2e.test.ts +0 -135
- package/cli/src/commands/__tests__/upgrade.test.ts +0 -198
- package/cli/src/commands/completion.ts +0 -300
- package/cli/src/commands/config.ts +0 -299
- package/cli/src/commands/doctor.ts +0 -926
- package/cli/src/commands/down.ts +0 -37
- package/cli/src/commands/help.ts +0 -143
- package/cli/src/commands/networks-design.md +0 -80
- package/cli/src/commands/networks.ts +0 -332
- package/cli/src/commands/project.ts +0 -456
- package/cli/src/commands/projects.ts +0 -82
- package/cli/src/commands/resource.ts +0 -652
- package/cli/src/commands/resources.ts +0 -95
- package/cli/src/commands/stack.ts +0 -128
- package/cli/src/commands/stacks.ts +0 -52
- package/cli/src/commands/status.ts +0 -88
- package/cli/src/commands/ui.tsx +0 -843
- package/cli/src/commands/up.ts +0 -169
- package/cli/src/commands/upgrade.ts +0 -628
- package/cli/src/commands/version.ts +0 -9
- package/cli/src/components/Accessible.tsx +0 -21
- package/cli/src/components/BaseTooltip.tsx +0 -66
- package/cli/src/components/DetailPanel.tsx +0 -146
- package/cli/src/components/FileTree.tsx +0 -89
- package/cli/src/components/ResourceSelectInput.tsx +0 -30
- package/cli/src/components/ResourceTable.tsx +0 -78
- package/cli/src/components/TabBar.tsx +0 -53
- package/cli/src/components/Tooltip.tsx +0 -11
- package/cli/src/components/index.ts +0 -7
- package/cli/src/config/platform-standards.test.ts +0 -11
- package/cli/src/config/platform-standards.ts +0 -196
- package/cli/src/generator/__tests__/extension-fetch.test.ts +0 -242
- package/cli/src/generator/__tests__/template-engine.test.ts +0 -70
- package/cli/src/generator/extension-fetch.ts +0 -286
- package/cli/src/generator/template-engine.ts +0 -752
- package/cli/src/index.ts +0 -86
- package/cli/src/templates.d.ts +0 -4
- package/cli/src/types/index.ts +0 -353
- package/cli/src/utils/__tests__/cache.test.ts +0 -98
- package/cli/src/utils/__tests__/formatting.test.ts +0 -170
- package/cli/src/utils/__tests__/paths.test.ts +0 -180
- package/cli/src/utils/__tests__/port-assignment.test.ts +0 -121
- package/cli/src/utils/__tests__/service-urls.test.ts +0 -174
- package/cli/src/utils/__tests__/services.test.ts +0 -531
- package/cli/src/utils/__tests__/tilt.test.ts +0 -172
- package/cli/src/utils/__tests__/validation.test.ts +0 -148
- package/cli/src/utils/cache.ts +0 -76
- package/cli/src/utils/command-helpers.ts +0 -54
- package/cli/src/utils/constants.ts +0 -130
- package/cli/src/utils/discovery-context.ts +0 -49
- package/cli/src/utils/docker.ts +0 -20
- package/cli/src/utils/doctor-runtime.ts +0 -644
- package/cli/src/utils/env-validator.ts +0 -139
- package/cli/src/utils/errors.ts +0 -168
- package/cli/src/utils/file-helpers.ts +0 -62
- package/cli/src/utils/formatting.ts +0 -215
- package/cli/src/utils/paths.ts +0 -53
- package/cli/src/utils/port-assignment.ts +0 -106
- package/cli/src/utils/project-features.ts +0 -118
- package/cli/src/utils/project-templates.ts +0 -29
- package/cli/src/utils/prompt.ts +0 -128
- package/cli/src/utils/resource-features.ts +0 -215
- package/cli/src/utils/service-urls.ts +0 -124
- package/cli/src/utils/services.ts +0 -364
- package/cli/src/utils/stack-features.ts +0 -30
- package/cli/src/utils/tar.ts +0 -24
- package/cli/src/utils/tilt.ts +0 -133
- package/cli/src/utils/validation.ts +0 -67
- package/cli/tsconfig.json +0 -25
- package/cli/tsconfig.typecheck.json +0 -8
- package/docs/FEATURES.md +0 -281
- package/docs/demo.svg +0 -217
- package/engine/docs/AUTODISCOVERY_TEST.md +0 -182
- package/engine/docs/C4-ARCHITECTURE-operations.md +0 -396
- package/engine/docs/C4-ARCHITECTURE-overview.md +0 -284
- package/engine/docs/C4-ARCHITECTURE.md +0 -17
- package/engine/docs/GOLDEN_IMAGE_INTEGRATION.md +0 -349
- package/engine/docs/MANIFEST_DRIVEN_ARCHITECTURE.md +0 -357
- package/engine/docs/README.md +0 -284
- package/install.sh +0 -19
- package/knip.json +0 -10
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/.openspec.yaml +0 -2
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/design.md +0 -102
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/proposal.md +0 -31
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-notifications/spec.md +0 -48
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-orchestration/spec.md +0 -63
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-troubleshooting/spec.md +0 -56
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/tasks.md +0 -61
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/design.md +0 -114
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/proposal.md +0 -32
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/manifest-field-migration/spec.md +0 -20
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/resource-terminology-standard/spec.md +0 -20
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/stack-terminology-standard/spec.md +0 -20
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/tasks.md +0 -194
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/design.md +0 -111
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/proposal.md +0 -33
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/function-naming-alignment/spec.md +0 -12
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/optional-parameter-patterns/spec.md +0 -18
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-documentation/spec.md +0 -16
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-naming-consistency/spec.md +0 -12
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-ordering-standard/spec.md +0 -12
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/tasks.md +0 -194
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/design.md +0 -84
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/proposal.md +0 -31
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/codebase-audit/spec.md +0 -27
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/dead-code-cleanup/spec.md +0 -27
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/test-gap-fill/spec.md +0 -23
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/todo-resolution/spec.md +0 -27
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/tasks.md +0 -39
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/design.md +0 -80
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/proposal.md +0 -40
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/spec.md +0 -52
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/tasks.md +0 -51
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/.openspec.yaml +0 -2
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/design.md +0 -43
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/proposal.md +0 -29
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/specs/self-contained-generated-projects/spec.md +0 -67
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/tasks.md +0 -27
- package/openspec/changes/optimize-runtime-docker-layers/.openspec.yaml +0 -3
- package/openspec/changes/optimize-runtime-docker-layers/design.md +0 -81
- package/openspec/changes/optimize-runtime-docker-layers/proposal.md +0 -44
- package/openspec/changes/optimize-runtime-docker-layers/specs/runtime-container-footprint/spec.md +0 -79
- package/openspec/changes/optimize-runtime-docker-layers/tasks.md +0 -36
- package/openspec/changes/prioritized-cold-start/.openspec.yaml +0 -4
- package/openspec/changes/prioritized-cold-start/design.md +0 -137
- package/openspec/changes/prioritized-cold-start/proposal.md +0 -41
- package/openspec/changes/prioritized-cold-start/specs/on-demand-resource-startup/spec.md +0 -98
- package/openspec/changes/prioritized-cold-start/tasks.md +0 -69
- package/openspec/config.yaml +0 -1
- package/openspec/specs/manifest-field-migration/spec.md +0 -24
- package/openspec/specs/resource-terminology-standard/spec.md +0 -24
- package/openspec/specs/self-contained-generated-projects/spec.md +0 -67
- package/openspec/specs/stack-terminology-standard/spec.md +0 -24
- package/platform/services/platform/proxy/service.yaml +0 -14
- package/scripts/audit-codebase.sh +0 -213
- package/scripts/autoresearch/layer-eval.sh +0 -65
- package/scripts/benchmark/README.md +0 -25
- package/scripts/benchmark/container-scale.ts +0 -503
- package/scripts/benchmark/pre-release-gate.sh +0 -9
- package/scripts/install-git-hooks.sh +0 -14
- package/scripts/measure-idle-footprint.sh +0 -58
- package/scripts/record-demo.sh +0 -43
- package/scripts/release-binaries.sh +0 -97
- package/scripts/setup-pre-commit.sh +0 -33
- package/scripts/stage-npm-engine.sh +0 -36
- package/tests/tilt-engine/__init__.py +0 -5
- package/tests/tilt-engine/conftest.py +0 -182
- package/tests/tilt-engine/fixtures/appointment-frontend-service.json +0 -11
- package/tests/tilt-engine/fixtures/identity-backend-service.json +0 -12
- package/tests/tilt-engine/fixtures/invalid-service.json +0 -4
- package/tests/tilt-engine/test_agents_md_generator.py +0 -341
- package/tests/tilt-engine/test_agents_md_integration.py +0 -378
- package/tests/tilt-engine/test_cache_operations.py +0 -181
- package/tests/tilt-engine/test_cache_persistence.py +0 -142
- package/tests/tilt-engine/test_code_executor.py +0 -152
- package/tests/tilt-engine/test_code_viewer.py +0 -127
- package/tests/tilt-engine/test_compose_port_anchors.py +0 -310
- package/tests/tilt-engine/test_config_inspector.py +0 -162
- package/tests/tilt-engine/test_daemon_focus_mode.py +0 -89
- package/tests/tilt-engine/test_daemon_polling.py +0 -122
- package/tests/tilt-engine/test_daemon_registration.py +0 -115
- package/tests/tilt-engine/test_daemon_validation.py +0 -107
- package/tests/tilt-engine/test_docker_generator_bugs.py +0 -493
- package/tests/tilt-engine/test_docker_prune.py +0 -119
- package/tests/tilt-engine/test_dockerignore_path_bug.py +0 -82
- package/tests/tilt-engine/test_file_browser.py +0 -193
- package/tests/tilt-engine/test_frontend_basepath_manifest.py +0 -27
- package/tests/tilt-engine/test_health_dependencies.py +0 -130
- package/tests/tilt-engine/test_health_endpoints.py +0 -118
- package/tests/tilt-engine/test_health_tilt_ui.py +0 -85
- package/tests/tilt-engine/test_runtime_container_footprint.py +0 -162
- package/tests/tilt-engine/test_sablier_defer_start.py +0 -237
- package/tests/tilt-engine/test_safety_aliases.py +0 -84
- package/tests/tilt-engine/test_snapshot_diff.py +0 -136
- package/tests/tilt-engine/test_snapshot_persistence.py +0 -163
- package/tests/tilt-engine/test_snapshot_scanning.py +0 -123
- package/tests/tilt-engine/test_standalone_project_boot.py +0 -61
- package/tests/tilt-engine/test_standalone_traefik.py +0 -160
- package/tests/tilt-engine/test_traefik_static_wake_route.py +0 -187
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Tests for snapshot persistence functionality.
|
|
3
|
-
Tests saving and loading snapshots from the filesystem.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
import json
|
|
7
|
-
import os
|
|
8
|
-
import pytest
|
|
9
|
-
from pathlib import Path
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@pytest.mark.snapshot
|
|
13
|
-
class TestSnapshotPersistence:
|
|
14
|
-
"""Tests for snapshot save/load operations."""
|
|
15
|
-
|
|
16
|
-
def test_saving_snapshot_creates_file(self, temp_dir):
|
|
17
|
-
"""
|
|
18
|
-
Scenario: Saving snapshot creates file
|
|
19
|
-
WHEN a snapshot is saved to `.tdk/.tdk-out/snapshots/resource-snapshot.json`
|
|
20
|
-
THEN the file SHALL exist with valid JSON containing all service data
|
|
21
|
-
"""
|
|
22
|
-
import sys
|
|
23
|
-
sys.path.insert(0, str(Path("discovery").resolve()))
|
|
24
|
-
from resource_snapshot import save_snapshot
|
|
25
|
-
|
|
26
|
-
original_dir = os.getcwd()
|
|
27
|
-
os.chdir(temp_dir)
|
|
28
|
-
|
|
29
|
-
try:
|
|
30
|
-
services = [
|
|
31
|
-
"services/product/a/service.json",
|
|
32
|
-
"services/product/b/service.json"
|
|
33
|
-
]
|
|
34
|
-
save_snapshot(services)
|
|
35
|
-
|
|
36
|
-
snapshot_file = Path(".tdk/.tdk-out/snapshots/resource-snapshot.json")
|
|
37
|
-
assert snapshot_file.exists(), "Snapshot file should be created"
|
|
38
|
-
|
|
39
|
-
# Verify content
|
|
40
|
-
with open(snapshot_file) as f:
|
|
41
|
-
data = json.load(f)
|
|
42
|
-
assert data["count"] == 2
|
|
43
|
-
assert data["services"] == services
|
|
44
|
-
assert "timestamp" in data
|
|
45
|
-
assert "hash" in data
|
|
46
|
-
finally:
|
|
47
|
-
os.chdir(original_dir)
|
|
48
|
-
|
|
49
|
-
def test_loading_snapshot_reads_file(self, temp_dir):
|
|
50
|
-
"""
|
|
51
|
-
Scenario: Loading snapshot reads file
|
|
52
|
-
WHEN a snapshot is loaded from an existing `.tdk/.tdk-out/snapshots/resource-snapshot.json`
|
|
53
|
-
THEN it SHALL return the previously saved service data
|
|
54
|
-
"""
|
|
55
|
-
import sys
|
|
56
|
-
sys.path.insert(0, str(Path("discovery").resolve()))
|
|
57
|
-
from resource_snapshot import save_snapshot, load_snapshot
|
|
58
|
-
|
|
59
|
-
original_dir = os.getcwd()
|
|
60
|
-
os.chdir(temp_dir)
|
|
61
|
-
|
|
62
|
-
try:
|
|
63
|
-
# Create a snapshot first
|
|
64
|
-
services = ["services/product/test/service.json"]
|
|
65
|
-
save_snapshot(services)
|
|
66
|
-
|
|
67
|
-
# Load it
|
|
68
|
-
snapshot = load_snapshot()
|
|
69
|
-
|
|
70
|
-
assert snapshot["count"] == 1
|
|
71
|
-
assert snapshot["services"] == services
|
|
72
|
-
assert "timestamp" in snapshot
|
|
73
|
-
finally:
|
|
74
|
-
os.chdir(original_dir)
|
|
75
|
-
|
|
76
|
-
def test_loading_missing_snapshot(self, temp_dir):
|
|
77
|
-
"""
|
|
78
|
-
Scenario: Loading missing snapshot
|
|
79
|
-
WHEN a snapshot is loaded from a non-existent `.tdk/.tdk-out/snapshots/resource-snapshot.json`
|
|
80
|
-
THEN it SHALL return an empty list without error
|
|
81
|
-
"""
|
|
82
|
-
import sys
|
|
83
|
-
sys.path.insert(0, str(Path("discovery").resolve()))
|
|
84
|
-
from resource_snapshot import load_snapshot
|
|
85
|
-
|
|
86
|
-
original_dir = os.getcwd()
|
|
87
|
-
os.chdir(temp_dir)
|
|
88
|
-
|
|
89
|
-
try:
|
|
90
|
-
snapshot = load_snapshot()
|
|
91
|
-
|
|
92
|
-
assert snapshot["count"] == 0
|
|
93
|
-
assert snapshot["services"] == []
|
|
94
|
-
assert snapshot["timestamp"] is None
|
|
95
|
-
finally:
|
|
96
|
-
os.chdir(original_dir)
|
|
97
|
-
|
|
98
|
-
def test_saving_creates_directory_structure(self, temp_dir):
|
|
99
|
-
"""Test that saving creates the .tdk/.tdk-out/snapshots directory if it doesn't exist."""
|
|
100
|
-
import sys
|
|
101
|
-
sys.path.insert(0, str(Path("discovery").resolve()))
|
|
102
|
-
from resource_snapshot import save_snapshot
|
|
103
|
-
|
|
104
|
-
original_dir = os.getcwd()
|
|
105
|
-
os.chdir(temp_dir)
|
|
106
|
-
|
|
107
|
-
try:
|
|
108
|
-
services = ["services/test/service.json"]
|
|
109
|
-
save_snapshot(services)
|
|
110
|
-
|
|
111
|
-
assert Path(".tdk/.tdk-out/snapshots").exists(), ".tdk/.tdk-out/snapshots directory should be created"
|
|
112
|
-
assert Path(".tdk/.tdk-out/snapshots").is_dir(), ".tdk/.tdk-out/snapshots should be a directory"
|
|
113
|
-
finally:
|
|
114
|
-
os.chdir(original_dir)
|
|
115
|
-
|
|
116
|
-
def test_loading_invalid_json_returns_empty(self, temp_dir):
|
|
117
|
-
"""Test that loading invalid JSON returns empty snapshot."""
|
|
118
|
-
import sys
|
|
119
|
-
sys.path.insert(0, str(Path("discovery").resolve()))
|
|
120
|
-
from resource_snapshot import load_snapshot
|
|
121
|
-
|
|
122
|
-
original_dir = os.getcwd()
|
|
123
|
-
os.chdir(temp_dir)
|
|
124
|
-
|
|
125
|
-
try:
|
|
126
|
-
# Create invalid JSON file
|
|
127
|
-
Path(".tilt").mkdir(parents=True, exist_ok=True)
|
|
128
|
-
with open(".tilt/resource-snapshot.json", "w") as f:
|
|
129
|
-
f.write("not valid json {{{")
|
|
130
|
-
|
|
131
|
-
snapshot = load_snapshot()
|
|
132
|
-
|
|
133
|
-
assert snapshot["count"] == 0
|
|
134
|
-
assert snapshot["services"] == []
|
|
135
|
-
finally:
|
|
136
|
-
os.chdir(original_dir)
|
|
137
|
-
|
|
138
|
-
def test_snapshot_includes_hashes(self, temp_dir):
|
|
139
|
-
"""Test that saved snapshot includes content hashes."""
|
|
140
|
-
import sys
|
|
141
|
-
sys.path.insert(0, str(Path("discovery").resolve()))
|
|
142
|
-
from resource_snapshot import save_snapshot
|
|
143
|
-
|
|
144
|
-
# Create a service file to hash
|
|
145
|
-
resource_dir = temp_dir / "services" / "test"
|
|
146
|
-
resource_dir.mkdir(parents=True)
|
|
147
|
-
(resource_dir / "service.json").write_text('{"name": "test"}')
|
|
148
|
-
|
|
149
|
-
original_dir = os.getcwd()
|
|
150
|
-
os.chdir(temp_dir)
|
|
151
|
-
|
|
152
|
-
try:
|
|
153
|
-
services = ["services/test/service.json"]
|
|
154
|
-
save_snapshot(services, include_hashes=True)
|
|
155
|
-
|
|
156
|
-
with open(".tdk/.tdk-out/snapshots/resource-snapshot.json") as f:
|
|
157
|
-
data = json.load(f)
|
|
158
|
-
|
|
159
|
-
assert "resource_hashes" in data
|
|
160
|
-
assert "services/test/service.json" in data["resource_hashes"]
|
|
161
|
-
assert len(data["resource_hashes"]["services/test/service.json"]) == 16
|
|
162
|
-
finally:
|
|
163
|
-
os.chdir(original_dir)
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Tests for resource snapshot scanning functionality.
|
|
3
|
-
Tests the filesystem scanning and service.json discovery.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
import json
|
|
7
|
-
import os
|
|
8
|
-
import pytest
|
|
9
|
-
from pathlib import Path
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@pytest.mark.snapshot
|
|
13
|
-
class TestSnapshotScanning:
|
|
14
|
-
"""Tests for filesystem scanning functionality."""
|
|
15
|
-
|
|
16
|
-
def test_scanning_finds_valid_resource_files(self, temp_dir, monkeypatch):
|
|
17
|
-
"""
|
|
18
|
-
Scenario: Scanning finds valid resource files
|
|
19
|
-
WHEN the scanner runs against a directory containing 3 valid service.json files
|
|
20
|
-
THEN it SHALL return a list of 3 resources with correct paths and parsed metadata
|
|
21
|
-
"""
|
|
22
|
-
# Create test directory structure with 3 resources
|
|
23
|
-
resources = [
|
|
24
|
-
("services/product/identity/identity-backend", "identity-backend"),
|
|
25
|
-
("services/product/identity/identity-frontend", "identity-frontend"),
|
|
26
|
-
("services/product/order/order-backend", "order-backend"),
|
|
27
|
-
]
|
|
28
|
-
|
|
29
|
-
for resource_path, resource_name in resources:
|
|
30
|
-
resource_dir = temp_dir / resource_path
|
|
31
|
-
resource_dir.mkdir(parents=True)
|
|
32
|
-
resource_file = resource_dir / "service.json"
|
|
33
|
-
resource_file.write_text(json.dumps({
|
|
34
|
-
"name": resource_name,
|
|
35
|
-
"type": "backend" if "backend" in resource_name else "frontend",
|
|
36
|
-
"stack": resource_path.split("/")[2],
|
|
37
|
-
"port": 4001 if "backend" in resource_name else 3001
|
|
38
|
-
}))
|
|
39
|
-
|
|
40
|
-
# Import and test
|
|
41
|
-
import sys
|
|
42
|
-
sys.path.insert(0, str(Path("discovery").resolve()))
|
|
43
|
-
from resource_snapshot import get_current_resources
|
|
44
|
-
|
|
45
|
-
# Change to temp directory for scanning
|
|
46
|
-
original_dir = os.getcwd()
|
|
47
|
-
os.chdir(temp_dir)
|
|
48
|
-
|
|
49
|
-
try:
|
|
50
|
-
found_resources = get_current_resources("services/product")
|
|
51
|
-
|
|
52
|
-
assert len(found_resources) == 3, f"Expected 3 resources, found {len(found_resources)}"
|
|
53
|
-
assert all("service.json" in r for r in found_resources), "All resources should be service.json files"
|
|
54
|
-
finally:
|
|
55
|
-
os.chdir(original_dir)
|
|
56
|
-
|
|
57
|
-
def test_scanning_ignores_non_resource_files(self, temp_dir, monkeypatch):
|
|
58
|
-
"""
|
|
59
|
-
Scenario: Scanning ignores non-resource files
|
|
60
|
-
WHEN the scanner runs against a directory containing service.json and package.json and README.md
|
|
61
|
-
THEN it SHALL only return the resource defined in service.json
|
|
62
|
-
"""
|
|
63
|
-
# Create directory with mixed files
|
|
64
|
-
resource_dir = temp_dir / "services" / "product" / "test"
|
|
65
|
-
resource_dir.mkdir(parents=True)
|
|
66
|
-
|
|
67
|
-
# Create service.json
|
|
68
|
-
(resource_dir / "service.json").write_text(json.dumps({"name": "test-resource"}))
|
|
69
|
-
# Create non-resource files
|
|
70
|
-
(resource_dir / "package.json").write_text('{"name": "test"}')
|
|
71
|
-
(resource_dir / "README.md").write_text("# Test Resource")
|
|
72
|
-
(resource_dir / "config.ts").write_text("export const config = {};")
|
|
73
|
-
|
|
74
|
-
import sys
|
|
75
|
-
sys.path.insert(0, str(Path("discovery").resolve()))
|
|
76
|
-
from resource_snapshot import get_current_resources
|
|
77
|
-
|
|
78
|
-
original_dir = os.getcwd()
|
|
79
|
-
os.chdir(temp_dir)
|
|
80
|
-
|
|
81
|
-
try:
|
|
82
|
-
found_resources = get_current_resources("services/product")
|
|
83
|
-
|
|
84
|
-
assert len(found_resources) == 1, f"Expected 1 resource, found {len(found_resources)}"
|
|
85
|
-
assert "service.json" in found_resources[0], "Should only find service.json files"
|
|
86
|
-
assert "package.json" not in found_resources[0], "Should not include package.json"
|
|
87
|
-
finally:
|
|
88
|
-
os.chdir(original_dir)
|
|
89
|
-
|
|
90
|
-
def test_scanning_handles_nested_directories(self, temp_dir, monkeypatch):
|
|
91
|
-
"""
|
|
92
|
-
Scenario: Scanning handles nested directories
|
|
93
|
-
WHEN the scanner runs against a directory with nested resources/ subdirectory containing service.json
|
|
94
|
-
THEN it SHALL find resources at any depth and return correct relative paths
|
|
95
|
-
"""
|
|
96
|
-
# Create deeply nested structure
|
|
97
|
-
nested_dirs = [
|
|
98
|
-
"services/product/stack1/backend/service.json",
|
|
99
|
-
"services/product/stack1/frontend/service.json",
|
|
100
|
-
"services/product/stack2/substack/backend/service.json",
|
|
101
|
-
]
|
|
102
|
-
|
|
103
|
-
for path in nested_dirs:
|
|
104
|
-
full_path = temp_dir / path
|
|
105
|
-
full_path.parent.mkdir(parents=True, exist_ok=True)
|
|
106
|
-
full_path.write_text(json.dumps({"name": "test"}))
|
|
107
|
-
|
|
108
|
-
import sys
|
|
109
|
-
sys.path.insert(0, str(Path("discovery").resolve()))
|
|
110
|
-
from resource_snapshot import get_current_resources
|
|
111
|
-
|
|
112
|
-
original_dir = os.getcwd()
|
|
113
|
-
os.chdir(temp_dir)
|
|
114
|
-
|
|
115
|
-
try:
|
|
116
|
-
found_resources = get_current_resources("services/product")
|
|
117
|
-
|
|
118
|
-
assert len(found_resources) == 3, f"Expected 3 resources, found {len(found_resources)}"
|
|
119
|
-
# Verify all paths are relative and contain the full path
|
|
120
|
-
assert all("stack1" in r or "stack2" in r for r in found_resources)
|
|
121
|
-
assert all("service.json" in r for r in found_resources)
|
|
122
|
-
finally:
|
|
123
|
-
os.chdir(original_dir)
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"""Regression tests for standalone generated-project boot.
|
|
2
|
-
|
|
3
|
-
Standalone TDK projects do not ship Traefik/Verdaccio compose files. The
|
|
4
|
-
Tiltfile still has to load the project-root .env and publish host ports so
|
|
5
|
-
the generated API is reachable at localhost:<port>.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
|
|
10
|
-
import pytest
|
|
11
|
-
|
|
12
|
-
pytestmark = [pytest.mark.fast, pytest.mark.generator]
|
|
13
|
-
|
|
14
|
-
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def test_load_dotenv_uses_tdk_project_root():
|
|
18
|
-
source = (
|
|
19
|
-
REPO_ROOT
|
|
20
|
-
/ "engine"
|
|
21
|
-
/ "topologies"
|
|
22
|
-
/ "tilt"
|
|
23
|
-
/ "common"
|
|
24
|
-
/ "utils_env.star"
|
|
25
|
-
).read_text()
|
|
26
|
-
assert "TDK_PROJECT_ROOT" in source
|
|
27
|
-
assert "if not project_root:" in source
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def test_tiltfile_template_passes_project_root_to_load_dotenv():
|
|
31
|
-
source = (REPO_ROOT / "cli" / "templates" / "Tiltfile.hbs").read_text()
|
|
32
|
-
assert "Utils.load_dotenv(PROJECT_ROOT)" in source
|
|
33
|
-
assert "Utils.load_dotenv()" not in source
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def test_compose_registration_applies_port_override_when_present():
|
|
37
|
-
source = (
|
|
38
|
-
REPO_ROOT
|
|
39
|
-
/ "engine"
|
|
40
|
-
/ "topologies"
|
|
41
|
-
/ "tilt"
|
|
42
|
-
/ "resources"
|
|
43
|
-
/ "orchestrator"
|
|
44
|
-
/ "apply_compose_resource_registration.star"
|
|
45
|
-
).read_text()
|
|
46
|
-
assert "docker-compose.port-override.yml" in source
|
|
47
|
-
assert "Applying port override" in source
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def test_verdaccio_dependency_requires_compose_file():
|
|
51
|
-
source = (
|
|
52
|
-
REPO_ROOT
|
|
53
|
-
/ "engine"
|
|
54
|
-
/ "topologies"
|
|
55
|
-
/ "tilt"
|
|
56
|
-
/ "resources"
|
|
57
|
-
/ "orchestrator"
|
|
58
|
-
/ "apply_compose_resource_registration.star"
|
|
59
|
-
).read_text()
|
|
60
|
-
assert "docker-compose.verdaccio.yml" in source
|
|
61
|
-
assert "infra_deps.append(PlatformDockerConstants.VERDACCIO_RESOURCE_NAME)" in source
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"""Standalone TDK projects must serve api.{project}.localhost via Traefik."""
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
import shutil
|
|
5
|
-
import subprocess
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
|
|
8
|
-
import pytest
|
|
9
|
-
|
|
10
|
-
pytestmark = [pytest.mark.fast, pytest.mark.generator]
|
|
11
|
-
|
|
12
|
-
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
13
|
-
COMPOSE_DIR = REPO_ROOT / "engine" / "topologies" / "platform" / "docker" / "compose"
|
|
14
|
-
RESULT_MARKER = "Error in fail: RESULT"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def _run_starlark(tmp_path: Path, body: str) -> dict:
|
|
18
|
-
tiltfile = tmp_path / "Tiltfile"
|
|
19
|
-
tiltfile.write_text(body.replace("@COMPOSE", str(COMPOSE_DIR)) + "\nfail('RESULT' + encode_json(r))\n")
|
|
20
|
-
proc = subprocess.run(
|
|
21
|
-
["tilt", "alpha", "tiltfile-result", "-f", str(tiltfile)],
|
|
22
|
-
capture_output=True,
|
|
23
|
-
text=True,
|
|
24
|
-
timeout=180,
|
|
25
|
-
)
|
|
26
|
-
output = proc.stdout + proc.stderr
|
|
27
|
-
assert RESULT_MARKER in output, output[-3000:]
|
|
28
|
-
return json.loads(output.split(RESULT_MARKER, 1)[1].strip())
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def test_standalone_traefik_compose_generator_exists():
|
|
32
|
-
source = (
|
|
33
|
-
REPO_ROOT
|
|
34
|
-
/ "engine"
|
|
35
|
-
/ "topologies"
|
|
36
|
-
/ "platform"
|
|
37
|
-
/ "docker"
|
|
38
|
-
/ "compose"
|
|
39
|
-
/ "traefik_standalone.star"
|
|
40
|
-
).read_text()
|
|
41
|
-
assert "generate_standalone_traefik_compose" in source
|
|
42
|
-
assert "entrypoints.web.address=:80" in source
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def test_infra_loader_falls_back_to_standalone_traefik():
|
|
46
|
-
source = (
|
|
47
|
-
REPO_ROOT
|
|
48
|
-
/ "engine"
|
|
49
|
-
/ "topologies"
|
|
50
|
-
/ "tilt"
|
|
51
|
-
/ "resources"
|
|
52
|
-
/ "infra-loader.star"
|
|
53
|
-
).read_text()
|
|
54
|
-
assert "_load_standalone_traefik" in source
|
|
55
|
-
assert "using standalone Traefik" in source
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def test_project_router_uses_cli_api_path():
|
|
59
|
-
source = (
|
|
60
|
-
REPO_ROOT
|
|
61
|
-
/ "engine"
|
|
62
|
-
/ "topologies"
|
|
63
|
-
/ "platform"
|
|
64
|
-
/ "docker"
|
|
65
|
-
/ "networking"
|
|
66
|
-
/ "traefik_helpers.star"
|
|
67
|
-
).read_text()
|
|
68
|
-
assert "def cli_api_path(" in source
|
|
69
|
-
assert "tdk up" in source
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def test_tiltfile_keeps_traefik_in_focus_mode():
|
|
73
|
-
source = (REPO_ROOT / "cli" / "templates" / "Tiltfile.hbs").read_text()
|
|
74
|
-
assert "'traefik'" in source
|
|
75
|
-
assert "init-networks" in source
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
def _infra_loader_source() -> str:
|
|
79
|
-
return (
|
|
80
|
-
REPO_ROOT
|
|
81
|
-
/ "engine"
|
|
82
|
-
/ "topologies"
|
|
83
|
-
/ "tilt"
|
|
84
|
-
/ "resources"
|
|
85
|
-
/ "infra-loader.star"
|
|
86
|
-
).read_text()
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
def test_standalone_traefik_stops_conflicting_container_before_compose_up():
|
|
90
|
-
"""Two standalone TDK projects both generate Traefik with hardcoded host
|
|
91
|
-
ports 80/8080 (so api.{project}.localhost works without a port suffix), so
|
|
92
|
-
only one can bind port 80 at a time. `tdk up` on a new project must take
|
|
93
|
-
over the port from a stale Traefik left running by a previous project
|
|
94
|
-
rather than letting `docker compose up` die deep inside Tilt with a
|
|
95
|
-
cryptic "port is already allocated" networking error.
|
|
96
|
-
"""
|
|
97
|
-
source = _infra_loader_source()
|
|
98
|
-
assert "_stop_conflicting_traefik" in source
|
|
99
|
-
|
|
100
|
-
# The takeover must run before docker_compose() is invoked for the
|
|
101
|
-
# standalone Traefik compose, not after. Search from the function body
|
|
102
|
-
# (not its definition line, which also contains the substring
|
|
103
|
-
# "..._traefik()").
|
|
104
|
-
load_standalone_def = source.index("def _load_standalone_traefik(")
|
|
105
|
-
stop_call = source.index("_stop_conflicting_traefik()", load_standalone_def)
|
|
106
|
-
docker_compose_call = source.index("_docker_compose(compose_file, env_file)", load_standalone_def)
|
|
107
|
-
assert load_standalone_def < stop_call < docker_compose_call
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
def test_traefik_conflict_takeover_stops_other_project_and_logs_it():
|
|
111
|
-
source = _infra_loader_source()
|
|
112
|
-
stop_start = source.index("def _stop_conflicting_traefik():")
|
|
113
|
-
stop_body = source[stop_start:source.index("def _load_standalone_traefik(")]
|
|
114
|
-
|
|
115
|
-
# Detects other containers publishing the ports this project's Traefik needs.
|
|
116
|
-
assert "docker ps" in stop_body
|
|
117
|
-
assert "publish=80" in stop_body
|
|
118
|
-
assert "publish=8080" in stop_body
|
|
119
|
-
|
|
120
|
-
# Must not stop this project's own (already-running) Traefik.
|
|
121
|
-
assert "PlatformDockerConstants.PROJECT_NAME" in stop_body
|
|
122
|
-
assert "own_container" in stop_body
|
|
123
|
-
|
|
124
|
-
# Actually stops the other project's container and logs what was stopped,
|
|
125
|
-
# instead of just erroring out.
|
|
126
|
-
assert "docker stop" in stop_body
|
|
127
|
-
assert "print(" in stop_body
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
@pytest.mark.skipif(shutil.which("tilt") is None, reason="tilt CLI not installed")
|
|
131
|
-
def test_standalone_compose_enables_file_provider_and_wake_gateway(tmp_path):
|
|
132
|
-
"""openspec/changes/prioritized-cold-start (D4): a `sablier.deferStart`
|
|
133
|
-
resource's static route needs Traefik's file provider enabled and a wake
|
|
134
|
-
gateway running, even in a landscape with no such resource yet (harmless:
|
|
135
|
-
an empty dynamic directory yields zero extra routes)."""
|
|
136
|
-
r = _run_starlark(
|
|
137
|
-
tmp_path,
|
|
138
|
-
"load('@COMPOSE/traefik_standalone.star', 'generate_standalone_traefik_compose')\n"
|
|
139
|
-
"r = {'yaml': generate_standalone_traefik_compose()}\n",
|
|
140
|
-
)
|
|
141
|
-
yaml_text = r["yaml"]
|
|
142
|
-
assert "--providers.file.directory=/etc/traefik/dynamic" in yaml_text
|
|
143
|
-
assert "--providers.file.watch=true" in yaml_text
|
|
144
|
-
assert "/etc/traefik/dynamic:ro" in yaml_text
|
|
145
|
-
assert "wake-gateway:" in yaml_text
|
|
146
|
-
assert "/root/.tilt-dev:ro" in yaml_text
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
@pytest.mark.skipif(shutil.which("tilt") is None, reason="tilt CLI not installed")
|
|
150
|
-
def test_wake_gateway_mounts_project_root_at_its_own_absolute_path(tmp_path):
|
|
151
|
-
"""The gateway runs `docker compose up --no-build` with the same compose
|
|
152
|
-
files Tilt uses; relative paths inside them resolve client-side, so the
|
|
153
|
-
project must exist at the same absolute path in the gateway container."""
|
|
154
|
-
r = _run_starlark(
|
|
155
|
-
tmp_path,
|
|
156
|
-
"os.environ['TDK_PROJECT_ROOT'] = '/Users/dev/tdk-erp-system/.tdk/.tdk-out/../..'\n"
|
|
157
|
-
"load('@COMPOSE/traefik_standalone.star', 'generate_standalone_traefik_compose')\n"
|
|
158
|
-
"r = {'yaml': generate_standalone_traefik_compose()}\n",
|
|
159
|
-
)
|
|
160
|
-
assert "- /Users/dev/tdk-erp-system:/Users/dev/tdk-erp-system:ro" in r["yaml"]
|