Skip to content

Conversation

@boomanaiden154
Copy link
Contributor

There seem to be cases where the workflow status is completed but the jobs have not completed. We need to gracefully handle these changes to avoid a crash loop in the metrics container.

There seem to be cases where the workflow status is completed but the
jobs have not completed. We need to gracefully handle these changes to
avoid a crash loop in the metrics container.
@llvmbot llvmbot added the infrastructure Bugs about LLVM infrastructure label Nov 17, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 17, 2025

@llvm/pr-subscribers-infrastructure

Author: Aiden Grossman (boomanaiden154)

Changes

There seem to be cases where the workflow status is completed but the jobs have not completed. We need to gracefully handle these changes to avoid a crash loop in the metrics container.


Full diff: https://github.com/llvm/llvm-project/pull/168457.diff

1 Files Affected:

  • (modified) .ci/metrics/metrics.py (+7)
diff --git a/.ci/metrics/metrics.py b/.ci/metrics/metrics.py
index a6d6edbd547e7..4e665adaca3ae 100644
--- a/.ci/metrics/metrics.py
+++ b/.ci/metrics/metrics.py
@@ -370,6 +370,13 @@ def github_get_metrics(
             started_at = job.started_at
             completed_at = job.completed_at
 
+            if completed_at is None:
+                logging.info(
+                    "Workflow {} is marked completed but has a job without a "
+                    "completion timestamp."
+                )
+                continue
+
             # GitHub API can return results where the started_at is slightly
             # later then the created_at (or completed earlier than started).
             # This would cause a -23h59mn delta, which will show up as +24h


if completed_at is None:
logging.info(
"Workflow {} is marked completed but has a job without a "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the curly braces for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was meant to point to an ID through an fstring. Fixed now.

@github-actions
Copy link

🐧 Linux x64 Test Results

  • 193636 tests passed
  • 5829 tests skipped

@boomanaiden154 boomanaiden154 merged commit efee326 into llvm:main Nov 18, 2025
10 of 13 checks passed
@boomanaiden154 boomanaiden154 deleted the fix-metrics-completed-time-none branch November 18, 2025 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Bugs about LLVM infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants