Alerting: Refactor the ImageStore/Provider to provide image URL/bytes (#67693)

* (WIP) Refactor the ImageStore interface to work with our latest alerting repository

* update alerting package

* refactor, new URLExists method in ImageProvider

* tests for the new methods

* fix linter warnings

* use alertingImages as an alias for grafana/alerting/images

* logs about image uris and not found images

* nerf image not found logs

* extract duplicated code to getImageFromURI() method

* refactor getImageFromURI()

* add index on url

* add comment about migration log

* sync generated files
This commit is contained in:
Santiago
2023-05-30 11:25:55 -03:00
committed by GitHub
parent ce0c1f0b0b
commit 72a187b0be
10 changed files with 365 additions and 31 deletions

View File

@@ -24,6 +24,11 @@ func AddTablesMigrations(mg *migrator.Migrator) {
mg.AddMigration("add last_applied column to alert_configuration_history", migrator.NewAddColumnMigration(migrator.Table{Name: "alert_configuration_history"}, &migrator.Column{
Name: "last_applied", Type: migrator.DB_Int, Nullable: false, Default: "0",
}))
mg.AddMigration("add index in alert_image on url", migrator.NewAddIndexMigration(migrator.Table{Name: "alert_image"}, &migrator.Index{
Cols: []string{"url"}, Type: migrator.IndexType,
}))
// End of migration log, add new migrations above this line.
}
// historicalTableMigrations contains those migrations that existed prior to creating the improved messaging around migration immutability.