Repository navigation
fix: reject a Helm location with no chart name at load time (closes #620) - #630
Conversation
Deploying styrmin with
|
| Latest commit: |
ab73980
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://36ed92a1.styrmin.pages.dev |
| Branch Preview URL: | https://ai-bug-pipeline-620-helm-loc.styrmin.pages.dev |
|
AGENT_REVIEW_VERDICT: TEST_APPROVED Verdict: TEST_APPROVEDCI signal
Realism
Correctness
Quality
AlignmentDirectly targets the analyst's root cause ( No blocking issues found. AGENT_REVIEW_ITERATION: test-1
Add this agentic workflow to your repoTo install this agentic workflow, run |
… time (closes #620) HelmSettings.location was a bare str with no validation, so a location with no scheme or no chart-name path segment (e.g. a bare repository root) was accepted at driver-load time and only produced an invalid Kubernetes HelmRepository much later, at deploy time. Add a field validator on HelmSettings.location that requires an absolute http/https/oci URL with a non-empty chart-name path segment, raising at load time instead. Fix fixture/test data across python_sdk and backend unit tests that relied on the previously unvalidated field (bare names like "simple-app" or "oci://example" with no path). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Commit pushed:
|
|
AGENT_REVIEW_VERDICT: FIX_CHANGES_REQUESTED Verdict: FIX_CHANGES_REQUESTEDCI signal
CorrectnessSolves the analyst's root cause directly:
The "unplanned but necessary scope" fixture rewrites check out: I traced every e2e fixture driver with a bare Code qualityNo unrelated refactor; the helper mirrors the existing Documentation alignment — blocking
This is exactly the case AGENTS.md calls non-negotiable: "Any update that touches user-visible behaviour (... driver format ...) MUST update the corresponding pages under Test integrityThe replication test ( Action required: update AGENT_REVIEW_ITERATION: fix-1
Add this agentic workflow to your repoTo install this agentic workflow, run |
Analyst's findings (summary)
Replication test
Test file:
python_sdk/tests/driver_format/test_check_errors.pyTest name:
test_a_location_with_no_chart_name_is_an_errorWhat it tests: Running
styrmin-driver checkagainst a driver whosespec.helm.main.locationis(registry.opsmill.io/redacted) (a scheme + host with no chart-name path segment, mirroring the issue's reproduction) should fail the load with aspec.helm.main.location` validation error — it currently passes silently instead.Local run (evidence)
Expected CI signal: the
Python SDK Unit Testscheck should FAIL on this PR, for this reason:checkreports0 errors, 1 warningand exits0for a driver whosehelm.main.locationhas no chart name, instead of rejecting it at load time as the analyst's root cause requires.Test expectations
Asserts that
styrmin-driver checkon a driver withspec.helm.main.location: (registry.opsmill.io/redacted) (scheme + host, no chart-name path segment — the same shape as the issue's(chartrepo.chartregistry.svc.cluster.local/redacted) reproduction) exits with code1and reports aspec.helm.main.locationerror anchored to thelocation:line ofdriver.styrmin.yml, following the same per-field error format the CLI already uses for other invalid fields (e.g.spec.info.license,spec.info.authors).Edge cases called out by the analyst but intentionally left to the fixer/reviewer to add separate coverage for (not asserted by this test): a trailing-slash-only path (`(host/redacted) and the unsupported-scheme case.
AGENT_TEST_COMPLETEAdd this agentic workflow to your repo
To install this agentic workflow, run
<!-- This is an auto-generated description by cubic. -->
<a href="(cubic.dev/redacted) target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="(www.cubic.dev/redacted)<source media="(prefers-color-scheme: light)" srcset="(www.cubic.dev/redacted)<img alt="View guided diff" src="(www.cubic.dev/redacted)</picture></a> <a href="(www.cubic.dev/redacted) target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="(www.cubic.dev/redacted)<source media="(prefers-color-scheme: light)" srcset="(www.cubic.dev/redacted)<img alt="Turn on auto-fix" src="(www.cubic.dev/redacted)</picture></a>
<!-- End of auto-generated description by cubic. -->
Fix strategy
Followed the analyst's strategy as written. Added a
field_validatoronHelmSettings.location(python_sdk/src/styrmin_sdk/driver_format/models/resources/driver.py) that hard-fails the load when:http,https, oroci, orhost/trailing-slash-only edge case the analyst flagged.This is a hard
ValueError(not a soft warning likeInfo.icon/InfoLink.url), per the analyst's reasoning: a chart with no resolvable location already fails deployment unconditionally, just late.naming.pyandapplications.pyare unchanged, as recommended — they can now assume a well-formed<scheme>://<host>/.../<chart>because the model guarantees it._url_problem(built onHttpUrl) could not be reused becauseHttpUrlrejects theocischeme thatlocationmust support, so I added a sibling helper (_chart_location_problem) built onAnyUrl, following the same "problem string or None" shape.Unplanned but necessary scope: the shared
driver/examples/simple-appanddriver/examples/db-testfixtures (used by ~20 python_sdk/backend unit tests, plus e2e) themselves hadlocation: simple-app/location: db-test— a bare name with no scheme and no chart name, i.e. an even more extreme instance of the bug this PR fixes. Once real validation exists, those fixtures fail to load. I updated both to a well-formed(redacted) location (e2e tests already rewritelocationto a real chart-server URL before any deployment, viapreparedriverinbackend/tests/e2e/conftest.py, so this doesn't affect deployment behavior there). I made the equivalent fix to 2 e2e "broken driver" fixtures that are copied verbatim without that rewrite (backend/tests/e2e/fixtures/drivers/broken/{missing-action,retired-filter}/driver.styrmin.yml), and to 6 backend unit test files that inlined an equally invalid literal location ("./src/helm","test-chart","(example/redacted) as throwaway fixture data unrelated to what each test actually exercises. None of these are the replication test itself (python_sdk/tests/driver_format/test_check_errors.pyis untouched — verified viagit diff).I also fixed a message-duplication bug I introduced during development: my validator's message originally repeated
(found {value!r}), which doubled up with the generic Pydantic-error formatter's own(found ...)suffix (python_sdk/src/styrmin_sdk/driver_format/reading/deserializers.py::validation_error_fields). Removed the duplicate from my message.Local run (evidence)
Replication test, before the fix (confirms it starts red):
After the fix:
uv run invoke format lintpasses clean (ruff, ty, GraphQL schema/codegen validation — no GraphQL surface changed in this PR).Not run locally:
backend/tests/unitas a whole includes Docker/testcontainers-backed tests (postgresqlfixture) that require a Docker daemon unavailable in this sandbox (15 unrelatedConnectionRefusedErrorerrors, pre-existing environment limitation, not caused by this change). One unrelated pre-existing failure also observed and left alone:backend/tests/unit/services/telemetry/test_sender.py::test_send_report_returns_false_when_the_host_name_does_not_resolve(DNS-mocking test, no relation to driver/helm code).AGENT_FIX_COMPLETEWarning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
telemetry.invalidTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run