Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused FF_HOOK_EVENTS #1026

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Remove unused FF_HOOK_EVENTS #1026

merged 2 commits into from
Jan 17, 2024

Conversation

hectorgomezv
Copy link
Member

@hectorgomezv hectorgomezv commented Jan 16, 2024

Context:
The Safe Client Gateway currently accepts two ways to invalidate cache registries:

  • Via sending a POST request to the /v2/flush/ endpoint containing an invalidation pattern.
  • Via sending a POST request to the /v1/hooks/events/ endpoint containing an event payload.

The first approach was being used by the Config Service exclusively, when it is configured to do so (i.e.: when FF_HOOK_EVENTS feature flag is set). This PR removes the possibility of using this first approach in favor of using the /v1/hooks/events/ endpoint instead.

Changes:

  • Removes FF_HOOK_EVENTS from the service configuration.
  • Changes signals.py classes for both Chains and Safe Apps, so these classes don't use the /v2/flush/ endpoint anymore. (And modifies their test counterparts accordingly)
  • Removes the flush function from the Safe Client Gateway client implementation.

Out of scope:

  • Remove/rename CGW_FLUSH_TOKEN to an alternative name. This would imply changes in other files and some coordination, so it will be tackled separately.

@hectorgomezv hectorgomezv self-assigned this Jan 16, 2024
@hectorgomezv hectorgomezv requested review from mmv08 and a team as code owners January 16, 2024 14:44
@coveralls
Copy link

coveralls commented Jan 16, 2024

Pull Request Test Coverage Report for Build 7555347666

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 99.889%

Totals Coverage Status
Change from base Build 7490932407: 0.1%
Covered Lines: 4494
Relevant Lines: 4499

💛 - Coveralls



@override_settings(CGW_URL="http://127.0.0.1", CGW_FLUSH_TOKEN="example-token")
class ChainNetworkHookWithFFHookEventsTestCase(TestCase):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: let's remove "FF" from the name as we are no longer testing that (from my understanding).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I totally agree! Changed in 3cce913

@fmrsabino fmrsabino added the in review Someone is reviewing this Pull Request label Jan 17, 2024
Copy link
Contributor

@fmrsabino fmrsabino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@fmrsabino fmrsabino removed the in review Someone is reviewing this Pull Request label Jan 17, 2024
@hectorgomezv hectorgomezv merged commit 5c86839 into main Jan 17, 2024
15 checks passed
@hectorgomezv hectorgomezv deleted the remove-ff-hook-events branch January 17, 2024 12:05
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants