Skip to content

Commit

Permalink
Add support for not showing bad builds
Browse files Browse the repository at this point in the history
  • Loading branch information
LadyCailin committed Mar 30, 2024
1 parent acc50ac commit bca9230
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 3 deletions.
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,15 @@
<exclude>META-INF/**</exclude>
</excludes>
</filter>
<filter>
<artifact>org.jetbrains.kotlin:kotlin-stdlib:jar:*</artifact>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>META-INF/**</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
Expand Down
27 changes: 25 additions & 2 deletions src/main/java/io/swagger/client/model/BuildArtifact.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public class BuildArtifact {
@SerializedName("commitDetails")
private String commitDetails = null;

@SerializedName("poisoned")
private Boolean poisoned = null;

public BuildArtifact artifact(String artifact) {
this.artifact = artifact;
return this;
Expand Down Expand Up @@ -195,6 +198,24 @@ public void setCommitDetails(String commitDetails) {
this.commitDetails = commitDetails;
}

public BuildArtifact poisoned(Boolean poisoned) {
this.poisoned = poisoned;
return this;
}

/**
* A poisoned build shouldn&#x27;t be recommended. This is a build that is known to have had problems, but was already published, and will not be taken down.
* @return poisoned
**/
@Schema(required = true, description = "A poisoned build shouldn't be recommended. This is a build that is known to have had problems, but was already published, and will not be taken down.")
public Boolean isPoisoned() {
return poisoned;
}

public void setPoisoned(Boolean poisoned) {
this.poisoned = poisoned;
}


@Override
public boolean equals(java.lang.Object o) {
Expand All @@ -212,12 +233,13 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.link, buildArtifact.link) &&
Objects.equals(this.fullLink, buildArtifact.fullLink) &&
Objects.equals(this.sha, buildArtifact.sha) &&
Objects.equals(this.commitDetails, buildArtifact.commitDetails);
Objects.equals(this.commitDetails, buildArtifact.commitDetails) &&
Objects.equals(this.poisoned, buildArtifact.poisoned);
}

@Override
public int hashCode() {
return Objects.hash(artifact, buildId, name, date, link, fullLink, sha, commitDetails);
return Objects.hash(artifact, buildId, name, date, link, fullLink, sha, commitDetails, poisoned);
}


Expand All @@ -234,6 +256,7 @@ public String toString() {
sb.append(" fullLink: ").append(toIndentedString(fullLink)).append("\n");
sb.append(" sha: ").append(toIndentedString(sha)).append("\n");
sb.append(" commitDetails: ").append(toIndentedString(commitDetails)).append("\n");
sb.append(" poisoned: ").append(toIndentedString(poisoned)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/apps.methodscript.com/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ model BuildArtifact {
* May be an empty string, if the commit isn't known, never null.
*/
commitDetails: string,
/**
* A poisoned build shouldn't be recommended. This is a build that is known to have had problems, but
* was already published, and will not be taken down.
*/
poisoned: boolean,
};

/**
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/siteDeploy/resources/js/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@
}
}
}
if(showRecommended && first) {
if(showRecommended && first && !version.poisoned) {
html += " (Recommended)";
first = false;
}
if(version.poisoned) {
html += " (Bad build)";
}
html += "</li>";
}
html += "</ul></div>";
Expand Down

0 comments on commit bca9230

Please sign in to comment.