Hi everyone, this is probably more of a DevOps que...
# general
t
Hi everyone, this is probably more of a DevOps question than anything, but I couldn't find any answers elsewhere. What's the recommended approach to take if a consumer publishes a new contract requiring verification, and that fires our webhook, but the environment we need to test against (e.g. production) is currently being updated? e.g. Production API is running v1, but is currently being updated to v2. The webhook fires, requesting verification from v1, but just before it runs, production finishes updating and is now running v2. Verification will run and publish results under version v1, even though it ran against a v2 API
m
The webhook itself should contain the SHA (or more specifically, the provider version) that needs to be verified. It might be the version that was in production (v1). In most cases, the version (v2) that is about to goto prod should have been verified already OR have a webhook fired for it also because it would have been either a) the main branch version or b) deployed to an environment (e.g. staging/UAT) before deploying to prod.
b
The question almost implies that you're running verifications against live systems, instead of as unit tests, too... I haven't been in a situation where downtime could prevent verification.
m
ah, that’s a good point - are you doing that?
t
Thanks both! Before introducing webhooks, we only ran verification as part of our CI/CD, but now we have a need to run verification against our latest main and production versions if new contracts require verification. For the production version, we've decided to test against staging which is a live environment, but is non-public facing and is only used for testing purposes
🤔 2
👀 1
It might seem odd to test against a live environment, but our infrastructure is all AWS-based and spinning up an environment just to run tests against takes ~30 minutes - it seemed the lesser of two evils to have an environment which doesn't get used for anything else, used for testing
👍 1
b
It's a valid strategy, just not ideal :) typically, I can run the verification step in unit tests (with own little build pipeline), agnostic of deployment runtime
Depends on frameworks & test libs, and where you want to cut for stubbing
But yeah, if verifying against a live env gives you what you need, then great ^^