fix: enable the hub environments feature flag in the test harness - #571
hilalbursalii wants to merge 1 commit into
Conversation
HubV2EnvironmentController is gated on public-api-v2 AND workspaces AND environments, and hub's application-common.yml defaults environments-enabled to false with no Self-Managed override. The harness enabled the first two but not the third, so the whole /api/v2 environments surface fell through to the default error handler — an unmatched-route 404 (timestamp/status/error/path) rather than hub's ProblemDetail shape, on GET /environments which takes no path parameter at all. Hub is behaving as designed here: camunda-hub#28601 ships FlagOffIT coverage for exactly this state. The generator emits tests from the spec, which declares the paths unconditionally, so the harness has to opt in. Note the env-var spelling: this flag binds to CAMUNDA_MODELER_FEATURE_ENVIRONMENTS_ENABLED, not the bare FEATURE_ form that workspaces and catalog use; the wrong name leaves the flag silently off. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Heads-up: this change has effectively landed via #577 (merged as bbff68b), which set the same flag on the same lines of One difference worth recording before it closes, since your description makes a claim about it. #577 used
So the only practical difference is that Not closing this myself — that's yours to do. Generated by Claude Code |
Third in the camunda-hub#28600/#28601 series, but a different mechanism from #567 and #570.
Problem
Run 34576767973 (hub PR check for camunda-hub#28601, expose environments in public API v2) failed 13 tests across all three suites — every one of them a new environments endpoint:
getEnvironments,getProjectEnvironments,getWorkspaceEnvironments,replaceWorkspaceEnvironments— expected 200, got 404replaceWorkspaceEnvironments— expected 400, got 404getEnvironments - Denied (no permission)— expected 403, got 404The 404 body is the tell, and it is not the same 404 as the catalog ones #567/#570 dealt with:
{"timestamp":1789113618009,"status":404,"error":"Not Found","path":"/api/v2/environments"}Spring's default error attributes, not hub's RFC-7807 ProblemDetail (
type/title/instance) — so no handler matched, the route is absent.GET /api/v2/environmentstakes no path parameter at all, which rules out any fixture/key cause.HubV2EnvironmentControlleris triple-gated:and hub declares the third defaulting to off, with no Self-Managed override:
Our harness enabled public-api-v2, workspaces, catalog, console, global-nav and dynamic clusters — never environments.
No hub bug. Flag-off is a deliberate, tested state: #28601 ships
AbstractHubV2EnvironmentFlagOffIT,SaasHubV2EnvironmentFlagOffITandSelfManagedHubV2EnvironmentFlagOffIT. The generator emits tests from the spec, which declares the paths unconditionally, so the harness has to opt in — the same shape as the comment already in this block: "the public API v2 is OFF by default in the image, so /api/v2 returns 404 until enabled."Change
One flag in
docker/docker-compose.hub.yml, plus a note on a footgun worth documenting: the two env-var spellings in this block are not interchangeable. Each flag is only readable under the nameapplication-common.ymlbinds it to — workspaces and catalog use the bareFEATURE_X_ENABLED, while public-api-v2, console and environments useCAMUNDA_MODELER_FEATURE_X_ENABLED. The wrong spelling leaves the flag silently off, which looks identical to this failure.Verification status — why this is a draft
The environments ops cannot be verified yet, and I would rather say so than imply otherwise:
main, where #28601 is not merged — the endpoints are neither in the bundled spec nor in the image, so the flag is a no-op and the check only proves no regression.camunda/hub:SNAPSHOTimage, which does not contain the controller code at all while #28601 is open. Pointinghub_refat the PR branch would put the paths in the spec but not the controller in the image, producing the same 404 for a different reason.repository_dispatchalways runs the workflow from the default branch.One case may still fail after the flag is on, for a genuinely different reason:
replaceWorkspaceEnvironments(PUT, expects 200) sends generatedenvironmentIds. If the SM service validates that those ids exist, it may then 400/404 and need a real environment fixture — the sameresourceFixturestreatment #570 gaveassetKey. The three GETs should be fine (SM environments come from a persisted inventory with a constant organization, so an empty list still satisfies 200 + schema), and the 8 secured cases don't depend on it — their envelope only needs the already-fixturedworkspaceKey, which the failing URLs show was real.Testing
docker compose -f docker/docker-compose.hub.yml config -qclean; parsed the file back to confirm the flag lands asCAMUNDA_MODELER_FEATURE_ENVIRONMENTS_ENABLED=true.🤖 Generated with Claude Code