Skip to content

Commit

Permalink
Don't calculate slo_resolve_remaining for old gates that were already…
Browse files Browse the repository at this point in the history
… resolved (#4677)

* Don't calculate slo_resolve_remaining for old gates that were already resolved.

* fixed-test
  • Loading branch information
jrobbins authored Jan 9, 2025
1 parent acab78e commit 2cfc8ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ def gate_value_to_json_dict(gate: Gate) -> dict[str, Any]:
if gate.resolved_on:
slo_resolve_took = max(0, slo.weekdays_between(
gate.requested_on, gate.resolved_on) - (gate.needs_work_elapsed or 0))
else:
elif gate.state != Vote.NEEDS_WORK and gate.state not in Gate.FINAL_STATES:
slo_resolve_remaining = slo.remaining_days(
gate.requested_on, slo_resolve) + (gate.needs_work_elapsed or 0)

Expand Down
2 changes: 1 addition & 1 deletion api/converters_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def test_maxmimal(self, mock_now):
'slo_initial_response_remaining': -1, # One weekday overdue.
'slo_resolve': approval_defs.DEFAULT_SLO_RESOLVE_LIMIT,
'slo_resolve_took': None,
'slo_resolve_remaining': 3,
'slo_resolve_remaining': None,
'needs_work_started_on': None,
}
self.assertEqual(expected, actual)
Expand Down
6 changes: 5 additions & 1 deletion client-src/elements/chromedash-gate-column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,11 @@ export class ChromedashGateColumn extends LitElement {
renderSLOStatusSkeleton() {
return html`
<details>
<summary>Reviewer SLO status:</summary>
<summary>SLO initial response:</summary>
Loading...
</details>
<details>
<summary>SLO resolution:</summary>
Loading...
</details>
`;
Expand Down

0 comments on commit 2cfc8ff

Please sign in to comment.