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 bug with changing monitor frequency from scheduled to "not scheduled" #5114

Merged
merged 7 commits into from
Jul 24, 2024

Conversation

jpople
Copy link
Contributor

@jpople jpople commented Jul 22, 2024

Closes PROD-2305

Description Of Changes

Fixes a bug where discovery monitors that were scheduled for execution couldn't have their execution frequency changed to "not scheduled".

The issue was that the backend was treating a value of "undefined" for execution_frequency as "not scheduled", but the frontend isn't able to explicitly send "undefined" in its API request's payload. To fix, added a NOT_SCHEDULED option to the MonitorFrequency enum and updated form on frontend and validation on backend to handle it as an explicit value.

Code Changes

  • Add NOT_SCHEDULED to MonitorFrequency enum
  • Update UI to send "Not scheduled" instead of undefined when "Not scheduled" is selected in the form

Steps to Confirm

Must run Plus backend on branch jpople/prod-2305/not-scheduled-edit-fix (see here)

  • Create a discovery monitor with execution frequency set
  • Edit that monitor, changing its frequency to "Not scheduled"
  • Change should persist to DB

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Documentation:
    • documentation complete, PR opened in fidesdocs
    • documentation issue created in fidesdocs
    • if there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
  • Issue Requirements are Met
  • Relevant Follow-Up Issues Created
  • Update CHANGELOG.md
  • For API changes, the Postman collection has been updated
  • If there are any database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!

Copy link

vercel bot commented Jul 22, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Jul 24, 2024 9:14pm

Copy link

cypress bot commented Jul 22, 2024

Passing run #9126 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge fa2be01 into 805aa66...
Project: fides Commit: 53c1809e51 ℹ️
Status: Passed Duration: 00:35 💡
Started: Jul 24, 2024 9:26 PM Ended: Jul 24, 2024 9:27 PM

Review all test suite changes for PR #5114 ↗︎

Copy link

codecov bot commented Jul 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.56%. Comparing base (8312146) to head (fa2be01).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5114      +/-   ##
==========================================
+ Coverage   86.54%   86.56%   +0.02%     
==========================================
  Files         357      357              
  Lines       22345    22349       +4     
  Branches     2954     2955       +1     
==========================================
+ Hits        19339    19347       +8     
+ Misses       2482     2480       -2     
+ Partials      524      522       -2     

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

@jpople jpople marked this pull request as ready for review July 22, 2024 20:43
Copy link
Contributor

@erosselli erosselli left a comment

Choose a reason for hiding this comment

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

Nice work, specially adding tests 😎

Comment on lines +209 to +211
if execution_frequency == MonitorFrequency.NOT_SCHEDULED:
data["monitor_execution_trigger"] = None
return
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can add a case to the parameters of the test test_create_monitor_config_execution_trigger_logic so that we cover this line , what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

actually I see you did this already, unsure why codecov's reporting that these lines aren't covered

@jpople jpople merged commit ab17a78 into main Jul 24, 2024
51 checks passed
@jpople jpople deleted the jpople/prod-2305/not-scheduled-edit-fix branch July 24, 2024 23:12
Copy link

cypress bot commented Jul 24, 2024

Passing run #9130 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Fix bug with changing monitor frequency from scheduled to "not scheduled" (#5114...
Project: fides Commit: ab17a7809a
Status: Passed Duration: 00:34 💡
Started: Jul 24, 2024 11:24 PM Ended: Jul 24, 2024 11:24 PM

Review all test suite changes for PR #5114 ↗︎

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.

2 participants