-
-
Notifications
You must be signed in to change notification settings - Fork 741
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
Add python warning if install a pack that only supports python 2 #5037
Conversation
I wanted to get some feedback before I started adding UT and integration tests. I did consider changing the download_pack so the warning was returned rather than just Success, but was concerned that might cause integration problems if the result of that action were checked. So therefore decided to just log a warning and keep the warning as an extra result to the workflow (similar to conflicts) Here is some output from runs. In this scenario test1 pack is python 2 &3, test2 pack is python2, test 3 pack is dependant on pack 2 & 3. Output when use CLI to install test3 pack:
Output from execution get on the above workflow:
Output from execution get on the packs.download action:
|
Example of output from CLI when install 2 packs that are only python 2:
And the execution result:
|
st2common/st2common/util/pack.py
Outdated
PACK_PYTHON2_WARNING = "DEPRECATION WARNING: Pack %s only supports Python 2.x. " \ | ||
"ST2 will remove support for Python 2.x in a future release." |
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.
Small note about "future release(s)" and also would be nice to add a call to action for the users:
PACK_PYTHON2_WARNING = "DEPRECATION WARNING: Pack %s only supports Python 2.x. " \ | |
"ST2 will remove support for Python 2.x in a future release." | |
PACK_PYTHON2_WARNING = "DEPRECATION WARNING: Pack %s only supports Python 2.x. " \ | |
"Python 2 support will be dropped in the future releases. " \ | |
"Please consider updating your packs to work with Python 3." |
Feel free to adjust as you wish.
Thanks for providing the CLI examples! Everything feels right 👍 |
Co-authored-by: Eugen C. <stackstorm@armab.io>
@StackStorm/maintainers @StackStorm/contributors Anyone wants to try this new deprecation warning experience and provide the feedback? Help wanted to try this feature out. |
@armab I will give this a try and post the experience/feedback here. |
Hi, I tried to test this but I must be doing something wrong or miss something. First I patched one of my dev environments with your changes and then I tried it on a plain new CentOS8 VM by running
For some reason the Any idea what I'm doing wrong or any better way to test this? |
Are those packs python 2 only? The test2 one you referred to isn't. The pack.yaml doesn't specify python versions - so it assumes it's both. |
Nagios as well isn't a python 2 only pack according to it's pack.yaml |
Thanks @amanda11, that was exactly the issue. I just trusted the info shown on the stackstorm exchange. Everything works as expected with my own packs and forks of a pack with a modified pack.yaml. I'll run some more tests via the UI and CLI and will let you know if I find anything. So far everything matches exactly what you described above and I like the user experience. |
@amanda11 from what I know that info is served from https://github.com/StackStorm-Exchange/index/tree/master/v1/packs which is updated whenever a pr is merged to master in https://github.com/StackStorm-Exchange. If there are discrepancies then it could be that in some instances(just thinking loud here) the ci for index wouldn't have run or had issues. |
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.
Thanks @amanda11 for the well organized PR and @winem @Sheshagiri for the review!
Looks good to me 👍
As an addition to this, besides of |
@armab Warnings that we get at moment in the actionrunner.log are:
Does this cover the logging needed in actionrunner, or is there anywhere else its needed? |
@amanda11 That's awesome! Yes, that logging example is more than enough 👍 |
No worries - I thought I had a log in there somewhere, but forgot to put in the examples. |
packs.download action will log a warning if attempt to install a pack that only supports python 2
packs.install workflow will include an extra step to check if the metadata indicates warnings (and will return a warning_list of any of the packs that had a warning - whereby warnings will only be raised if the pack supports python 2). The warning_list will also be an output of the workflow (similar to conflict_list)
st2 client, when running "pack install" will output to screen any warnings reported in the warning_list from the workflow execution.
Part of #4938