batches: implement fuzzier version of the webhook banner backend
Created by: LawnGnome
As discussed in #26469, let's denormalise a boolean to indicate if an external service has webhooks and use that in GraphQL to indicate if the code host probably has a valid webhook, but without going to the trouble of doing an organisation comparison for GitHub. We'll fail open: if the OOB migration hasn't yet set has_webhooks
, we'll assume the external service has a webhook until proven otherwise.
At the GraphQL layer, this adds one new field to BatchChangesCodeHost
called hasWebhooks
, and one new argument to viewerBatchChangesCodeHosts
called onlyWithoutWebhooks
to filter code hosts as needed.
On a purely technical level, this isn't really much simpler than #26469, but this has the distinct advantage that, at most, we only have to make one extra query to power the banner (and don't have to decrypt the external service configuration at all), whereas the previous implementation required number_of_code_hosts
queries and decryption operations. The tradeoff here is the fuzziness in the first paragraph, since we can't be totally precise in the GitHub case.
TODO
-
Store tests -
External services -
Code hosts
-
-
Resolver tests -
Ensure the OOB migrator ID is still valid before merging