[x] missing edgecase: arrays have same contents but different orders
[x] missing edgecase: nil and empty array check should be good
[x] make solution more ruby-like?
[x] try to reduce duplicate code?
[x] add more unit tests to not update when nothing changes
[x] tophat
[x] changelog
Description
Fixes #1323
What is the problem it is solving?
Previously, the ruby api would only update webhooks if the topic already existed but the callback url / endpoint was different. It did not consider the scenario where the same topic and callback url were supplied, but the fields or metafield namespaces were updated. I chose to only check fields and metafield namespaces because those are the only attributes accepted by the ruby api (despite the actual gql object having other (deprecated) fields.
What is the context of these changes?
refactor the existing unit tests so that the shared functions are more flexibly called via adding new parameters
Now, each test defines it's own expected queries, responses and values, instead of having an if statement in the helper function to deal with it
remove unused code in the unit testing file
write tests and add to existing ones for ...
having an update mutation called when just path, fields, or metafieldNamespaces is changed
adding a new webhook with each of these params
not updating when an existing identical webhook exists
& hardcode expected queries in the testing helper file
update the check for existing webhook query for each of http, pubsub, and eventbridge
update the parsing method for each of http, pubsub, eventbridge
pulling shared code into registration superclass. allowing subclass to implement a specific detail
update the logic in webhook_registration_needed to check for diffs in fields and metafieldNamespaces
What is the impact of this PR?
Fixing #1323
How has this been tested?
Made new unit tests and strengthened existing tests to account for the new scenarios
the previous tests were running the exact same "update path" test regardless of parameters in do_register_test.
Checklist:
[x] My commit message follow the pattern described in here
[x] I have performed a self-review of my own code.
[x] I have added tests that prove my fix is effective or that my feature works.
TODO:
Description
Fixes #1323
What is the problem it is solving?
What is the context of these changes?
What is the impact of this PR?
Fixing #1323
How has this been tested?
Checklist: