@dragonshorn-studios/elyseum-cli 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -25088,25 +25088,13 @@ class GithubPRCommentCoverageReporter {
25088
25088
  let annotations = [];
25089
25089
  if (createAnnotations) {
25090
25090
  for (const file of diffCoverage.files) {
25091
- for (let lineBlock of file.lines.details || []) {
25092
- if (lineBlock.hit === 0) {
25093
- annotations.push({
25094
- path: file.file,
25095
- start_line: lineBlock.start,
25096
- end_line: lineBlock.end,
25097
- annotation_level: "failure",
25098
- title: "Lines not covered",
25099
- message: `Lines not covered`,
25100
- });
25101
- }
25102
- }
25103
25091
  for (let functionDetails of file.functions.details || []) {
25104
25092
  if (functionDetails.hit === 0) {
25105
25093
  annotations.push({
25106
25094
  path: file.file,
25107
25095
  start_line: functionDetails.line,
25108
25096
  end_line: functionDetails.line,
25109
- annotation_level: "failure",
25097
+ annotation_level: qualityGateFailed ? "warning" : "warning",
25110
25098
  title: "Function not covered",
25111
25099
  message: `Function ${functionDetails.name} not covered`,
25112
25100
  });
@@ -25118,7 +25106,7 @@ class GithubPRCommentCoverageReporter {
25118
25106
  path: file.file,
25119
25107
  start_line: branchDetails.line,
25120
25108
  end_line: branchDetails.line,
25121
- annotation_level: "failure",
25109
+ annotation_level: qualityGateFailed ? "warning" : "warning",
25122
25110
  title: "Branch not covered",
25123
25111
  message: `Branch not covered`,
25124
25112
  });
@@ -25133,7 +25121,7 @@ class GithubPRCommentCoverageReporter {
25133
25121
  head_sha: diffCoverage.headSha,
25134
25122
  status: "completed",
25135
25123
  conclusion: qualityGateFailed
25136
- ? "failure"
25124
+ ? "neutral"
25137
25125
  : qualityGateWarning
25138
25126
  ? "neutral"
25139
25127
  : "success",
@@ -25146,6 +25134,7 @@ class GithubPRCommentCoverageReporter {
25146
25134
  }
25147
25135
  error(message, details) {
25148
25136
  const annotationFilePath = Config$1.getInstance().getFirst(["reporter.coverage.github-pr-comment.annotation-file-path"], "coverage/github.pr.annotations.json");
25137
+ const commentName = Config$1.getInstance().getFirst(["reporter.coverage.github-pr-comment.comment-name"], "coverage/github.pr.coverage.md");
25149
25138
  if (!process.env.GITHUB_ACTIONS || !process.env.GITHUB_EVENT_NAME) {
25150
25139
  console.error("Not running in GitHub CI environment, skipping GitHub PR comment coverage reporter");
25151
25140
  return;
@@ -25153,7 +25142,7 @@ class GithubPRCommentCoverageReporter {
25153
25142
  let repoName = process.env.GITHUB_REPOSITORY || "";
25154
25143
  let repo = repoName.split("/")[1];
25155
25144
  let owner = repoName.split("/")[0];
25156
- let commentResultMd = `# Coverage Quality Gate\n\n> [!CAUTION]\n> ### Coverage Quality Gate Failed 🟥\n`;
25145
+ let commentResultMd = `# ${commentName}\n\n> [!CAUTION]\n> ### Coverage Quality Gate Failed 🟥\n`;
25157
25146
  commentResultMd += `> ${message}\n`;
25158
25147
  commentResultMd += `> ${JSON.stringify(details)}\n`;
25159
25148
  fs$1.writeFileSync(Config$1.getInstance().getFirst(["reporter.coverage.github-pr-comment.comment-file-path"], "coverage/github.pr.coverage.md"), commentResultMd);