@@ -76,7 +76,7 @@ async def write_section(*args, **kwargs):
76
76
77
77
78
78
class NewFooterSectionWriter (BaseSectionWriter ):
79
- async def do_write_section (self , comparison , diff , changes , links ):
79
+ async def do_write_section (self , comparison , diff , changes , links , behind_by = None ):
80
80
repo_service = comparison .repository_service .service
81
81
yield ("" )
82
82
yield (
@@ -94,7 +94,7 @@ async def do_write_section(self, comparison, diff, changes, links):
94
94
95
95
96
96
class NewHeaderSectionWriter (BaseSectionWriter ):
97
- async def do_write_section (self , comparison , diff , changes , links ):
97
+ async def do_write_section (self , comparison , diff , changes , links , behind_by = None ):
98
98
yaml = self .current_yaml
99
99
base_report = comparison .base .report
100
100
head_report = comparison .head .report
@@ -148,6 +148,7 @@ async def do_write_section(self, comparison, diff, changes, links):
148
148
head_cov = round_number (yaml , Decimal (head_report .totals .coverage )),
149
149
)
150
150
)
151
+
151
152
else :
152
153
yield (
153
154
"> :exclamation: No coverage uploaded for {request_type} {what} (`{branch}@{commit}`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-{what}-commit)." .format (
@@ -175,6 +176,11 @@ async def do_write_section(self, comparison, diff, changes, links):
175
176
else :
176
177
yield "> Patch has no changes to coverable lines."
177
178
179
+ if behind_by :
180
+ yield (
181
+ f"> Report is { behind_by } commits behind head on { pull_dict ['base' ]['branch' ]} ."
182
+ )
183
+
178
184
if (
179
185
comparison .enriched_pull .provider_pull is not None
180
186
and comparison .head .commit .commitid
@@ -226,7 +232,7 @@ async def do_write_section(self, comparison, diff, changes, links):
226
232
227
233
228
234
class HeaderSectionWriter (BaseSectionWriter ):
229
- async def do_write_section (self , comparison , diff , changes , links ):
235
+ async def do_write_section (self , comparison , diff , changes , links , behind_by = None ):
230
236
yaml = self .current_yaml
231
237
base_report = comparison .base .report
232
238
head_report = comparison .head .report
@@ -261,6 +267,7 @@ async def do_write_section(self, comparison, diff, changes, links):
261
267
links = links ,
262
268
)
263
269
)
270
+
264
271
else :
265
272
yield (
266
273
"> :exclamation: No coverage uploaded for pull request {what} (`{branch}@{commit}`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-{what}-commit)." .format (
@@ -272,6 +279,11 @@ async def do_write_section(self, comparison, diff, changes, links):
272
279
)
273
280
)
274
281
282
+ if isinstance (behind_by , int ) and behind_by > 0 :
283
+ yield (
284
+ f"> Report is { behind_by } commits behind head on { pull_dict ['base' ]['branch' ]} ."
285
+ )
286
+
275
287
diff_totals = head_report .apply_diff (diff )
276
288
if diff_totals and diff_totals .coverage is not None :
277
289
yield (
@@ -347,7 +359,7 @@ async def do_write_section(*args, **kwargs):
347
359
348
360
349
361
class ImpactedEntrypointsSectionWriter (BaseSectionWriter ):
350
- async def do_write_section (self , comparison , diff , changes , links ):
362
+ async def do_write_section (self , comparison , diff , changes , links , behind_by = None ):
351
363
overlay = comparison .get_overlay (OverlayType .line_execution_count )
352
364
impacted_endpoints = await overlay .find_impacted_endpoints ()
353
365
if impacted_endpoints :
@@ -367,7 +379,7 @@ async def do_write_section(self, comparison, diff, changes, links):
367
379
368
380
369
381
class FooterSectionWriter (BaseSectionWriter ):
370
- async def do_write_section (self , comparison , diff , changes , links ):
382
+ async def do_write_section (self , comparison , diff , changes , links , behind_by = None ):
371
383
pull_dict = comparison .enriched_pull .provider_pull
372
384
yield ("------" )
373
385
yield ("" )
@@ -393,7 +405,7 @@ async def do_write_section(self, comparison, diff, changes, links):
393
405
394
406
395
407
class ReachSectionWriter (BaseSectionWriter ):
396
- async def do_write_section (self , comparison , diff , changes , links ):
408
+ async def do_write_section (self , comparison , diff , changes , links , behind_by = None ):
397
409
pull = comparison .enriched_pull .database_pull
398
410
yield (
399
411
"[]({}?src=pr&el=tree)" .format (
@@ -411,7 +423,7 @@ async def do_write_section(self, comparison, diff, changes, links):
411
423
412
424
413
425
class DiffSectionWriter (BaseSectionWriter ):
414
- async def do_write_section (self , comparison , diff , changes , links ):
426
+ async def do_write_section (self , comparison , diff , changes , links , behind_by = None ):
415
427
base_report = comparison .base .report
416
428
head_report = comparison .head .report
417
429
if base_report is None :
@@ -432,7 +444,7 @@ async def do_write_section(self, comparison, diff, changes, links):
432
444
433
445
434
446
class FileSectionWriter (BaseSectionWriter ):
435
- async def do_write_section (self , comparison , diff , changes , links ):
447
+ async def do_write_section (self , comparison , diff , changes , links , behind_by = None ):
436
448
# create list of files changed in diff
437
449
base_report = comparison .base .report
438
450
head_report = comparison .head .report
@@ -535,7 +547,7 @@ def tree_cell(typ, path, metrics, _=None):
535
547
536
548
537
549
class FlagSectionWriter (BaseSectionWriter ):
538
- async def do_write_section (self , comparison , diff , changes , links ):
550
+ async def do_write_section (self , comparison , diff , changes , links , behind_by = None ):
539
551
# flags
540
552
base_report = comparison .base .report
541
553
head_report = comparison .head .report
@@ -683,7 +695,9 @@ async def _get_table_data_for_components(
683
695
)
684
696
return component_data
685
697
686
- async def do_write_section (self , comparison : ComparisonProxy , diff , changes , links ):
698
+ async def do_write_section (
699
+ self , comparison : ComparisonProxy , diff , changes , links , behind_by = None
700
+ ):
687
701
all_components = get_components_from_yaml (self .current_yaml )
688
702
if all_components == []:
689
703
return # fast return if there's noting to process
0 commit comments