Repository navigation
A job's times contain its steps, and a group iterates in queue order - #418
Merged
Merged
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 1 minor |
🟢 Metrics 18 complexity · 0 duplication
Metric Results Complexity 18 Duplication 0
🟢 Coverage 97.92% diff coverage · +0.05% coverage variation
Metric Results Coverage variation ✅ +0.05% coverage variation Diff coverage ✅ 97.92% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (354928f) 14013 11995 85.60% Head commit (c92f6b1) 14014 (+1) 12003 (+8) 85.65% (+0.05%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#418) 48 47 97.92% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Paebbels
force-pushed
the
claude/github-model-times
branch
from
September 19, 2026 22:45
21cfa15 to
ec0611c
Compare
Paebbels
reviewed
Sep 19, 2026
Review of pull-request #403 asked three times whether a helper of the tracing reader belongs on the data model. It does: all three are facts about GitHub's data, not about tracing, and every other consumer of the model would have to recompute them. * **A job's times contain its steps.** GitHub reports a job's times and its steps' times independently and in whole seconds, so a step is sometimes reported as starting before, or completing after, the job holding it. The job is the timespan that stretches - the step really did run when it says it did - so 'Job.CreatedAt', 'StartedAt' and 'CompletedAt' report the widened times. A job that hasn't completed still reports no completion, however far its steps got. * **A group iterates what it holds in the order it was queued**, jobs and nested groups alike, instead of jobs first and called workflows last. So a called workflow takes the place its first job was queued at. The sort is stable, so elements reporting no time keep the order GitHub listed them in. A flavour says what it holds in '_Contents'; the ordering is written once, in 'JobGroup.__iter__'. * **A group's times span what it holds**, so 'Workflow' loses the three overrides that aggregated jobs, matrices and called workflows by hand. A 'Pipeline' is the one group reporting times of its own, so it is the one with two sets: 'Contents{Created,Started,Completed}At' beside the run's own times. They differ, because a job may be queued before the run reports itself created. Twelve testcases: a step starting before and completing after its job, a job created after its first step started, a job whose steps are consistent, a running job whose step completed, a group covering the widened times, a run keeping its own times beside its contents', a workflow having only the one set, a group holding a running element, and the three ordering cases. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
Paebbels
force-pushed
the
claude/github-model-times
branch
from
September 19, 2026 22:59
ec0611c to
82ad1be
Compare
Paebbels
requested changes
Sep 19, 2026
Co-authored-by: Patrick Lehmann <Paebbels@gmail.com>
Merged
This was referenced Oct 12, 2026
Merged
Merged
Merged
This was referenced Oct 20, 2026
Merged
Merged
Merged
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Comes out of the review of #403, where you asked three times whether a helper of the tracing reader belongs on the data model. It does - all three are facts about GitHub's data, not about tracing - so they move here, and #403 is rebased onto this and loses them.
pyTooling.Tracing.CI.GitHubwas computing two things the model can answer itself: the order a group's contents were queued in, and the times a job's timespans have to span. Both would have to be recomputed by every other consumer of the model - a renderer, a report, a second reader - and both are things GitHub's payloads say, not things tracing needs.Changes
Job.CreatedAt,Job.StartedAtandJob.CompletedAtreport the widened times now. The job is the timespan that stretches, because the step really did run when it says it did - the alternative, clamping the step, throws away a fact to keep another one.A group's times follow, because
JobGroupandWorkflowaggregate the jobs' times, so nothing else changes to make a tree consistent. A job that hasn't completed still reports no completion, however far its steps got.JobGroup.CreatedAt,StartedAtandCompletedAtaggregate over what the group holds - its jobs, and for aWorkflowthe matrices and called workflows below it as well - computed once overiter(self).Workflowneeded three overrides and 77 lines of hand-written aggregation to say that, and has none.A
Pipelineis the one group reporting times of its own, so it is the one with two sets:ContentsCreatedAt,ContentsStartedAtandContentsCompletedAtspan what the run holds, beside the run's own times. They differ, because a job may be queued before the run reports itself created - which is exactly how a trace knows it has to widen.JobGroup.__iter__yielded the jobs in GitHub's listing order andWorkflow.__iter__yielded jobs, then matrices, then called workflows - so a called workflow whose jobs ran first still came last. Both order byCreatedAtnow, jobs and nested groups alike.The sort is stable, so elements reporting no time keep the order GitHub listed them in, and they sort behind everything that reports one.
Unit Tests
tests/unit/CI/GitHub.pygains two classes, 9 testcases:Times- a step starting before its job, a step completing after it, a job created after its first step started, a job whose steps are consistent (nothing widens), a running job whose step completed (no completion), and a group covering the widened times.Ordering- jobs ordered by queue time, a called workflow taking its first job's place rather than a place behind every job, and an element without a time sorting last while keeping GitHub's order.Documentation
doc/CI/GitHub.rststates both rules where it already explains that neither a called workflow nor a matrix reports times of its own.doc/News.rstlists them in thepyTooling.CIblock.Related Issues and Pull-Requests
_Contents,_JobTimesand_GroupTimes.