-
-
Notifications
You must be signed in to change notification settings - Fork 751
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
Check and warn if action ref is not present during alias registration #4388
Conversation
@@ -132,6 +133,13 @@ def _register_action_alias(self, pack, action_alias): | |||
except StackStormDBObjectNotFoundError: | |||
LOG.debug('ActionAlias %s not found. Creating new one.', action_alias) | |||
|
|||
action_ref = action_alias_db.action_ref | |||
|
|||
action_db = Action.get_by_ref(action_ref) |
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.
Let's see if we can speed this up.
I just made some changes in the past release which improve performance of similar code paths so instead of N queries (where N is number of aliases here) we only perform a single query.
I know this will likely require changing the code around though.
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.
@Kami I want to merge this PR and address bootstrap optimizations as part of another PR that I am working on. If you agree, I'll add tests for this one and try to get this merged?
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.
But please don't forget about it otherwise we will again make one step forward and one step back.
* master: (202 commits) Move from distro check to Python version check. Update compile blacklists. Fix typo. Update st2-self-check and st2ctl to take into account that Mistral is not present on Bionic. Don't run flask dev server in threaded mode since it blocks the main loop. Allow developer to pass patch_thread argument to the monkey_patch() function. Echo flask sensor depends on flask. Fix fibonacci sensor so it works under Python 3. Fix st2-run-pack-tests so it works under Python 3. Revert changes to mongo and some rabbit instrumentation Stop raising Python exception when execution result is disabled in action-alias. Port post_result to orquesta for conditional branching. Bumped version to 1.0.1 Allow user to specify PYTHON_VERSION env variable. Add a changelog entry. Add a NOTE on old and deprecated timer options. Fix an issue with timers engine config options not working as advertised. Timers engine options are also used by st2notifier so they need to be registered as common options inside st2common. Make sure we correctly pass local timezone specified in the st2.conf to each BlockingScheduler class constructor. Remove debug code. Make sure we run pack tests under Python 3 on Travis. Fix typo. ...
* master: Fix context related bugs in orquesta Use the same approach for statsd as we use for lib2to3. Remove code which is not needed. Add comment. Ignore "Generating grammar tables" log messages generated by 2to3 library used by networkx. Update logger format string. Don't print statsd log messages unless debug / verbose mode is used. Update Circle CI config so we also build bionic packages. Update Python action wrapper to silence cryptography deprecation warnings which are printed if user is using older version of Python 2.7. Update test dependencies. Re-generate requirements files and upgrade to mongoengine 0.16.0. Update various dependencies to latest stable versions. Refactor orquesta to output on error
* master: (33 commits) Update actions registrar to ignore "mistral-v2" runner not found errors which could occur on installations without Mistral. Revert "Pass --register-no-fail-on-failure flag to st2ctl in self check when" Pass --register-no-fail-on-failure flag to st2ctl in self check when running on distributions with Python 3 without Mistral to avoid errors from workflows in exampels pack which use Mistral runner. Remove debug code. Allow st2api to work without mistralclient. Update the code so it works without mistralclient dependency on installations without Mistral. More Python 3 compatibility fixes. More Python 3 compatibility fixes. Add a test case which verifies metadata_file attribute is also set when registering resources via the API. Fix lint. Update affected tests. Update action alias testing utils so being unable to infer metadata_file attribute is not fatal. Not being able to retrieve the metadata_file path should not be datal. Make test assertions more strict. Update affected tests. Update affected test. Update code to use a more safe and robust way of obtaining pack resource path which is relative to the pack directory. Add use_pack_cache argument to get_pack_base_path and related methods. Use more descriptive function name. Add tests for "get_relative_path_to_pack" function for which we didn't have any tests yet. ...
fixes: #4372
Registration
TODO