Add backend CD entry point to api-smoke (deployed-SHA + min_passed guards) - #16
Merged
Conversation
… guards) Adds workflow_call.inputs (api_base_url, deployed_sha, min_passed) to the api-smoke job, additive alongside its existing secrets-based interface -- DataSpaceFrontend's current call is untouched. Also fixes a real, pre-existing vacuous-green bug found while wiring this up: api-smoke never set API_BASE_URL, so every run of it has been silently all-skipping (api_base_url fixture calls pytest.skip() when unset) -- 0 failures, exit 0, green, regardless of backend health. The new min_passed guard (default 1) catches this class of failure even where a caller forgets to pass api_base_url. New test_health_check_deployed_sha_matches asserts /health/'s git_sha against EXPECTED_DEPLOYED_SHA when set -- proves the live code is the code that was just pushed, not just that a container answered.
3 tasks
The guard fired unconditionally, including on this repo's own direct push/PR/dispatch runs to CI -- which have never had a live backend to test against (API_BASE_URL has never been set for those triggers), so api-smoke legitimately all-skips there. Only enforce it when a caller actually supplied api_base_url, which is exactly the case it exists to catch.
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
Wiring needed for DataSpaceBackend's new ECS deploy pipeline to call
api-smokeas its post-deploy gate (mirrors theParakhAI_testbackend-smoke pattern). Additive —DataSpaceFrontend's existing call to this workflow is untouched.run-smoke.yml: addedworkflow_call.inputsforapi_base_url,deployed_sha,min_passedon theapi-smokejob.api_base_urlmaps toAPI_BASE_URL;deployed_shamaps toEXPECTED_DEPLOYED_SHA.test_health_check_deployed_sha_matchesintest_api_001_health.py: asserts/health/'sgit_shafield matchesEXPECTED_DEPLOYED_SHAwhen set (skips, not silently passes, when unset — e.g. ad-hoc runs with no specific commit to check). Accepts either 200 or 503 from/health/, since a deploy can be running the right code while still reporting a dependency as unhealthy — that's a separate concern from the existingtest_health_check_returns_200.min_passedguard step after the pytest run, parsingreport.json.Real bug found and fixed while wiring this up:
api-smokehas never setAPI_BASE_URLanywhere — onlyHOME_URL_DEV/TEST_EMAIL_1/TEST_PASSWORD_1.api_base_url()'s fixture callspytest.skip()when that var is unset, so every run of this job has been silently all-skipping since it was added — 0 failures, exit 0, green, regardless of whether the backend is actually reachable. The newmin_passedguard (default 1) means a fully-skipped run now fails loudly instead of looking identical to a passing one, and DataSpaceBackend's caller will be the first to actually populateAPI_BASE_URL.Test plan
python -m py_compileclean on the modified test fileactionlintclean on every line this PR touches (pre-existingSC2086findings on theconsumer-smoke/provider-smokesanity-check steps are untouched, identical before/after)gh secret listthatAPI_BASE_URLdoesn't exist as a repo secret today, and tracedapi_base_url()->pytest.skip()intests/api/conftest.pyto confirm the silent-skip mechanism