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

Fix a bug in Pipeline Management table where sometimes pipeline action buttons do not send requests #1008

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

Karakatiza666
Copy link
Collaborator

The issue was that when checking if start/pause/shutdown request is redundant, a stale request cache was used to determine current pipeline status. Since the previous mutation the cache for .pipelineStatus() query was invalidated, but by default getQueryData() returns both valid and stale cache. By adding { stale: false } filter, we ensure that only valid status data is used for the check. Also we apply status consolidation via consolidatePipelineStatus() to .pipelineStatus() query, just like to .pipelines() query, to ensure identical behavior.

Copy link

github-actions bot commented Nov 10, 2023

✅ Meticulous spotted zero visual differences across 6 screens tested: view results.

Last updated for commit 67c4324. This comment will update as new commits are pushed.

@Karakatiza666
Copy link
Collaborator Author

Steps to reproduce the issue:

  1. Create a new pipeline, picking any program and not adding any connectors
  2. Start the pipeline
  3. Shutdown action is clickable, but doesn't change the state of pipeline

@gz
Copy link
Collaborator

gz commented Nov 10, 2023

@gz
Copy link
Collaborator

gz commented Nov 10, 2023

If I make an empty pipeline, and don't assign a program to it in the config.. the status shows as compiling but shouldn't

image

@gz
Copy link
Collaborator

gz commented Nov 10, 2023


    Create a new pipeline, picking any program and not adding any connectors
    Start the pipeline
    Shutdown action is clickable, but doesn't change the state of pipeline

this bug still seems to be there for me in 5d0319b

Screen.Recording.2023-11-10.at.11.58.14.AM.mov

@Karakatiza666
Copy link
Collaborator Author

Can reproduce, digging again

…o not send requests

Signed-off-by: George <bulakh.96@gmail.com>
@Karakatiza666
Copy link
Collaborator Author

Karakatiza666 commented Nov 10, 2023

If I make an empty pipeline, and don't assign a program to it in the config.. the status shows as compiling but shouldn't

I'll fix it in a separate PR, it's not related to this fix

* @returns
*/
const consolidatePipelineStatus = (newPipeline: Pipeline, oldPipeline: Pipeline | undefined) => {
const current_status =
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we make this more readable? e.g. something like

Suggested change
const current_status =
const isNotDesired = newPipeline.state.current_status !== toClientPipelineStatus(newPipeline.state.desired_status)
const isNotFailed = newPipeline.state.current_status !== PipelineStatus.FAILED
const oldHasStatus = oldPipeline?.state.current_status
const oldWasTransitioning = oldHasStatus && [PipelineStatus.STARTING, PipelineStatus.PAUSING, PipelineStatus.SHUTTING_DOWN].includes(oldPipeline.state.current_status)
const current_status =
isNotDesired &&
isNotFailed &&
oldWasTransitioning
? oldPipeline.state.current_status
: newPipeline.state.current_status
return updatePipelineStatus('current_status', current_status)(newPipeline)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let me see

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice idea, added

@Karakatiza666 Karakatiza666 merged commit 70083e7 into main Nov 10, 2023
7 checks passed
@Karakatiza666 Karakatiza666 deleted the fix-buttons branch November 10, 2023 21:06
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.

None yet

2 participants