Report warnings from the timebox resolver
What does this MR do and why?
If the timebox resolver is not able to produce a result, it adds an error to the timebox report object.
These errors include a localized message, as well as a static code
indicating the class of error (one
of [MISSING_DATES, UNSUPPORTED, TOO_MANY_EVENTS]
).
This is an example of the errors-as-data approach.
The TimeboxReport
object now looks like this:
OBJECT: TimeboxReport
Historically accurate report about the timebox.
fields:
┌────────────────┬────────────────────────┬────────────────────────┬───────────┐
│name │type │description │deprecated?│
│ │ │ │ │
├────────────────┼────────────────────────┼────────────────────────┼───────────┤
│burnupTimeSeries│[BurnupChartDailyTotals!│Daily scope and │No │
│ │] │completed totals for │ │
│ │ │burnup charts. │ │
├────────────────┼────────────────────────┼────────────────────────┼───────────┤
│stats │TimeReportStats │Represents the time │No │
│ │ │report stats for the │ │
│ │ │timebox. │ │
├────────────────┼────────────────────────┼────────────────────────┼───────────┤
│error │TimeReportError │Explains why we could │No │
│ │ │generate a timebox │ │
│ │ │report. │ │
└────────────────┴────────────────────────┴────────────────────────┴───────────┘
When TimeboxReport.error
is not null, then burnupTimeSeries
and
stats
are not null - i.e. this is a sum-type-ish object.
How to set up and validate locally
Run the following query for a project that has some milestones that lack a start date, a due date, or both:
query {
project(fullPath: "a/b/c") {
milestones {
title
report {
error { code } # only use this field on this branch
burnupTimeSeries { completedCount }
}
}
}
In %15.0, this returns no data, and contains an error explaining why (for one milestone).
On current master, this return null
for milestones for which
a report cannot be generated. No error is generated.
On this branch it always returns a report, and for each
milestone for which a report cannot be generated, the error
field
contains an object with a code.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.