Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class CoverageChecksPublisher {
private static final int TITLE_HEADER_LEVEL = 4;
private static final char NEW_LINE = '\n';
private static final String COLUMN = "|";
private static final String GAP = " ";

private final CoverageBuildAction action;
private final Node rootNode;
Expand Down Expand Up @@ -434,29 +435,23 @@ private String formatText(final TextFormat format, final String text) {
}

private String getTrendIcon(final String trend) {
if (trend.startsWith("+")) {
return " " + Icon.ARROW_UP.markdown;
}
else if (trend.startsWith("-")) {
return " " + Icon.ARROW_DOWN.markdown;
}
else if (trend.startsWith("n/a")) {
if (!StringUtils.containsAny(trend, "123456789") || trend.startsWith("n/a")) {
return StringUtils.EMPTY;
}
return " " + Icon.ARROW_RIGHT.markdown;
return GAP + (trend.startsWith("+") ? Icon.ARROW_UP.markdown : Icon.ARROW_DOWN.markdown);
}

private String getBulletListItem(final int level, final String text) {
int whitespaces = (level - 1) * TITLE_HEADER_LEVEL;
return String.join("", Collections.nCopies(whitespaces, " ")) + "* " + text + "\n";
return String.join("", Collections.nCopies(whitespaces, GAP)) + "* " + text + "\n";
}

private String getUrlText(final String text, final String url) {
return String.format("[%s](%s)", text, url);
}

private String getSectionHeader(final int level, final String text) {
return String.join("", Collections.nCopies(level, "#")) + " " + text + "\n\n";
return String.join("", Collections.nCopies(level, "#")) + GAP + text + "\n\n";
}

private ChecksConclusion getCheckConclusion(final QualityGateStatus status) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@

/**
* Resolves source code files on the agent using the stored paths of the coverage reports. Since these paths are
* relative this resolver tries to find the absolute paths by guessing the prefix to the relative path. It also
* relative, this resolver tries to find the absolute paths by guessing the prefix to the relative path. It also
* evaluates the defined source paths as prefixes when resolving the absolute paths.
*/
public class PathResolver {
/**
* Resolves source code files on the agent using the stored paths of the coverage reports. Since these paths are
* relative this resolver tries to find the absolute paths by guessing the prefix to the relative path. It also
* relative, this resolver tries to find the absolute paths by guessing the prefix to the relative path. It also
* evaluates the defined source paths as prefixes when resolving the absolute paths.
*
* @param relativePaths
Expand Down Expand Up @@ -71,7 +71,7 @@ public Map<String, String> resolvePaths(final Set<String> relativePaths,

/**
* Resolves source code files on the agent using the stored paths of the coverage reports. Since these paths are
* relative this resolver tries to find the absolute paths by guessing the prefix to the relative path. It also
* relative, this resolver tries to find the absolute paths by guessing the prefix to the relative path. It also
* evaluates the defined source paths as prefixes when resolving the absolute paths.
*/
static class AgentPathResolver extends MasterToSlaveFileCallable<RemoteResultWrapper<HashMap<String, String>>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ private CoverageBuildAction createCoverageBuildAction(final Node result) {

return new CoverageBuildAction(run, COVERAGE_ID, REPORT_NAME, StringUtils.EMPTY, result,
new QualityGateResult(), null, "refId",
new TreeMap<>(Map.of(Metric.LINE, Fraction.ONE_HALF, Metric.MODULE, Fraction.ONE_FIFTH)),
new TreeMap<>(Map.of(
Metric.LINE, Fraction.ONE_HALF,
Metric.MODULE, Fraction.ZERO,
Metric.PACKAGE, Fraction.ONE_HALF.negate())),
List.of(testCoverage), new TreeMap<>(Map.of(Metric.LINE, Fraction.ONE_HALF)), List.of(testCoverage),
new TreeMap<>(Map.of(Metric.LINE, Fraction.ONE_HALF)), List.of(testCoverage), false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
||Module Coverage|Package Coverage|File Coverage|Class Coverage|Method Coverage|Line Coverage|Branch Coverage|Instruction Coverage
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:
:feet: **Overall project**|100.00% (1/1)|100.00% (4/4)|70.00% (7/10)|83.33% (15/18)|95.10% (97/102)|91.02% (294/323)|93.97% (109/116)|93.33% (1260/1350)
:chart_with_upwards_trend: **Overall project (difference to reference job)**|+20.00% :arrow_up:|n/a|n/a|n/a|n/a|+50.00% :arrow_up:|n/a|n/a
:chart_with_upwards_trend: **Overall project (difference to reference job)**|+0.00%|-50.00% :arrow_down:|n/a|n/a|n/a|+50.00% :arrow_up:|n/a|n/a
:feet: **Modified files**|n/a|n/a|n/a|n/a|n/a|50.00% (1/2)|n/a|n/a
:chart_with_upwards_trend: **Modified files (difference to overall project)**|n/a|n/a|n/a|n/a|n/a|+50.00% :arrow_up:|n/a|n/a
:feet: **Modified code lines**|n/a|n/a|n/a|n/a|n/a|50.00% (1/2)|n/a|n/a
Expand Down