-
-
Notifications
You must be signed in to change notification settings - Fork 776
config_context renders against incorrect pack #4570
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e2cca81
Fixes https://github.com/StackStorm/st2/issues/4567: config_context r…
jinpingh a97fd8e
Remove render for parent pack configuration.
jinpingh 5c64ca0
Merge branch 'master' into issue-4567/config_context_renders
jinpingh 62a51fb
New unit test for config_context renders against incorrect pack
jinpingh 0e780ad
Fix review comments for unit test.
jinpingh 0c41155
Remove code for getting action reference from spc.action
jinpingh f76e6dd
Integration test for config_context renders against incorrect pack
jinpingh 82ce3c5
Remove integration test code and setup test environment from `./tools…
jinpingh c81f042
Change integration test pack from `dummy_pack_7` to `tests`.
jinpingh 6f62b3c
Move tests pack from st2 repo to st2test repo.
jinpingh eaa3858
Add step to clone st2tests repo and copy tests pack
jinpingh c1f0724
Remove unused import: `mock`
jinpingh 82fcc34
Remove authentication setup checking for simplicity
jinpingh 3a8598e
Merge branch 'master' into issue-4567/config_context_renders
jinpingh c81e6d1
Change warning message.
jinpingh 30bd1a0
Merge branch 'issue-4567/config_context_renders' of https://github.co…
jinpingh 2cbe564
Merge branch 'master' into issue-4567/config_context_renders
jinpingh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -535,6 +535,9 @@ def request_action_execution(wf_ex_db, task_ex_db, st2_ctx, ac_ex_req, delay=Non | |
| # Identify the runner for the action. | ||
| runner_type_db = action_utils.get_runnertype_by_name(action_db.runner_type['name']) | ||
|
|
||
| # Identify action reference | ||
| action_ref = task_ex_db.task_spec.get('spec').get('action') | ||
|
|
||
| # Set context for the action execution. | ||
| ac_ex_ctx = { | ||
| 'pack': st2_ctx.get('pack'), | ||
|
|
@@ -545,7 +548,8 @@ def request_action_execution(wf_ex_db, task_ex_db, st2_ctx, ac_ex_req, delay=Non | |
| 'task_execution_id': str(task_ex_db.id), | ||
| 'task_name': task_ex_db.task_name, | ||
| 'task_id': task_ex_db.task_id | ||
| } | ||
| }, | ||
|
||
| 'ref': action_ref | ||
| } | ||
|
|
||
| if st2_ctx.get('api_user'): | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There's already an action_ref at line 519. They're not the same?
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.
You did not address this yet.
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.
It is not the same. line 519 is get block of action data from action_execution_d_b. This is get action_ref = pack_name:action_name
Not sure about
You did not address this yet.means. Changedif elseblock to one line.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.
The line numbers may have shifted. But if you go down two line from
def request_action_execution(wf_ex_db, task_ex_db, st2_ctx, ac_ex_req, delay=None), there's already an action_ref assigned. Is it different than the action_ref begin assigned in this line.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.
And if they are not the same, then you just overwrote action_ref that is saved to LiveActionDB below.
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.
Yes, it is different. Changed my variable name.
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.
I just manually tested this and they are the same value. Can you show me an example where they are different.
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.
My bad. I thought it is reading ActionExecution.action. Put log message and tested. Committed change.
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.
Ok. Good you finally see it. I thought maybe I'm not clear enough.