-
Notifications
You must be signed in to change notification settings - Fork 4
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
Clarify and improve controls of latest_version
for version commands
#207
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dave-connors-3 This is a really well crafted PR. I appreciate the considerate inclusion of the --incremental flag, which both preserves existing flags/docs, and provides the current functionality in the new flag. The use of enums and dicts is both necessary and sufficient for making this all work.
I have one minor non-blocking comment about an unnecessary tracing comment.
Otherwise, this should be good to go. Thanks for putting this together.
dbt_meshify/main.py
Outdated
if latest and increment: | ||
raise FatalMeshifyException( | ||
"Cannot specify both --latest and --prerelease. Please choose one or the other." | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call 👍🏻
dbt_meshify/utilities/versioner.py
Outdated
class LatestVersionBehavior(str, Enum): | ||
"""An operation describes the type of work being performed.""" | ||
|
||
Prerelease = "prerelease" | ||
Increment = "increment" | ||
Latest = "latest" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great use of enums!
|
||
# import ipdb; ipdb.set_trace() | ||
|
||
new_latest_version_number = latest_version_number_map[latest_version_behavior] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really clever. Great use of enums and dicts.
Co-authored-by: Nicholas A. Yager <[email protected]>
closes #199
This PR improves the ergonomics of determining which version of a model should be marked as the
latest_version
when using thedbt-meshify version
anddbt-meshify operation bump-version
commands.This PR does not change the default behavior:
Old behavior:
--latest
flag increments thelatest_version
by oneNew Behavior:
-
--increment
(new flag!) increments thelatest_version
by one--latest
flag -- makes the newest, greatest integer'd version thelatest_version
, per @dbeatty10 's example in the issue.