Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(UI): workspace restart button stops build before starting a new one#7301

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Kira-Pilot merged 7 commits intomainfromrestart-button-3/kira-pilot
Apr 28, 2023

Conversation

@Kira-Pilot
Copy link
Member

Resolves#6241 and replaces the reverted#7268.

I've added a test to ensure the restart button hook is called appropriately but React Query makes it difficult to test side effects so I'm effectively mocking thestopWorkspace api call and not thestartWorkspace api call. I will take a second look at this during a quieter day, but for the time being, smoke testing would be appreciated!

matifali reacted with heart emoji
Kira-Pilotand others added6 commitsApril 24, 2023 19:55
* Refactor primary buttons* refactor(site): Always show the main actions* Remove tests that are testes on Storybook* Fix tests* Fix keys* added restart btn---------Co-authored-by: BrunoQuaresma <bruno_nonato_quaresma@hotmail.com>
}
},
})
}
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Originally, I wanted to use an implementation closer to the following, which react query'sdocs suggest is possible:

 const requestStopWorkspace = useMutation({ mutationFn: stopWorkspace }) const requestStartWorkspace = useMutation({ mutationFn: startWorkspace })  const restartWorkspace = async () => {    try {      await requestStopWorkspace.mutateAsync(workspace.id)      await waitForStop(requestStopWorkspace.data)      await requestStartWorkspace.mutateAsync({        workspaceId,        templateVersionId,      })    } catch (error) {      ...       }  }

butmutateAsync does not seem to be working and the queries are not treated asynchronously.@BrunoQuaresma is this something you've run into before?

Copy link
Contributor

Choose a reason for hiding this comment

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

I put a comment above, I think you don't need to have each API call into a "query". You can have a single function to restart the workspace and wrap this function into a query.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Hmmm that's a good idea. Let me try it!

BrunoQuaresma reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@BrunoQuaresma Woo that's a lot better! Thanks!

BrunoQuaresma reacted with heart emoji
@ammario
Copy link
Member

Thank you for fixing this so quickly :)

Kira-Pilot reacted with thumbs up emoji

@Kira-PilotKira-Pilot requested a review frombpmctApril 27, 2023 20:08
Copy link
Member

@bpmctbpmct left a comment

Choose a reason for hiding this comment

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

Works as expected with AWS template (stops workspace then starts)

@Kira-PilotKira-Pilot merged commita2ff674 intomainApr 28, 2023
@Kira-PilotKira-Pilot deleted the restart-button-3/kira-pilot branchApril 28, 2023 18:16
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsApr 28, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@bpmctbpmctbpmct left review comments

@ammarioammarioAwaiting requested review from ammario

@sreyasreyaAwaiting requested review from sreya

+1 more reviewer

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@Kira-PilotKira-Pilot

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

feat: add a restart button

5 participants

@Kira-Pilot@ammario@BrunoQuaresma@bpmct

[8]ページ先頭

©2009-2025 Movatter.jp