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: edge API not updated when versioned change request committed #3760

Merged

Conversation

matthewelwell
Copy link
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Adds logic to trigger the rebuild_environment_task when a change request containing environment feature version objects is committed.

This PR also includes some minor tidying up of imports to remove ugly relative imports.

How did you test this code?

Updated existing unit test.

@matthewelwell matthewelwell requested review from a team and zachaysan and removed request for a team April 12, 2024 08:36
Copy link

vercel bot commented Apr 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Apr 12, 2024 8:39am
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2024 8:39am
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2024 8:39am

Copy link
Contributor

github-actions bot commented Apr 12, 2024

Uffizzi Preview deployment-50030 was deleted.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.91%. Comparing base (3557f2e) to head (6d9a0ae).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3760   +/-   ##
=======================================
  Coverage   95.91%   95.91%           
=======================================
  Files        1102     1102           
  Lines       34782    34789    +7     
=======================================
+ Hits        33362    33369    +7     
  Misses       1420     1420           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@zachaysan zachaysan left a comment

Choose a reason for hiding this comment

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

Everything looks good, just a couple of small questions.

Comment on lines -41 to +42
from ...versioning.models import EnvironmentFeatureVersion
from .exceptions import (
from features.workflows.core.exceptions import (
Copy link
Contributor

Choose a reason for hiding this comment

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

In general I think absolute imports are always fine, but one level of relative imports like from .exceptions import ... are acceptable too. So I agree with your redefinition of from ...versioning.models import EnvironmentFeatureVersion since it's too many levels deep but I don't really see the importance of redefining the exceptions module.

That said, I'm not really hung up on it, I'm more just interested in knowing why you're favouring the absolute import for exceptions here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's a fair point. I think I just like standardising to a single approach.

Comment on lines +168 to +171
rebuild_environment_document.delay(
kwargs={"environment_id": self.environment_id},
delay_until=environment_feature_version.live_from,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to confirm: The live_from of the environment feature version could be well into the future, correct? But that's ok since our task system is designed to handle it? Just confirming we'd survive, say, a task scheduled further in the future to survive a backend deployment or similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, it's persisted to the postgres database.

@matthewelwell matthewelwell added this pull request to the merge queue Apr 17, 2024
Merged via the queue into main with commit a7ee657 Apr 17, 2024
23 checks passed
@matthewelwell matthewelwell deleted the fix/ensure-ddb-rebuild-on-versioned-change-request branch April 17, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants