Skip to content
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

Feature/workflow container (part 2) #277

Merged
merged 19 commits into from
Apr 19, 2021

Conversation

just-at-uber
Copy link
Contributor

@just-at-uber just-at-uber commented Apr 12, 2021

Added

  • workflow execution stored in vuex
  • workflow pending tasks data (used in future PR for pending tab)

Changed

  • workflow execution now polled while workflow is running

@@ -240,80 +241,80 @@ export default {
}
});
},
onBaseApiUrlChange(baseAPIURL) {
fetchTaskList() {
Copy link
Contributor Author

@just-at-uber just-at-uber Apr 12, 2021

Choose a reason for hiding this comment

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

code moved into alphabetical order. No changes in function except taskListName coming from props instead of referencing from the workflow.

babel.config.js Outdated Show resolved Hide resolved
client/main.js Outdated Show resolved Hide resolved
jest.config.js Outdated Show resolved Hide resolved
package-lock.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
test/helpers/index.js Outdated Show resolved Hide resolved
test/setup.js Outdated Show resolved Hide resolved
this.wfLoading = true;

return this.$http(baseAPIURL)
.then(
wf => {
this.workflow = wf;
this.$emit('setWorkflow', wf);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

workflow execution stored in vuex

@@ -144,17 +148,14 @@ export default {
this.summary.result = undefined;
this.summary.wfStatus = undefined;
this.summary.workflow = undefined;

this.$emit('clearWorkflow');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

workflow execution stored in vuex

[WORKFLOW_EXECUTION_PENDING_TASKS]: (_, getters) => [
...getters[WORKFLOW_EXECUTION_PENDING_ACTIVITIES],
...getters[WORKFLOW_EXECUTION_PENDING_CHILDREN],
],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

workflow pending tasks data (used in future PR for pending tab)

@just-at-uber just-at-uber marked this pull request as ready for review April 15, 2021 18:48
@just-at-uber just-at-uber requested a review from a team April 15, 2021 18:48
this.clearState();
},
async onHistoryUrlChange(historyUrl) {
const workflowInfo = await this.fetchWorkflowInfo();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

workflow execution now polled while workflow is running

Copy link
Contributor Author

Choose a reason for hiding this comment

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

historyUrl will change when received new page token for history API.

@@ -144,17 +148,14 @@ export default {
this.summary.result = undefined;
this.summary.wfStatus = undefined;
this.summary.workflow = undefined;

this.$emit('clearWorkflow');

Choose a reason for hiding this comment

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

does it clean the wf state?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct. It will clear all data for the workflow in the vuex store.

'WORKFLOW_EXECUTION_PENDING_CHILDREN';
export const WORKFLOW_EXECUTION_PENDING_TASK_COUNT =
'WORKFLOW_EXECUTION_PENDING_TASK_COUNT';
export const WORKFLOW_EXECUTION_PENDING_TASKS =

Choose a reason for hiding this comment

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

we may want to have one for pending decision as well in the future, if possible, like we already do for the CLI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good. I couldn't see it being returned in the current API but it is the plan once this is returned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screen Shot 2021-04-19 at 10 24 52 AM

Comment on lines +38 to +56
describe('workflow getters', () => {
describe('when calling getters[WORKFLOW_EXECUTION]', () => {
describe('and state.workflow.execution is defined', () => {
const state = {
workflow: {
execution: {
executionKey: 'executionValue',
},
},
};

it('should return the value from state.workflow.execution', () => {
const getters = initGetters({ getterFns, state });
const output = getters[WORKFLOW_EXECUTION];

expect(output.executionKey).toEqual('executionValue');
});
});
});

Choose a reason for hiding this comment

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

good stuff to cover the functionality!

Copy link

@mkolodezny mkolodezny left a comment

Choose a reason for hiding this comment

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

Looks fine to me, does vuex use just ajax to poll for the wf info? In the future, we may consider to push from the Cadence server via websockets on updates(if any), to optimize.

@just-at-uber
Copy link
Contributor Author

Looks fine to me, does vuex use just ajax to poll for the wf info? In the future, we may consider to push from the Cadence server via websockets on updates(if any), to optimize.

Vuex is just a store for data returned by the API. Currently the application is using ajax to poll and will then store in the vuex store. websockets could work in the future when the API supports it.

@just-at-uber just-at-uber merged commit a1f593b into master Apr 19, 2021
@just-at-uber just-at-uber deleted the feature/workflow-container-part-2 branch April 19, 2021 17:33
@just-at-uber just-at-uber mentioned this pull request Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants