From 195a130124afa9a8ffe5f0a88a1ed8f0e2ae4e77 Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Tue, 9 Jun 2026 11:26:50 -0500 Subject: [PATCH] Updated defaults to upload only the current generated report path --- docs/config.md | 1 - docs/operations.md | 10 +++++----- examples/config.yml | 1 - internal/app/app_test.go | 1 - internal/config/config_test.go | 5 ++--- internal/config/defaults.go | 1 - internal/state/filesystem_test.go | 4 ++-- 7 files changed, 9 insertions(+), 14 deletions(-) diff --git a/docs/config.md b/docs/config.md index a35b2bb..493b321 100644 --- a/docs/config.md +++ b/docs/config.md @@ -103,7 +103,6 @@ weatherreporter uploads one distributor bundle per generated report after Markdown report source. Default: ```yaml - "{valid_start_date}/{artifact_group}/{valid_start_date}-{artifact_group}-{run_id}.md" - - "{valid_start_date}/{artifact_group}/latest.md" ``` Supported template variables are `location_id`, `report_id`, `run_id`, diff --git a/docs/operations.md b/docs/operations.md index 4fe79ef..2cf3fe8 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -147,8 +147,8 @@ attempted report. Notification fields are `notificationStatus`, Distributor notification is configured with `notify.distributor` and is disabled by default. When enabled, weatherreporter uploads the managed Markdown report path recorded in the report result and metadata. That single source file -can be mapped to multiple configured bundle paths, such as a dated archival path -and a `latest.md` path. Extra copies written by `--out` or `--out-dir` are +can be mapped to one or more configured bundle paths. By default, it is mapped +to one dated report path. Extra copies written by `--out` or `--out-dir` are operator conveniences only. The rendered pipeline ID selects the configured distributor `http_upload` @@ -160,9 +160,9 @@ weatherreporter.{location_id}.{report_id} ``` The default idempotency key appends RunID to the rendered bundle ID so each -report generation has a distinct retry identity. Default bundle paths use the -valid-period start date, artifact group, and RunID, and also publish -`latest.md` under the same dated artifact-group directory. +report generation has a distinct retry identity. The default bundle path uses +the valid-period start date, artifact group, and RunID. Distributor owns +destination merge, retention, and derived snapshot behavior such as `latest`. Notification happens after final metadata save. Weather API, briefing, data-package, render preflight, Scriptorium run, and metadata-save failures do diff --git a/examples/config.yml b/examples/config.yml index 54e28e1..5fcfd8e 100644 --- a/examples/config.yml +++ b/examples/config.yml @@ -26,7 +26,6 @@ notify: idempotency_key_template: "{bundle_id}.{run_id}" report_path_templates: - "{valid_start_date}/{artifact_group}/{valid_start_date}-{artifact_group}-{run_id}.md" - - "{valid_start_date}/{artifact_group}/latest.md" missing_source: default: warn diff --git a/internal/app/app_test.go b/internal/app/app_test.go index e6ec7ef..c6fa42a 100644 --- a/internal/app/app_test.go +++ b/internal/app/app_test.go @@ -337,7 +337,6 @@ func TestGenerateReportNotifiesManagedReportPath(t *testing.T) { } wantBundlePaths := []string{ "2026-05-29/daily/2026-05-29-daily-" + result.Metadata.RunID + ".md", - "2026-05-29/daily/latest.md", } if notificationArtifact.PipelineID != "weatherreporter.daily" || strings.Join(notificationArtifact.BundlePaths, "\n") != strings.Join(wantBundlePaths, "\n") || notificationArtifact.BundleCreated.IsZero() || notificationArtifact.RunStatus == nil || !strings.Contains(string(notificationArtifact.RunStatus.Report), "replace_older") { t.Fatalf("notification artifact = %#v, want requested pipeline, status report, and created timestamp", notificationArtifact) diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 881440e..fedc487 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -55,7 +55,6 @@ func TestDefaults(t *testing.T) { } wantReportPaths := []string{ "{valid_start_date}/{artifact_group}/{valid_start_date}-{artifact_group}-{run_id}.md", - "{valid_start_date}/{artifact_group}/latest.md", } if strings.Join(cfg.Notify.Distributor.ReportPathTemplates, "\n") != strings.Join(wantReportPaths, "\n") { t.Fatalf("Notify.Distributor.ReportPathTemplates = %#v, want %#v", cfg.Notify.Distributor.ReportPathTemplates, wantReportPaths) @@ -86,8 +85,8 @@ func TestLoadExampleConfig(t *testing.T) { if cfg.Notify.Distributor.PipelineIDTemplate != "weatherreporter.{artifact_group}" { t.Fatalf("PipelineIDTemplate = %q, want example pipeline template", cfg.Notify.Distributor.PipelineIDTemplate) } - if len(cfg.Notify.Distributor.ReportPathTemplates) != 2 { - t.Fatalf("ReportPathTemplates = %#v, want example archive and latest paths", cfg.Notify.Distributor.ReportPathTemplates) + if len(cfg.Notify.Distributor.ReportPathTemplates) != 1 { + t.Fatalf("ReportPathTemplates = %#v, want example archive path", cfg.Notify.Distributor.ReportPathTemplates) } } diff --git a/internal/config/defaults.go b/internal/config/defaults.go index 55f5dd0..76cf471 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -33,7 +33,6 @@ func Defaults() Config { IdempotencyKeyTemplate: "{bundle_id}.{run_id}", ReportPathTemplates: []string{ "{valid_start_date}/{artifact_group}/{valid_start_date}-{artifact_group}-{run_id}.md", - "{valid_start_date}/{artifact_group}/latest.md", }, }, }, diff --git a/internal/state/filesystem_test.go b/internal/state/filesystem_test.go index 860033a..5550cc0 100644 --- a/internal/state/filesystem_test.go +++ b/internal/state/filesystem_test.go @@ -69,7 +69,7 @@ func TestSaveArtifactsAndMetadataRoundTrip(t *testing.T) { BundleID: "weatherreporter.home.daily.run", IdempotencyKey: "weatherreporter.home.daily.run", SourcePath: "/tmp/report.md", - BundlePaths: []string{"2026-05-29/daily/report.md", "2026-05-29/daily/latest.md"}, + BundlePaths: []string{"2026-05-29/daily/report.md"}, BundleCreated: resolved.GeneratedAt, Status: "succeeded", RunStatus: &DistributorRunStatus{RunID: "distributor-run", Status: "succeeded"}, @@ -103,7 +103,7 @@ func TestSaveArtifactsAndMetadataRoundTrip(t *testing.T) { if err := json.Unmarshal(notificationData, ¬ification); err != nil { t.Fatalf("decode notification: %v", err) } - if notification.SchemaVersion != DistributorNotificationSchemaVersion || notification.PipelineID != "weatherreporter.daily" || len(notification.BundlePaths) != 2 || notification.RunStatus == nil || notification.RunStatus.Status != "succeeded" { + if notification.SchemaVersion != DistributorNotificationSchemaVersion || notification.PipelineID != "weatherreporter.daily" || len(notification.BundlePaths) != 1 || notification.RunStatus == nil || notification.RunStatus.Status != "succeeded" { t.Fatalf("notification = %#v, want persisted distributor status", notification) } paths, err := store.Paths(resolved)