-
Notifications
You must be signed in to change notification settings - Fork 162
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: build-cards not updating automatically without page refresh #158
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please do some testing with this to make sure it is safe? Originally there was only a single element with id="pipelines"
but now there can be multiple elements with class="pipelines"
. Do all of them have a trigger, or only just some? Are we correctly applying the trigger onto each one? Answers to these types of questions would give me confidence in this change.
Hi @basil I took some time to investigate this. Here's what I understand and why the change in the PR can be merged without issues.
|
But there previously was, in a past commit where the HTML and JavaScript were logically consistent. Then at some point in the commit history the layout was changed without updating the JavaScript. So we need to understand why and how the layout was changed in a previous commit, why that introduced an inconsistency by not updating the corresponding JavaScript, and how this PR addresses that inconsistency. (AI will not be of much help in constructing this argument.) |
Sorry - I misunderstood what you were asking. I found the specific PR that includes the change from Going further back, this cfe5712 is the original commit (Feb 29, 2012) that adds the line to get that Given that it’s been unchanged since then, it may have just been an oversight in #95. How it was not noticed until then is strange, but I imagine it has to do with the fact that when you manually hit refresh on the browser, fresh data from the server is pulled in and the cards display that information accordingly. It is only when you hit re-run and do nothing that you do not see cards updating. With this change, if you do hit re-run and wait, eventually the updates propagate to the downstream cards and they update correctly. |
I am just not seeing a clear argument here. Yes #95 introduced a regression that has gone unnoticed, but how? And how does this PR fix it? Please read e.g. https://github.com/delphix/.github/blob/master/pull_request_template.md?plain=1 and formulate this PR in this manner, including testing done. Explaining how #95 introduced a regression would go under the "Evaluation" section. Five Whys would be helpful here. The testing section should explain how to reproduce the original problem and how this PR addresses the problem. |
build-pipeline.js
This issue was discovered when working to improve CSP compatibility in the plugin. When working on #150, I noticed that downstream build-cards were not being updated automatically unless I manually refreshed the page.
Problem
BuildPipelineView/bpp.jelly
#150 but I am adding for consistency). The problem here is thatbuild.getStatus()
is being used as a static check whose values are not updated unless we manually refresh the page and re-fetch the data. So, when we click rerun on a build card, the triggers are fired and never caught because the user has not refreshed the page and the build status is showing whatever it showed when the page first loaded up. \##Evaluation (RCA)
Solution
table.pipelines
class.build.getStatus() == "PENDING"
check which prevents the triggers from being caught and processed correctly.Testing done
BEFORE
AFTER
To reproduce the problem:
2.In the upstream project, execute a shell with
sleep 5
andexit 0
and in the post-build steps, have the upstream build the downstream project.sleep 5
andexit 0
.One concern is that the previously there might have been a single #pipelines element while now there may be many elements with
class="pipelines"
. This is not an issue as even if we display multiple build histories, each of those steams contain specific build IDs relative to that build stream. When the triggers are fired, they are sent to an array of dependencies which include build IDs specific to that stream. Therefore, we may see triggers for all of those pipelines, but when they are caught and processed, they correctly update cards in their scope.Below image shows an example of this:
Submitter checklist