Update outlook dependency for v2 compile boundary
This commit is contained in:
@@ -273,7 +273,7 @@ Outlook fields:
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `id`, `provider`, `product`, `outlookType`, `label` | string | required when an outlook is present |
|
| `id`, `provider`, `product`, `outlookType`, `label` | string | required when an outlook is present |
|
||||||
| `day` | integer | SPC outlook day |
|
| `day` | integer | SPC outlook day |
|
||||||
| `labelText`, `forecaster`, `headline`, `summary`, `discussion` | string | optional |
|
| `labelText`, `forecaster` | string | optional |
|
||||||
| `severityRank` | integer | optional |
|
| `severityRank` | integer | optional |
|
||||||
| `validFrom`, `validTo`, `issuedAt`, `expiresAt` | RFC3339 datetime | required when an outlook is present |
|
| `validFrom`, `validTo`, `issuedAt`, `expiresAt` | RFC3339 datetime | required when an outlook is present |
|
||||||
| `sourceUrl`, `imageUrl` | string | optional |
|
| `sourceUrl`, `imageUrl` | string | optional |
|
||||||
|
|||||||
@@ -160,8 +160,8 @@ routes.
|
|||||||
|
|
||||||
`outlook_index`, `outlook_id`, `provider`, `product`, `day`, `outlook_type`,
|
`outlook_index`, `outlook_id`, `provider`, `product`, `day`, `outlook_type`,
|
||||||
`label`, `label_text`, `severity_rank`, `valid_from`, `valid_to`, `issued_at`,
|
`label`, `label_text`, `severity_rank`, `valid_from`, `valid_to`, `issued_at`,
|
||||||
`expires_at`, `forecaster`, `headline`, `summary`, `discussion`, `source_url`,
|
`expires_at`, `forecaster`, `source_url`, `image_url`, `contains_location`,
|
||||||
`image_url`, `contains_location`, `geometry_json`, and `run_event_id`.
|
`geometry_json`, and `run_event_id`.
|
||||||
|
|
||||||
`geometry_json` is copied into response GeoJSON without parsing or
|
`geometry_json` is copied into response GeoJSON without parsing or
|
||||||
reserializing. It must contain valid JSON.
|
reserializing. It must contain valid JSON.
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -4,7 +4,7 @@ go 1.25.5
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
gitea.maximumdirect.net/ejr/feedapi v0.1.0
|
gitea.maximumdirect.net/ejr/feedapi v0.1.0
|
||||||
gitea.maximumdirect.net/ejr/weatherfeeder v0.11.0
|
gitea.maximumdirect.net/ejr/weatherfeeder v0.11.1-0.20260612044033-4358a7cdce2c
|
||||||
github.com/lib/pq v1.10.9
|
github.com/lib/pq v1.10.9
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -1,7 +1,7 @@
|
|||||||
gitea.maximumdirect.net/ejr/feedapi v0.1.0 h1:ZB5QWKD5DPFV3P7vyeJqXPMcSWN9qHkDUHw1LgN9hwY=
|
gitea.maximumdirect.net/ejr/feedapi v0.1.0 h1:ZB5QWKD5DPFV3P7vyeJqXPMcSWN9qHkDUHw1LgN9hwY=
|
||||||
gitea.maximumdirect.net/ejr/feedapi v0.1.0/go.mod h1:3fIaFFx4ywt0TWbN8DIIBAHJn7ZQUm6PNcceqRgy3bw=
|
gitea.maximumdirect.net/ejr/feedapi v0.1.0/go.mod h1:3fIaFFx4ywt0TWbN8DIIBAHJn7ZQUm6PNcceqRgy3bw=
|
||||||
gitea.maximumdirect.net/ejr/weatherfeeder v0.11.0 h1:4hRiktLMFS8Arl98j21YYskXT8RHHQGFDPJxOF3CpwU=
|
gitea.maximumdirect.net/ejr/weatherfeeder v0.11.1-0.20260612044033-4358a7cdce2c h1:rsAqwmsd2QswAJpfEYi8IStkc+7mlxWGyMKppmjO7m0=
|
||||||
gitea.maximumdirect.net/ejr/weatherfeeder v0.11.0/go.mod h1:VVtuwrbddWdUu21ovCSSojhH5J9P6kk0/dfnFqC4/Lw=
|
gitea.maximumdirect.net/ejr/weatherfeeder v0.11.1-0.20260612044033-4358a7cdce2c/go.mod h1:VVtuwrbddWdUu21ovCSSojhH5J9P6kk0/dfnFqC4/Lw=
|
||||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
|
|||||||
@@ -44,9 +44,6 @@ func copyOutlook(outlook model.WeatherOutlook, tz *time.Location) model.WeatherO
|
|||||||
IssuedAt: inLocationTime(outlook.IssuedAt, tz),
|
IssuedAt: inLocationTime(outlook.IssuedAt, tz),
|
||||||
ExpiresAt: inLocationTime(outlook.ExpiresAt, tz),
|
ExpiresAt: inLocationTime(outlook.ExpiresAt, tz),
|
||||||
Forecaster: outlook.Forecaster,
|
Forecaster: outlook.Forecaster,
|
||||||
Headline: outlook.Headline,
|
|
||||||
Summary: outlook.Summary,
|
|
||||||
Discussion: outlook.Discussion,
|
|
||||||
SourceURL: outlook.SourceURL,
|
SourceURL: outlook.SourceURL,
|
||||||
ImageURL: outlook.ImageURL,
|
ImageURL: outlook.ImageURL,
|
||||||
ContainsLocation: outlook.ContainsLocation,
|
ContainsLocation: outlook.ContainsLocation,
|
||||||
|
|||||||
@@ -465,9 +465,6 @@ func TestOutlookRunPayloadTimezoneConversionAndCopySemantics(t *testing.T) {
|
|||||||
IssuedAt: issuedAt,
|
IssuedAt: issuedAt,
|
||||||
ExpiresAt: asOf.Add(6 * time.Hour),
|
ExpiresAt: asOf.Add(6 * time.Hour),
|
||||||
Forecaster: "DIAL",
|
Forecaster: "DIAL",
|
||||||
Headline: "Severe storms possible",
|
|
||||||
Summary: "Scattered severe storms are possible.",
|
|
||||||
Discussion: "Discussion text.",
|
|
||||||
SourceURL: "https://example.test/source",
|
SourceURL: "https://example.test/source",
|
||||||
ImageURL: "https://example.test/image.png",
|
ImageURL: "https://example.test/image.png",
|
||||||
ContainsLocation: true,
|
ContainsLocation: true,
|
||||||
|
|||||||
@@ -41,9 +41,6 @@ func mapOutlookRow(row outlookRow) (model.WeatherOutlook, error) {
|
|||||||
IssuedAt: row.IssuedAt.UTC(),
|
IssuedAt: row.IssuedAt.UTC(),
|
||||||
ExpiresAt: row.ExpiresAt.UTC(),
|
ExpiresAt: row.ExpiresAt.UTC(),
|
||||||
Forecaster: stringValue(row.Forecaster),
|
Forecaster: stringValue(row.Forecaster),
|
||||||
Headline: stringValue(row.Headline),
|
|
||||||
Summary: stringValue(row.Summary),
|
|
||||||
Discussion: stringValue(row.Discussion),
|
|
||||||
SourceURL: stringValue(row.SourceURL),
|
SourceURL: stringValue(row.SourceURL),
|
||||||
ImageURL: stringValue(row.ImageURL),
|
ImageURL: stringValue(row.ImageURL),
|
||||||
ContainsLocation: row.ContainsLocation,
|
ContainsLocation: row.ContainsLocation,
|
||||||
|
|||||||
@@ -79,9 +79,6 @@ func TestMapOutlookRowMapsFields(t *testing.T) {
|
|||||||
IssuedAt: issuedAt,
|
IssuedAt: issuedAt,
|
||||||
ExpiresAt: expiresAt,
|
ExpiresAt: expiresAt,
|
||||||
Forecaster: sql.NullString{String: "DIAL", Valid: true},
|
Forecaster: sql.NullString{String: "DIAL", Valid: true},
|
||||||
Headline: sql.NullString{String: "Severe storms possible", Valid: true},
|
|
||||||
Summary: sql.NullString{String: "Scattered severe storms are possible.", Valid: true},
|
|
||||||
Discussion: sql.NullString{String: "Discussion text.", Valid: true},
|
|
||||||
SourceURL: sql.NullString{String: "https://www.spc.noaa.gov/products/outlook/day1otlk.html", Valid: true},
|
SourceURL: sql.NullString{String: "https://www.spc.noaa.gov/products/outlook/day1otlk.html", Valid: true},
|
||||||
ImageURL: sql.NullString{String: "https://www.spc.noaa.gov/products/outlook/day1otlk.gif", Valid: true},
|
ImageURL: sql.NullString{String: "https://www.spc.noaa.gov/products/outlook/day1otlk.gif", Valid: true},
|
||||||
ContainsLocation: true,
|
ContainsLocation: true,
|
||||||
@@ -103,8 +100,8 @@ func TestMapOutlookRowMapsFields(t *testing.T) {
|
|||||||
if outlook.SeverityRank == nil || *outlook.SeverityRank != int(severityRank) {
|
if outlook.SeverityRank == nil || *outlook.SeverityRank != int(severityRank) {
|
||||||
t.Fatalf("expected severity rank %d, got %v", severityRank, outlook.SeverityRank)
|
t.Fatalf("expected severity rank %d, got %v", severityRank, outlook.SeverityRank)
|
||||||
}
|
}
|
||||||
if outlook.Forecaster != "DIAL" || outlook.Headline == "" || outlook.Summary == "" || outlook.Discussion == "" {
|
if outlook.Forecaster != "DIAL" {
|
||||||
t.Fatalf("unexpected text fields: %+v", outlook)
|
t.Fatalf("unexpected forecaster: %+v", outlook)
|
||||||
}
|
}
|
||||||
if outlook.SourceURL == "" || outlook.ImageURL == "" {
|
if outlook.SourceURL == "" || outlook.ImageURL == "" {
|
||||||
t.Fatalf("expected source and image URLs: %+v", outlook)
|
t.Fatalf("expected source and image URLs: %+v", outlook)
|
||||||
@@ -142,8 +139,7 @@ func TestMapOutlookRowMissingOptionals(t *testing.T) {
|
|||||||
t.Fatalf("unexpected error: %v", err)
|
t.Fatalf("unexpected error: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if outlook.LabelText != "" || outlook.Forecaster != "" || outlook.Headline != "" ||
|
if outlook.LabelText != "" || outlook.Forecaster != "" || outlook.SourceURL != "" || outlook.ImageURL != "" {
|
||||||
outlook.Summary != "" || outlook.Discussion != "" || outlook.SourceURL != "" || outlook.ImageURL != "" {
|
|
||||||
t.Fatalf("expected optional strings to map to empty values, got %+v", outlook)
|
t.Fatalf("expected optional strings to map to empty values, got %+v", outlook)
|
||||||
}
|
}
|
||||||
if outlook.SeverityRank != nil {
|
if outlook.SeverityRank != nil {
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ SELECT
|
|||||||
issued_at,
|
issued_at,
|
||||||
expires_at,
|
expires_at,
|
||||||
forecaster,
|
forecaster,
|
||||||
headline,
|
|
||||||
summary,
|
|
||||||
discussion,
|
|
||||||
source_url,
|
source_url,
|
||||||
image_url,
|
image_url,
|
||||||
contains_location,
|
contains_location,
|
||||||
|
|||||||
@@ -68,9 +68,6 @@ func (r *Repository) loadOutlooks(ctx context.Context, eventID string) ([]model.
|
|||||||
&row.IssuedAt,
|
&row.IssuedAt,
|
||||||
&row.ExpiresAt,
|
&row.ExpiresAt,
|
||||||
&row.Forecaster,
|
&row.Forecaster,
|
||||||
&row.Headline,
|
|
||||||
&row.Summary,
|
|
||||||
&row.Discussion,
|
|
||||||
&row.SourceURL,
|
&row.SourceURL,
|
||||||
&row.ImageURL,
|
&row.ImageURL,
|
||||||
&row.ContainsLocation,
|
&row.ContainsLocation,
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ type outlookRow struct {
|
|||||||
IssuedAt time.Time
|
IssuedAt time.Time
|
||||||
ExpiresAt time.Time
|
ExpiresAt time.Time
|
||||||
Forecaster sql.NullString
|
Forecaster sql.NullString
|
||||||
Headline sql.NullString
|
|
||||||
Summary sql.NullString
|
|
||||||
Discussion sql.NullString
|
|
||||||
SourceURL sql.NullString
|
SourceURL sql.NullString
|
||||||
ImageURL sql.NullString
|
ImageURL sql.NullString
|
||||||
ContainsLocation bool
|
ContainsLocation bool
|
||||||
|
|||||||
@@ -396,9 +396,6 @@ func testOutlook(id string, day int, outlookType string, containsLocation bool,
|
|||||||
IssuedAt: validFrom.Add(-time.Hour),
|
IssuedAt: validFrom.Add(-time.Hour),
|
||||||
ExpiresAt: validTo,
|
ExpiresAt: validTo,
|
||||||
Forecaster: "DIAL",
|
Forecaster: "DIAL",
|
||||||
Headline: id + " headline",
|
|
||||||
Summary: id + " summary",
|
|
||||||
Discussion: id + " discussion",
|
|
||||||
SourceURL: "https://example.test/" + id,
|
SourceURL: "https://example.test/" + id,
|
||||||
ImageURL: "https://example.test/" + id + ".png",
|
ImageURL: "https://example.test/" + id + ".png",
|
||||||
ContainsLocation: containsLocation,
|
ContainsLocation: containsLocation,
|
||||||
|
|||||||
@@ -15,12 +15,6 @@ Contains Location: {{$outlook.ContainsLocation}}
|
|||||||
{{- if $outlook.LabelText}}
|
{{- if $outlook.LabelText}}
|
||||||
Label Text: {{$outlook.LabelText}}
|
Label Text: {{$outlook.LabelText}}
|
||||||
{{- end}}
|
{{- end}}
|
||||||
{{- if $outlook.Headline}}
|
|
||||||
Headline: {{$outlook.Headline}}
|
|
||||||
{{- end}}
|
|
||||||
{{- if $outlook.Summary}}
|
|
||||||
Summary: {{$outlook.Summary}}
|
|
||||||
{{- end}}
|
|
||||||
{{- if $outlook.SourceURL}}
|
{{- if $outlook.SourceURL}}
|
||||||
Source URL: {{$outlook.SourceURL}}
|
Source URL: {{$outlook.SourceURL}}
|
||||||
{{- end}}
|
{{- end}}
|
||||||
|
|||||||
Reference in New Issue
Block a user