Fix: App comment command execution sequencing #15615
Merged
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.
What does this PR do?
Fixed condition in which app command comments would not execute before the flow is dispatched.
For local runtimes, we executed app comment commands only right before executing a Flow or Work subclass. This is problematic as there are cases where the entrypoint file may make calls to an imported module object in the main file body (either inline or in a class definition), and since the module is not actually available the app would fail to start before it even reached the location where we would have executed the comment commands.
This PR moves up the location of the comment command execution to before the point where the app file is first are loaded into the python runtime.
For Example, this would have previously failed:
While this would have been fine:
With these changes both of the above scenarios now work (as it was originally intended)
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃