-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Platform: All, OS: All
If the manual promotion actions take sufficient time, the "Promotion Status"
page will display Failure status (with a link to lastFailed which gives a 404),
instead of indicating that the promotion actions are still ongoing. This will
only occur the first time a new build is being promoted.
To reproduce,
1) add a slow promotion action (my plugin is uploading a tar ball) and set it
for manual promotion.
2) Do a fresh build that's never been promoted.
3) Go to the promotion status page for this build.
4) Hit the force promotion button.
5) The page will immediately say "Promotion queued".
6) Reload (possibly a few times). If your promotion action is slow enough, you
should be able to hit a time after the promotion is out of the queue, but before
it is complete.
7) You'll see "promotion failed" and a link to the record.
8) If you click on the record link (which points to lastFailed), you'll get a 404.
9) When the promotion action is done, the "Promotion Status" page will show
successful status (assuming it is successful), with a working link.
This happens because there is a time delay after the promotion is set to
"attempted" with addPromotionAttempt, but before it is complete and either sets
the lastFailed or sets status to successful.
Here's a simple fix (although there may be better ones):
Index:
src/main/resources/hudson/plugins/promoted_builds/PromotedBuildAction/index.jelly
===================================================================
—
src/main/resources/hudson/plugins/promoted_builds/PromotedBuildAction/index.jelly (revision
12987)
+++
src/main/resources/hudson/plugins/promoted_builds/PromotedBuildAction/index.jelly (working
copy)
@@ -48,7 +48,14 @@
</j:choose>
</j:when>
<j:otherwise>
- Promotion failed (<a href="${p.name}/lastFailed">record</a>)
+ <j:choose>
+ <j:when test="${p.getLastFailed() == null}">
+ Promotion in progress (<a
href="${p.name}/lastSuccessful">record</a>)
+ </j:when>
+ <j:otherwise>
+ Promotion failed (<a href="${p.name}/lastFailed">record</a>)
+ </j:otherwise>
+ </j:choose>
</j:otherwise>
</j:choose>
</div>