Adopt environment deployment coverage into gcp-apigee-proxy-health (from #729) - #766
Open
Rohit-Ekbote wants to merge 1 commit into
Open
Adopt environment deployment coverage into gcp-apigee-proxy-health (from #729)#766Rohit-Ekbote wants to merge 1 commit into
Rohit-Ekbote wants to merge 1 commit into
Conversation
PR #729 is an independent generation of this bundle (registry issue #159). Of its six runbook tasks, exactly one reaches a finding nothing here could: environments hosting zero deployed API proxies. That is the environment axis of the inventory every other check reads from the proxy axis. check_failed_deployments asks "is this proxy deployed anywhere?" -- an org whose proxies are all deployed to prod answers yes for every proxy while an empty test environment sits serving nothing, and a hostname routed there returns an edge-level error rather than a proxy response. The new partialcoverage fixture is exactly that case, and asserts the coverage issue is raised AND that every proxy-side check stays silent. Deliberately counts deployments, not HEALTHY deployments. Gating on state == "READY" would make every environment look empty the moment the deployment status view became unreadable, and would re-report in this check what check_deployment_state already owns. Asserted from both sides: statusunknown and broken must both report zero coverage issues. Two correctness guards #729 does not have. A PROXIES filter removes deployments from the inventory, so an environment hosting only filtered-out proxies would look empty -- a finding manufactured by configuration; the check refuses to judge and says why. An ENVIRONMENTS filter is the opposite case: the topology records every environment unfiltered while deployments ARE filtered, so the environment list is narrowed to what the run actually looked at. Not adopted, with reasons recorded in the README: - Discovery as a task: it is suite setup here, deliberately. - Proxy deployment health, revision/approval state: already covered. - Health summary: raises no finding a per-condition check does not. - Runtime environment status: its Cloud Monitoring filter uses resource.labels.environment_name, which does not exist -- the Environment monitored resource has resource_container/org/env/location, so the query matches nothing and the check silently reports nothing. It also misreads environment/active (a GAUGE counting environments attached to an instance, not a per-environment liveness flag) and sums that gauge over the window. Read correctly it measures environment-to-instance attachment, which gcp-apigee-environment-health already checks directly through the Apigee API. Verified against the live metric and monitored-resource descriptors. - STALE_REVISION_THRESHOLD: #729 defaults it to 1, so a proxy one revision behind is never flagged. Adopting that would weaken the drift check. Offline tier 262 -> 301 assertions. 25 mutations, all detected against a green baseline, including four new ones: coverage silenced, coverage narrowed to READY-only, and each of the two scope-filter guards removed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NLcdGCtY4qZH8tW5MKDEvi
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.
Follow-up to #748 (merged). PR #729 is an independent generation of this same
bundle (registry issue #159); its six runbook tasks were reviewed against the
merged implementation and one carried a finding nothing here could reach.
Adopted: Check Apigee Environment Deployment Coverage
Flags environments hosting zero deployed API proxies — the environment axis
of the same inventory every other check reads from the proxy axis.
check_failed_deploymentsasks "is this proxy deployed anywhere?", so an orgwhose proxies all live in
prodanswers yes for every proxy while an emptytestsits serving nothing. A hostname routed there via an environment groupreturns an edge-level error rather than a proxy response.
The new
partialcoveragefixture is exactly that case, and asserts both thatcoverage fires and that every proxy-side check stays silent.
Two correctness guards #729 does not have, because a scope filter can otherwise
manufacture the finding:
PROXIESfilter removes deployments from the inventory, so an environmenthosting only filtered-out proxies would look empty — the check refuses to
judge and says why in the report;
ENVIRONMENTSfilter is the opposite case: the topology records everyenvironment unfiltered while deployments are filtered, so the environment
list is narrowed to what the run actually looked at.
It counts deployments, not healthy deployments. Gating on
state == "READY"would make every environment look empty the moment the deployment status view
became unreadable, and would re-report what
check_deployment_stateowns.Asserted from both sides via the
statusunknownandbrokenfixtures.Not adopted, and why
Runtime Environment Status — verified broken, and in the wrong bundle
It queries Cloud Monitoring for
apigee.googleapis.com/environment/active. Themetric is real, but the check misreads it three ways — all verified against the
live metric and monitored-resource descriptors:
resource.labels.environment_name. Theapigee.googleapis.com/Environmentmonitored resource has
resource_container,org,env,location— nosuch label. The query returns no time series, so the check reads zero data
points and silently reports nothing, always.
environment/activeis a GAUGE whose documenteddescription is "Number of current environments attached to Apigee
instance" — a count of attached environments, not a per-environment
liveness flag.
yields 120, compared against zero.
Read correctly it measures environment-to-instance attachment, which
gcp-apigee-environment-healthalready checks directly through the Apigee API(
Check Apigee Environment to Instance Attachment Coverage). Inferring it froma metric here would duplicate that bundle's finding by a weaker route.
STALE_REVISION_THRESHOLDdeliberately not adopted#729 flags a stale revision only when the gap exceeds the threshold and
defaults the threshold to
1, so a proxy one revision behind is neverreported. The revision drift task here flags any gap; adopting that default
would have silently weakened an existing check.
All of the above is recorded in the bundle README so it is not re-litigated.
Verification
./.test/offline/run.sh— 301 passed, 0 failed (was 262)./.test/render/run.sh— 15 passed, 0 failedshellcheck -S styleover 15 scripts — exit 0robot --dryrun— 9 tasks, 9 passedones: coverage silenced, coverage narrowed to READY-only, and each of the two
scope-filter guards removed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NLcdGCtY4qZH8tW5MKDEvi