Skip to content

Instantly share code, notes, and snippets.

@grahama1970
Created October 19, 2025 14:50
Show Gist options
  • Select an option

  • Save grahama1970/dab97fb3e4869ae40dfec748653ab9c5 to your computer and use it in GitHub Desktop.

Select an option

Save grahama1970/dab97fb3e4869ae40dfec748653ab9c5 to your computer and use it in GitHub Desktop.
Copilot unblock patch
diff --git a/devops_agent/metrics.py b/devops_agent/metrics.py
index 992882f8..5be5cbb7 100644
--- a/devops_agent/metrics.py
+++ b/devops_agent/metrics.py
@@ -23,6 +23,15 @@ def inc_counter(name: str, labels: dict | None = None, amount: float = 1.0) -> N
_flush_unlocked(path)
+def write_metric(name: str, labels: dict | None = None, amount: float = 1.0) -> None:
+ """
+ Back-compat shim expected by review-auto and other paths.
+ Simply increments a counter metric with optional labels.
+ No-op unless DEVOPS_METRICS_DIR is set.
+ """
+ inc_counter(name=name, labels=labels, amount=amount)
+
+
def _flush_unlocked(path: str) -> None:
lines = []
by_metric: Dict[str, list[Tuple[Tuple[Tuple[str, str], ...], float]]] = {}
@@ -42,4 +51,3 @@ def _flush_unlocked(path: str) -> None:
with open(tmp, "w", encoding="utf-8") as fh:
fh.write("\n".join(lines) + "\n")
os.replace(tmp, path)
-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment