feat: prevent writer framework version mismatch between local & deploy - WF-67
- when using
writer deploy, it check the version set in poetry during a cloud deployment is the one used in development
- when using
writer run, it show a warning when the version used is obsolete regards to the development version
- when using
writer edit, it show a warning when the version used is obsolete regards to the development version
Hey, I didn't read the whole PR, but relying only on the version pinned in requirements.txt or pyproject.toml is problematic. And I think that's the case.
As we discussed with @raaymax requirements.txt will be optional. Also, there should be no need to pin a Framework version. We should assume that if nothing is specified the latest stable version in PyPi is used.
What I was planning, also why I added
include the version in the front end for easier troubleshooting (probably not visible, but easily checked via chrome Dev tools/Inspect Element)
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
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
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.
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 writer deploy when it happens.
Please make sure to get the effective version and not search for it on requirements.txt or pyproject.toml, otherwise I'm not too sure how we can cover the scenario where writer version isn't specified.
Please make sure to get the effective version and not search for it on
requirements.txtorpyproject.toml, otherwise I'm not too sure how we can cover the scenario wherewriterversion isn't specified.
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 (VERSION) and ./wf/metadata.json. It just give hint to user where to declare it's dependencies depending of the present strategy
Ah sorry, that's great!
Can this be merged without any changes in the Writer's deployment service repo?