-
Notifications
You must be signed in to change notification settings - Fork 43
feat: check and warn about dirty git index during deploy #147
feat: check and warn about dirty git index during deploy #147
Conversation
Switched to explicitly opting out of |
unionml/remote.py
Outdated
@@ -40,10 +41,23 @@ def create_project(remote: FlyteRemote, project: typing.Optional[str]): | |||
remote.client.register_project(Project(id=project, name=project, description=project)) | |||
|
|||
|
|||
def get_app_version() -> str: | |||
def get_app_version(ignore_diff: bool = True) -> str: |
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.
After some reflection, I set the default value to True
so that the API behaviour is the same (eg. all get_app_version
call-sites need to opt-in to this check). Not sure what your preference is. The unionml
cli is the only place that inverts this now, --ignore-diff
is used to opt out of the check.
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.
my inclination is the stricter the better... ignore_diff = False
by default will blow up a deployment attempt unless the use specifically wants to allow uncommitted changes.
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.
I can do that, but #56 is only about failing the deployment. get_app_version
is used in a bunch of other places, and in some of them it doesn't make sense to fail over a dirty index (eg: commands like list-model-versions
). It's almost always the app_version = app_version or get_app_version()
constructs that I think should opt out of this check.
Besides, in the current state of this PR, get_app_version
gives an action hint on failure talking about --allow-uncommitted
, which isn't a flag that is present everywhere that get_app_version
is called. I'll update to allow_uncommitted = False
, but to keep the rest of the functionality the same, I'll opt those other callsites out for now
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.
awesome! changes look good, looks like pre-commit
is having issues with convert-myst-to-ipynb
... what version of jupytext
do you have? Need to pin this in another PR to avoid this issue...
> pyenv shell 3.7.13/envs/unionml
> jupytext --version
1.14.0 |
re: pre-commit error, you'll need to rebase onto current |
hmm, something funny's going on with pre-commit, still investigating... |
k, rebasing onto |
ecc6ae4
to
33f54d5
Compare
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.
lgtm, thanks @zevisert !
See #56.
Not sure if the wording is alright with my new errors and logs -- please advise!