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

Simplify run triggers #72

Merged
merged 3 commits into from
Sep 3, 2020
Merged

Simplify run triggers #72

merged 3 commits into from
Sep 3, 2020

Conversation

jlowin
Copy link
Member

@jlowin jlowin commented Sep 3, 2020

Summary

Consolidate aggregate run detail triggers into much simpler (and more performant) single triggers

Changes

  • Removes run_count and duration columns
  • simplifies state trigger logic by:
    • removing a trigger for updating runs with current state info
    • removing a trigger for updating runs with timing details info
    • adding a single, row-level trigger that updates both current state and timing details without any aggregates or comparison functions. This is way simpler than either of the previous two functions
  • cleans up default run versions. Previously, runs were created with version 0 and their initial state was also given version 0; this required special casing because all other states are only respected if their version number was greater than the run's current version. This PR bumps the initial state to have version 1, which means special casing is no longer necessary. This does have the affect of incrementing all expected versions, which is why a lot of tests are adjusted in this PR.

Importance

Mirrors https://github.com/PrefectHQ/cloud/pull/2683

Checklist

This PR:

  • adds new tests (if appropriate)
  • adds a change file in the changes/ directory (if appropriate)

@jlowin jlowin mentioned this pull request Sep 3, 2020
2 tasks
@codecov-commenter
Copy link

Codecov Report

Merging #72 into master will decrease coverage by 0.05%.
The diff coverage is 100.00%.

@cicdw cicdw merged commit be4f246 into master Sep 3, 2020
@cicdw cicdw deleted the simplify-run-triggers branch September 3, 2020 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants