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

fix: Reduce update scope for twingate_resource_update #176

Conversation

ekampf
Copy link
Contributor

@ekampf ekampf commented Feb 29, 2024

Related Tickets & Documents

Fixes #173

Changes

twingate_resource_update should only care when spec updates

Copy link

linear bot commented Feb 29, 2024

@coveralls
Copy link
Collaborator

coveralls commented Feb 29, 2024

Pull Request Test Coverage Report for Build 8107348223

Details

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

Totals Coverage Status
Change from base Build 8107163584: 0.1%
Covered Lines: 837
Relevant Lines: 865

💛 - Coveralls

Copy link

@minhtule minhtule left a comment

Choose a reason for hiding this comment

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

LGTM 👍

app/handlers/handlers_resource.py Show resolved Hide resolved
crd = ResourceSpec(**new["spec"])
crd = ResourceSpec(**spec)

if len(diff) == 1 and diff[0][0] == "add" and diff[0][1] == ("id",):
Copy link

Choose a reason for hiding this comment

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

nit: I wonder if there is a nicer way to do this because the indexes are quite abstract. Maybe

if diff == (("add", ("id",), None, ANY),):

? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@minhtule I thought about it but ANY is in unittest which I wouldnt want to import on non testing code

app/handlers/tests/test_handlers_resource.py Outdated Show resolved Hide resolved
@ekampf ekampf merged commit c947fba into main Mar 1, 2024
12 checks passed
@ekampf ekampf deleted the feature/oss-16-fix-twingate_resource_update-listens-to-too-many-updates branch March 1, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: twingate_resource_update listens to too many updates
3 participants