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

Pause and Resume #549

Merged

Conversation

ognyan-kostadinov
Copy link
Contributor

No description provided.

@bert-e
Copy link
Contributor

bert-e commented Mar 13, 2023

Hello ognyan-kostadinov,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Mar 13, 2023

Incorrect fix version

The Fix Version/s in issue ZKUI-313 contains:

  • None

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 1.6.11

Please check the Fix Version/s of ZKUI-313, or the target
branch of this pull request.

@codecov-commenter
Copy link

codecov-commenter commented Mar 16, 2023

Codecov Report

Merging #549 (8857f7e) into development/1.6 (b06bca2) will increase coverage by 0.86%.
The diff coverage is 56.07%.

@@                 Coverage Diff                 @@
##           development/1.6     #549      +/-   ##
===================================================
+ Coverage            51.94%   52.80%   +0.86%     
===================================================
  Files                  193      196       +3     
  Lines                 9239     9307      +68     
  Branches              2559     2574      +15     
===================================================
+ Hits                  4799     4915     +116     
+ Misses                4419     4371      -48     
  Partials                21       21              
Impacted Files Coverage Δ
src/js/ZenkoClient.ts 40.47% <0.00%> (-6.75%) ⬇️
src/react/backend/location/utils.tsx 63.01% <ø> (+10.26%) ⬆️
src/react/ui-elements/Help.tsx 62.50% <ø> (ø)
src/react/workflow/CreateWorkflow.tsx 46.21% <ø> (ø)
src/react/workflow/ReplicationForm.tsx 64.37% <ø> (ø)
src/react/backend/location/PauseAndResume.tsx 54.28% <54.28%> (ø)
src/react/actions/zenko.ts 52.71% <60.00%> (ø)
src/react/backend/location/queries.ts 66.66% <66.66%> (ø)
src/react/workflow/WorkflowState.tsx 87.50% <87.50%> (ø)
src/react/backend/location/Locations.tsx 81.53% <100.00%> (+0.37%) ⬆️

... and 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ognyan-kostadinov ognyan-kostadinov marked this pull request as ready for review March 17, 2023 13:43
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure any modification is necessary in this file.

Comment on lines 143 to 160
const {
data: instanceStatus,
status,
isFetching,
} = useQuery({
queryKey: ['instanceStatus', instanceId],
queryFn: () => {
return managementClient.getLatestInstanceStatus(
instanceId,
) as InstanceStatus;
},
onError: (error) => {
dispatch(handleClientError(error));
},
refetchOnMount: false,
refetchOnWindowFocus: false,
});

Copy link
Contributor

Choose a reason for hiding this comment

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

As this instanceStatus query is only used by PauseAndResume component, I would suggest to move it there, similarly as for the invalidation logic

Comment on lines 94 to 95
dispatch(networkStart('Pausing Replication workflow'));
pauseReplicationSiteMutation.mutate(locationName);
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, this dispatch network start shall be handled by the mutation

Comment on lines 98 to 99
dispatch(networkStart('Pausing Async Metadata updates'));
pauseIngestionSiteMutation.mutate(locationName);
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, this dispatch network start shall be handled by the mutation

const invalidateInstanceStatusQueryCache = async () => {
await queryClient.invalidateQueries(['instanceStatus', instanceId]);
await queryClient.refetchQueries(['instanceStatus', instanceId]);
dispatch(networkEnd());
Copy link
Contributor

Choose a reason for hiding this comment

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

This should also be called for the pause and resume mutation in case of failures

Comment on lines 188 to 191
processed only once the Workflow processes are resumed.Name of
the bucket/container created in the specific location (e.g.
RING, Azure, AWS S3, GCP...), and where buckets attached to that
location will store data.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
processed only once the Workflow processes are resumed.Name of
the bucket/container created in the specific location (e.g.
RING, Azure, AWS S3, GCP...), and where buckets attached to that
location will store data.
processed only once the Workflow processes are resumed.

Comment on lines 20 to 21
await queryClient.invalidateQueries(['instanceStatus', instanceId]);
await queryClient.refetchQueries(['instanceStatus', instanceId]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need both ? I assume await queryClient.refetchQueries(['instanceStatus', instanceId]); should be enough here.

Copy link
Contributor

Choose a reason for hiding this comment

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

In addition once the query would be extracted we could retrieve the query id from the extracted query directly

Comment on lines 79 to 91
} = useQuery({
queryKey: ['instanceStatus', instanceId],
queryFn: () => {
return managementClient?.getLatestInstanceStatus(
instanceId,
) as InstanceStatus;
},
onError: (error) => {
dispatch(handleClientError(error));
},
refetchOnMount: false,
refetchOnWindowFocus: false,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

I would extract this query into a queries object similarly as we do for other features. That will enable simpler reuse of the queries later on

Comment on lines 39 to 41
await waitForElementToBeRemoved(() => screen.queryByTestId('loader'), {
timeout: 8000,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use below option instead?

Suggested change
await waitForElementToBeRemoved(() => screen.queryByTestId('loader'), {
timeout: 8000,
});
await waitForElementToBeRemoved(() => screen.queryByText('Loading'), {
timeout: 8000,
});

@ognyan-kostadinov
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Mar 21, 2023

Incorrect fix version

The Fix Version/s in issue ZKUI-313 contains:

  • None

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 1.6.11

Please check the Fix Version/s of ZKUI-313, or the target
branch of this pull request.

The following options are set: approve

@ChengYanJin
Copy link
Contributor

/status

@bert-e
Copy link
Contributor

bert-e commented Mar 22, 2023

Status

Status report is not available.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Mar 22, 2023

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/1.6

The following branches will NOT be impacted:

  • development/1.4
  • development/1.5

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Mar 22, 2023

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/1.6

The following branches have NOT changed:

  • development/1.4
  • development/1.5

Please check the status of the associated issue ZKUI-313.

Goodbye ognyan-kostadinov.

@bert-e bert-e merged commit 5f7b49c into development/1.6 Mar 22, 2023
@bert-e bert-e deleted the improvement/ZKUI-313/pause-and-resume-replication branch March 22, 2023 13:15
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.

5 participants