Skip to content
Permalink
Browse files
Fix for JENKINS-23912 -- changeset order now preserved
  • Loading branch information
prospero238 committed Jul 22, 2014
1 parent a565d5c commit 4087cbcfa3425af7b3b4a009eb52ee10c61c5a7f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
@@ -22,6 +22,8 @@ public class ExecutedChangesetAction implements Action {

private List<ChangeSet> failed = Lists.newArrayList();

private List<ChangeSetDetail> changeSetDetailList = Lists.newArrayList();

public ExecutedChangesetAction() {

}
@@ -68,12 +70,18 @@ public void addChangesetWithSql(ChangeSet changeSet, Sql[] sqls) {
return build;
}

public List<ChangeSetDetail> getChangeSetDetailList() {
return changeSetDetailList;
}

public void setBuild(AbstractBuild<?, ?> build) {
this.build = build;
}

public void addChangesetWithSql(ChangeSet changeSet, List<Sql> statementSqls) {
ChangeSetDetail changeSetDetail = ChangeSetDetail.createWithSql(changeSet, statementSqls);
changeSetDetailList.add(changeSetDetail);

changeSetDetails.put(changeSet, changeSetDetail);

}
@@ -8,34 +8,33 @@
<st:adjunct includes="org.kohsuke.stapler.codemirror.mode.plsql.plsql"/>
<st:adjunct includes="org.kohsuke.stapler.codemirror.theme.default"/>
<j:set var="executedChangeSets" value="${it.changeSetDetails}"/>

<h1>Executed changesets</h1>
<j:if test="${it.getChangeSetDetails().isEmpty()}">
No changesets were executed.
</j:if>
<ol>
<j:forEach items="${executedChangeSets.keySet()}" var="key">
<j:set var="ch" value="${executedChangeSets.get(key).getChangeSet()}"/>
<j:set var="detail" value="${executedChangeSets.get(key)}"/>

<j:forEach items="${it.getChangeSetDetailList()}" var="detail">
<j:set var="ch" value="${detail.getChangeSet()}"/>
<a id="${ch.id}"/>
<li class="changeSetItem">
<span class="changeSetId">${ch.id}</span>
by
<span class="changeSetAuthor">${ch.author}</span>
<span class="changeSetId">${ch.id}</span> by <span class="changeSetAuthor">${ch.author}</span>
<br/>
<j:if test="${ch.comments !=null}">
<span class="changeSetComment">${ch.comments}</span>
Comment: <span class="changeSetComment">${ch.comments}</span><br/>
</j:if>
<span class="sql">
<f:textarea codemirror-mode="sql"
codemirror-config="mode:'text/x-plsql',readOnly:true,lineWrapping:true,viewportMargin:'Infinity'"
value="${detail.getTruncatedSql()}"/>
</span>
<j:if test="${detail.isInNeedOfTruncate()}">
<em>...SQL Truncated...</em>
<em>...SQL below has been truncated...</em>
</j:if>

<span class="sql">
<f:textarea codemirror-mode="sql"
codemirror-config="mode:'text/x-plsql',readOnly:true,lineWrapping:true,viewportMargin:'Infinity'"
value="${detail.getTruncatedSql()}"/>
</span>
</li>


</j:forEach>
</ol>
<style type="text/css">
@@ -6,26 +6,25 @@
<j:if test="${executedChangeSets != null}">
<t:summary icon="/plugin/liquibase-runner/liquibase_icon48x48.png">
<br/>
<j:if test="${it.getChangeSetDetails().isEmpty()}">No Changesets Executed.</j:if>
<j:if test="${it.getChangeSetDetailList().isEmpty()}">No Changesets Executed.</j:if>

<j:if test="${!it.getChangeSetDetails().isEmpty()}">
<j:if test="${!it.getChangeSetDetailList().isEmpty()}">
<a href="${it.urlName}">Executed changeSets:</a>
<ul class="changeSetList">
<j:set var="changeSetIterator" value="${executedChangeSets.keySet().iterator()}"/>
<j:set var="displayedCount" value="${1}"/>

<j:while test="${changeSetIterator.hasNext() &amp;&amp; displayedCount &lt; 5 }">
<j:set value="${changeSetIterator.next()}" var="key"/>
<j:forEach items="${it.getChangeSetDetailList()}" end="8" var="changeSetDetail">
<j:set var="displayedCount" value="${displayedCount + 1}"/>
<j:set var="ch" value="${executedChangeSets.get(key).getChangeSet()}"/>
<j:set var="ch" value="${changeSetDetail.getChangeSet()}"/>
<li class="changeSetItem">
<span class="changeSetId" style="font-weight: bold;margin-right: 5px;">${ch.id}</span>
<a href="${it.urlName}#${ch.id}" style="font-weight: bold;margin-right: 5px;"><span class="changeSetId">${ch.id}</span></a>
by
<span class="changeSetAuthor">${ch.author}</span>

<br/>
</li>
</j:while>
<j:if test="${displayedCount &lt; executedChangeSets.keySet().size() }">
</j:forEach>
<j:if test="${displayedCount &lt; it.getChangeSetDetailList().size() }">
<a href="${it.urlName}">View All ${">>>"}</a>
</j:if>

1 comment on commit 4087cbc

@imod
Copy link
Member

@imod imod commented on 4087cbc Jan 12, 2015

Choose a reason for hiding this comment

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

Will you ever do a release of this plugin

Please sign in to comment.