S19: share workstation runner and move agent workflows to landscape

This commit is contained in:
2026-11-10 08:14:35 +01:00
parent c25ce11a1b
commit 46df72f008
40 changed files with 334 additions and 498 deletions

View File

@@ -4,7 +4,13 @@ import org.w3c.dom.Element;
/** Exact module-wide line gate; consumes JaCoCo XML without rounding percentages. */
public class Coverage {
public static void main(String[] args) throws Exception {
/**
* Gates a JaCoCo XML report at 80 percent module line coverage without rounding.
*
* @param args the report path as the sole argument
* @throws Exception if the report cannot be read, has no line counter, or fails the coverage gate
*/
public static void main(final String... args) throws Exception {
final var factory = DocumentBuilderFactory.newInstance();
factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
@@ -18,8 +24,7 @@ public class Coverage {
final long covered = Long.parseLong(counter.getAttribute("covered"));
final long missed = Long.parseLong(counter.getAttribute("missed"));
final long total = covered + missed;
System.out.println(
"Backend line coverage: " + covered + "/" + total + " (" + 100.0 * covered / total + "%)");
IO.println("Backend line coverage: " + covered + "/" + total + " (" + 100.0 * covered / total + "%)");
if (total == 0 || 5 * covered < 4 * total)
throw new IllegalStateException("Backend line coverage must reach 80%: " + args[0]);
return;

View File

@@ -9,7 +9,13 @@ import org.openrewrite.text.*;
/** Source-launcher bootstrap: no project-specific artifact is resolved or installed. */
public class Format {
public static void main(String[] args) throws Exception {
/**
* Checks or atomically formats configured handwritten Java sources with the pinned formatter.
*
* @param args consumer repository root followed by either {@code check} or {@code apply}
* @throws Exception if configuration, parsing or formatting fails, or check mode finds differences
*/
public static void main(final String... args) throws Exception {
Path root = Path.of(args[0]).toAbsolutePath().normalize();
boolean check = switch (args[1]) {
case "check" -> true;
@@ -64,7 +70,7 @@ public class Format {
.getChangeset()
.getAllResults();
for (Result result : results) {
System.out.println((check ? "Needs formatting: " : "Formatted: ")
IO.println((check ? "Needs formatting: " : "Formatted: ")
+ result.getAfter().getSourcePath());
}
if (check && !results.isEmpty()) {
@@ -96,8 +102,7 @@ public class Format {
try (var output = Files.newOutputStream(cacheFile)) {
cache.store(output, "Successfully formatted content only");
}
System.out.println(
"Palantir " + args[1] + ": " + sources.size() + " Java files, " + results.size() + " differences");
IO.println("Palantir " + args[1] + ": " + sources.size() + " Java files, " + results.size() + " differences");
}
static String digest(String value) throws Exception {

View File

@@ -28,7 +28,13 @@ public class Standards {
static final List<Waiver> waivers = new ArrayList<>();
public static void main(String[] args) throws Exception {
/**
* Checks configured backend sources and writes standards reports without changing maintained code.
*
* @param args the consumer repository root as the sole argument
* @throws Exception if configuration, resolution or parsing fails, or a blocking violation is found
*/
public static void main(final String... args) throws Exception {
findings.clear();
codeLines.clear();
types.clear();