-
Notifications
You must be signed in to change notification settings - Fork 81
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
feat: prevent writer framework version mismatch between local & deploy - WF-67 #626
base: dev
Are you sure you want to change the base?
Conversation
4635266
to
4cba79c
Compare
4cba79c
to
3bd8645
Compare
Hey, I didn't read the whole PR, but relying only on the version pinned in As we discussed with @raaymax What I was planning, also why I added
is... serve the version via an endpoint, e.g. myapp.com/metadata then compare that during deployment, AFTER the app has been deployed and issue a warning if it's not the same. I guess the main disadvantage of this it's that it's Writer-specific, but I think it covers this need very well and gives you a much needed way of checking the actual Framework version from the frontend. |
For version comparison the best option seems to be https://packaging.pypa.io/en/latest/version.html#packaging.version.Version |
I will move to it |
Currently it is doing that. It show a warning in the application logs. It not depends on anything for that. I will look for a way to show the warning in |
Please make sure to get the effective version and not search for it on |
It search for poetry only for one specific edge case (poetry on cloud deploy) to give the user the best recommandation. In the other cases, It rely on the comparison package version ( |
Ah sorry, that's great! |
@@ -0,0 +1,1209 @@ | |||
# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. |
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.
to remove
apps/default/poetry.lock
Outdated
@@ -0,0 +1,1209 @@ | |||
# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. |
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.
to remove
src/writer/ss_types.py
Outdated
@@ -1,3 +1,4 @@ | |||
import dataclasses |
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.
rollback those changes
c3bf7e4
to
aa2de38
Compare
aa2de38
to
987b546
Compare
src/writer/deploy.py
Outdated
@@ -47,6 +52,16 @@ def deploy(path, api_key, env, verbose, force): | |||
if not os.path.isdir(abs_path): | |||
raise click.ClickException("A path to a folder containing a Writer Framework app is required. For example: writer cloud deploy my_app") | |||
|
|||
ignore_poetry_version_check = int(os.getenv("IGNORE_POETRY_VERSION_CHECK", '0')) == 1 |
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.
add WRITER_WF_
, check if the variable is present instead of checking value
987b546
to
e5d4184
Compare
@@ -47,6 +52,16 @@ def deploy(path, api_key, env, verbose, force): | |||
if not os.path.isdir(abs_path): | |||
raise click.ClickException("A path to a folder containing a Writer Framework app is required. For example: writer cloud deploy my_app") |
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.
Very small one but now that I spotted it it bothers me 😅 Can you use either click.ClickException
or ClickException
?
src/writer/deploy.py
Outdated
@@ -47,6 +52,16 @@ def deploy(path, api_key, env, verbose, force): | |||
if not os.path.isdir(abs_path): | |||
raise click.ClickException("A path to a folder containing a Writer Framework app is required. For example: writer cloud deploy my_app") | |||
|
|||
ignore_poetry_version_check = int(os.getenv("IGNORE_POETRY_VERSION_CHECK", '0')) == 1 |
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.
Can we go ahead with this change that we discussed?
e5d4184
to
44ed26a
Compare
44ed26a
to
f75f6a7
Compare
Can this be merged without any changes in the Writer's deployment service repo? |
81545f4
to
4285be8
Compare
* fix: comment from review * feat: warn user about consistency version when running the app * refact: improve wf_project module readability * feat: implement poetry verification
4285be8
to
83f22bf
Compare
writer deploy
, it check the version set in poetry during a cloud deployment is the one used in developmentwriter run
, it show a warning when the version used is obsolete regards to the development versionwriter edit
, it show a warning when the version used is obsolete regards to the development version