@weareikko/code-review 0.9.0 → 0.9.2

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.
@@ -560,7 +560,7 @@ function buildSummaryBody(summary, costFooter, options = {}) {
560
560
  return `${withFooter}\n\n${buildSummaryHistoryBlock(historyEntries)}`;
561
561
  }
562
562
  function buildReviewedCommitFooter(commitSha) {
563
- return `Reviewed by ${PRODUCT_LINK} v0.9.0 for commit ${commitSha}.`;
563
+ return `Reviewed by ${PRODUCT_LINK} v0.9.2 for commit ${commitSha}.`;
564
564
  }
565
565
  function extractReviewedCommitSha(body) {
566
566
  return REVIEWED_COMMIT_FOOTER_PATTERN.exec(body)?.[1] ?? null;
@@ -5236,6 +5236,25 @@ function buildAgentSubscriber(tracer, tokenUsage, operationCost, timeToFirstToke
5236
5236
  });
5237
5237
  };
5238
5238
  }
5239
+ /**
5240
+ * Applies our OTLP exporter env defaults, only when the caller hasn't set them
5241
+ * (explicit choices, including `none`, always win).
5242
+ *
5243
+ * Metrics stay on the SDK/backend default **cumulative** temporality. Delta
5244
+ * would be the textbook choice for short-lived CI jobs (cumulative series from
5245
+ * ephemeral jobs start mid-flight, so range aggregation of totals is operator-
5246
+ * dependent), but 0.9.1 defaulted to delta and it was verified to BREAK ingest
5247
+ * on Grafana Cloud — the OTLP endpoint silently dropped every delta-temporality
5248
+ * metric (a review's metrics never landed), so 0.9.2 reverted it. Do not force
5249
+ * delta here unless your backend is confirmed to ingest it (e.g. an OTel
5250
+ * Collector / Alloy running `deltatocumulative` in front of the backend). To
5251
+ * aggregate a range total from these cumulative ephemeral-job metrics, use
5252
+ * per-series `max_over_time`.
5253
+ */
5254
+ function applyOtelExporterDefaults(env = process.env) {
5255
+ env.OTEL_METRICS_EXPORTER = env.OTEL_METRICS_EXPORTER ?? "otlp";
5256
+ env.OTEL_LOGS_EXPORTER = env.OTEL_LOGS_EXPORTER ?? "otlp";
5257
+ }
5239
5258
  async function loadDefaultRuntime() {
5240
5259
  let modules;
5241
5260
  try {
@@ -5246,10 +5265,9 @@ async function loadDefaultRuntime() {
5246
5265
  const [sdkNode, resources, semconv] = modules;
5247
5266
  const serviceResource = resources.resourceFromAttributes({
5248
5267
  [semconv.ATTR_SERVICE_NAME ?? "service.name"]: SERVICE_NAME,
5249
- [semconv.ATTR_SERVICE_VERSION ?? "service.version"]: "0.9.0"
5268
+ [semconv.ATTR_SERVICE_VERSION ?? "service.version"]: "0.9.2"
5250
5269
  });
5251
- process.env.OTEL_METRICS_EXPORTER = process.env.OTEL_METRICS_EXPORTER ?? "otlp";
5252
- process.env.OTEL_LOGS_EXPORTER = process.env.OTEL_LOGS_EXPORTER ?? "otlp";
5270
+ applyOtelExporterDefaults(process.env);
5253
5271
  const sdk = new sdkNode.NodeSDK({ resource: resources.defaultResource().merge(serviceResource) });
5254
5272
  sdk.start();
5255
5273
  return {
@@ -5719,7 +5737,7 @@ function boldCommentTitle(body) {
5719
5737
  */
5720
5738
  function buildCommentBody(body, commitSha, confidence) {
5721
5739
  const confidenceLine = `_Confidence: ${confidence}._`;
5722
- const footer = `<sub>Reviewed by ${PRODUCT_LINK} v0.9.0 for commit ${commitSha}.</sub>`;
5740
+ const footer = `<sub>Reviewed by ${PRODUCT_LINK} v0.9.2 for commit ${commitSha}.</sub>`;
5723
5741
  return `${boldCommentTitle(body.trim())}\n\n${confidenceLine}\n\n---\n\n${footer}`;
5724
5742
  }
5725
5743
  function buildPayload(comment, body, refs, resolved) {
@@ -6826,10 +6844,10 @@ async function main(argv = process.argv.slice(2)) {
6826
6844
  return;
6827
6845
  }
6828
6846
  if (argv.includes("--version") || argv.includes("-v")) {
6829
- console.log("0.9.0");
6847
+ console.log("0.9.2");
6830
6848
  return;
6831
6849
  }
6832
- process.stderr.write(`[code-review] @weareikko/code-review v0.9.0\n`);
6850
+ process.stderr.write(`[code-review] @weareikko/code-review v0.9.2\n`);
6833
6851
  assertNodeVersion();
6834
6852
  applyCodeReviewEnvPrefix();
6835
6853
  applyDefaultCacheRetention();
@@ -6852,4 +6870,4 @@ if (isDirectRun()) main().catch((error) => {
6852
6870
  //#endregion
6853
6871
  export { normalizeBody as $, SUMMARY_HISTORY_END as A, buildSummaryHistoryEntries as B, createDiagnosticContext as C, traceDiagnosticPhase as D, traceDiagnostic as E, SUMMARY_MARKER as F, findExistingSummaryNoteId as G, extractSummaryHistoryEntries as H, buildArchivedSummaryEntry as I, upsertSummaryNote as J, stripSummaryHistory as K, buildReviewedCommitFooter as L, SUMMARY_HISTORY_ENTRY_START as M, SUMMARY_HISTORY_LIMIT as N, normalizeSeverity as O, SUMMARY_HISTORY_START as P, fingerprints as Q, buildSizeNoticeBlock as R, DIAGNOSTIC_CHANNEL_PREFIX as S, diagnosticChannels as T, findExistingReviewedCommitSha as U, extractReviewedCommitSha as V, findExistingSummaryNote as W, extractDiffHunkContext as X, appendFingerprintMarkers as Y, extractExistingFingerprints as Z, resolveNpmSkillDir as _, main as a, parseReviewMarkdownWithWarnings as b, buildGeneratedComments as c, startOtelBridge as d, sha256 as et, filterDiff as f, parseSkillSpec as g, loadNamedSkill as h, formatUsageLine as i, SUMMARY_HISTORY_ENTRY_END as j, toGitLabReviewSeverity as k, buildPayload as l, gitSkillCacheKey as m, formatPerModelUsage as n, run as o, runReview as p, stripSummaryMarker as q, formatSkillsFooter as r, withHttpStamping as s, countPostedBySeverity as t, isOtelEnabled as u, resolveSkillCacheDir as v, createDiagnosticRunId as w, DIAGNOSTIC_CHANNEL_NAMES as x, parseReviewMarkdown as y, buildSummaryBody as z };
6854
6872
 
6855
- //# sourceMappingURL=cli-DK0kteLL.js.map
6873
+ //# sourceMappingURL=cli-D47EQ1qq.js.map