Skip to content

Conversation

@Kami
Copy link
Member

@Kami Kami commented Feb 4, 2019

This pull request fixes a bug with {{ confix_context.<config item name> }} notation not working for action parameter default values for action executions which are scheduled via Orquesta (aka part of an Orquesta workflow).

Background and Details

I was working on some st2community pack changes and improvements and while testing and developing the workflow I noticed "{{ config_context }}" notation doesn't work for executions scheduled via Orquesta (e.g. https://github.com/StackStorm/stackstorm-st2community/pull/1/files#diff-3c8d6de4c078da34b194a061826b147dR13), but it works just fine if those actions are run outside of the Orquesta workflow context.

After some digging in, I found orquesta runner doesn't add pack value to the execution context so get_config method will always return an empty dict because pack will be set to None.

TODO

  • Tests

Kami added 2 commits February 4, 2019 12:38
"pack" attribute to the execution context.

If we don't add that, {{ config_context }} won't work correctly for
default parameter values for action executions which are scheduled as
part of an Orquesta workflow.
@Kami Kami added this to the 2.10.2 milestone Feb 4, 2019
@Kami Kami requested review from bigmstone and m4dcoder February 4, 2019 11:53
"""Returns config for given pack and user.
"""
LOG.debug('Attempting to get config')
LOG.debug('Attempting to get config for pack "%s" and user "%s"' % (pack, user))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally this log message was not all that useful because it didn't include pack and username so you weren't able to spot pack is None just by looking at the log messages.

Kami added 3 commits February 4, 2019 15:53
sure also also add "pack" attribute to LiveActionDB.context attribute
inside "create_request" function.

We already add it in RunnerContainer.dispatch(), but that's not the best
place since some tests don't call that method so that value won't be
present.
default parameter values works for executions scheduled via Orquesta
workflow.
@Kami Kami changed the title [WIP] Fix a bug with "{{ config_text.foo }}" not working for executions scheduled via Orquesta workflow Fix a bug with "{{ config_text.foo }}" not working for executions scheduled via Orquesta workflow Feb 4, 2019
Copy link
Contributor

@bigmstone bigmstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants