Add option to not cache build run when calculating pause duration#313
Merged
Conversation
sarah-witt
marked this pull request as draft
October 21, 2022 20:52
sarah-witt
marked this pull request as ready for review
October 21, 2022 21:01
albertvaka
previously approved these changes
Oct 22, 2022
albertvaka
approved these changes
Oct 26, 2022
albertvaka
left a comment
Collaborator
There was a problem hiding this comment.
Seems safe to merge 👌
NouemanKHAL
approved these changes
Oct 26, 2022
sarah-witt
added a commit
that referenced
this pull request
Nov 9, 2022
* Use createNew * Add option * Determine what function to use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds an option to change the way we fetch a build when calculating pause duration as well as whether we cache the run when fetching it. Now, we don't cache our newly calculated run. Additionally, we create a new RunExt instead of potentially using a cached run.
Description of the Change
In some cases, caching the run when calculating it caches the incorrect build url
https://github.com/jenkinsci/pipeline-stage-view-plugin/blob/268cddaa96b69d92c06c994c611e0ef55c1bd1db/rest-api/src/main/java/com/cloudbees/workflow/rest/external/RunExt.java#L299
The
createfunction first checks if there is a cached run, and if there isn't creates a new run and then caches that run. We are just moving away from this function and usingcreateNewto not use the cache.Alternate Designs
Possible Drawbacks
Verification Process
Confirm we can still calculate the pause duration metric when using the new version of the plugin
Additional Notes
Release Notes
Review checklist (to be filled by reviewers)
changelog/label attached. If applicable it should have thebackward-incompatiblelabel attached.do-not-merge/label attached.kind/andseverity/labels attached at least.