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(versioning): scheduled changes incorrectly considered live #4119

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

This PR fixes an issue where scheduled changes were incorrectly being considered live.

How did you test this code?

Added a unit test.

Copy link

vercel bot commented Jun 5, 2024

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2024 11:52pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2024 11:52pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2024 11:52pm

Copy link
Contributor

github-actions bot commented Jun 5, 2024

Uffizzi Preview deployment-52700 was deleted.

Copy link

codecov bot commented Jun 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.44%. Comparing base (f0eae7b) to head (6d0193e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4119   +/-   ##
=======================================
  Coverage   96.44%   96.44%           
=======================================
  Files        1149     1149           
  Lines       37596    37605    +9     
=======================================
+ Hits        36259    36268    +9     
  Misses       1337     1337           

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

"api_key": environment_api_key,
# It seems as though there is a timezone issue when using postgres's
# built in now() function, so we pass in the current time from python.
"live_from_before": timezone.now().isoformat(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer avoiding the use of Python's now() here. Maybe we can leave a TODO here to revisit it in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the comment to use a TODO.

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, so this works (after updating the test to schedule the other version for 2 hours later):

and efv2."live_from" <= now() + interval '90 minutes'

Indicating that it likely is some TZ issue 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.

Actually, that's not true because even this works:

and efv2."live_from" <= now() + interval '1 second'

Copy link
Contributor

@novakzaballa novakzaballa left a comment

Choose a reason for hiding this comment

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

I Approved it to allow its deployment, though I left some comments.

@github-actions github-actions bot added fix and removed fix labels Jun 5, 2024
@matthewelwell matthewelwell added this pull request to the merge queue Jun 5, 2024
Merged via the queue into main with commit 6856e64 Jun 6, 2024
21 checks passed
@matthewelwell matthewelwell deleted the fix(versioning)/scheduled-changes-incorrectly-considered-live branch June 6, 2024 00:00
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 fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants