Skip to content

Fix incorrect redirects to newer prebuilds #20047

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

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

filiptronicek
Copy link
Member

@filiptronicek filiptronicek commented Jul 18, 2024

Description

The method for triggering a new prebuild is currently a query, because it made it integrating into the UI easier. That came with some unintended consequences in caching though, hence this PR which converts it into a standard mutation.

What happened is that for some reason, the query we used with cacheTime: 0 still kept some cache for quite some time, meaning that going to prebuilds which were not the latest one caused the cache to retrieve the latest triggered prebuild id and redirect to it. This to the user looked like the prebuild they just clicked on was behaving weirdly without status updates, but in fact it was a completely different prebuild.

Related Issue(s)

Fixes ENT-471

How to test

https://ft-fix-pre38d051c02d.preview.gitpod-dev.com/repositories

  1. Import a repository and set it up for prebuilds
  2. Run a prebuild and wait for it to finish
  3. Click Rerun Prebuild
  4. Wait for the prebuild to be triggered
  5. Go back to the prebuild list
  6. Click on the finished prebuild

/hold

@mustard-mh
Copy link
Contributor

I don't understand why this PR could fix the linked issue

Copy link
Contributor

@mustard-mh mustard-mh left a comment

Choose a reason for hiding this comment

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

🚀

@roboquat roboquat merged commit 8df5d2f into main Jul 18, 2024
57 of 58 checks passed
@roboquat roboquat deleted the ft/fix-prebuild-redirection branch July 18, 2024 14:19
["prebuild-trigger", configurationId, gitRef],
async () => {
export function useTriggerPrebuildMutation(configurationId?: string, gitRef?: string) {
return useMutation({
Copy link
Member

Choose a reason for hiding this comment

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

😮 Wow, nice find! I'm 💯 I reviewed this function this week, and just glanced over this 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants