* CloudMigrations: create snapshots of Library Elements
* CloudMigrations: render library element resource in resources table
* CloudMigrations: create newtype with necessary fields for library element creation
* Cloud migrations: store resource name in the cloud_migration_resource table
* remove unused function: convertMigrateDataResponseToDTO
* make swagger-clean && make openapi3-gen
* use DB_Text for cloud_migration_resource.name instead of DB_Varchar
* Cloud migrations: GetSnapshotList only returns snapshots that belong to a session that exists
* Cloud migrations: test GetSnapshotList
* add one more test case for GetSnapshotList
* fix test
* store encryption key for testing
* minor performance improvement
* apply a warning to any non-core plugins that successfully migrate
* commit frontend wip while I refactor some stuff
* update api
* repurpose error dialog to be a generic details dialog
* whitespace
* add unit test
* fixes from testing
* fix migration summary
* add comment
* fix localization stuff
* fix backend test
* reduce number of queries to the db
* some PR feedback
* whitespace
* send dashboard commands instead of dashboards
* move status updates before goroutine to ensure frontend polls
* fix syncing issues between snapshot state and resources
* make sessionUid a requirement for modifying snapshots
* move the function I meant to move earlier
* remove accidental commit
* another accidental commit
* verify UpdateSnapshot is called with sessionUid
* revert
* pass in session uid everywhere
* forgot to save
* fix unit test
* fix typo
* tiny tweak
* E2C: Add stat rollup to MigrationSummary
* fix report event url
* open form in new page
* sort folders by heirarchy
* undo accidental commit
* remove another commit
* make folder sorting dynamic
---------
Co-authored-by: joshhunt <josh@trtr.co>
* store encryption key in unified secrets table
* fix local dev mode
* make metadata more realistic
* fix tests
* fix sql queries against postgres
* fix stats endpoint
* add gms client function
* add timeout config for endpoint
* report events to gms
* fix lint error
* clean up report calls and make sure reports all have local ids
* extra validation
* improve error logging and fix url
* improve error handling a retries during async operations
* fix use of contexts
* updates to how we call the folder api
* fix urls for gms
* more progress on the folder issue
* fix folders
* refactor for readability
* implement querying gms for snapshot status
* add some documentation
* provide snapshot resources after snapshot is created
* add rate limiting to backend
* fix compilation error
* fix typo
* add unit tests
* finish merge
* lint
* swagger gen
* more testing
* remove duplicate test
* address a couple PR comments
* update switch statement to a map
* add timeouts to gms client through the http client
* remove extra whitespace
* put method back where it was so the PR is less confusing
* fix tests
* add todo
* fix final unit test
* Cloud migration: upload snapshot files using presigned url
* log error if index file cannot be closed
* log error if file cannot be closed in uploadUsingPresignedURL
* order session list descending
* add snapshot status method to store
* query stats while retrieving snapshot
* return stats in dto
* swagger
* fix tests
* commit results of bingo get
* fix swagger
* minor improvement
* fix typo
* forgot a file
* Cloud migrations: create snapshot and store it on disk
* fix merge conflicts
* implement StartSnapshot for gms client
* pass snapshot directory as argument to snapshot builder
* ensure snapshot folder is set
* make swagger-gen
* remove Test_ExecuteAsyncWorkflow
* pass signed in user to buildSnapshot method / use github.com/grafana/grafana-cloud-migration-snapshot to create snapshot files
* fix FakeServiceImpl.CreateSnapshot
* remove new line
* create a new table for migration resources
* remove raw result bytes from db
* more snapshot resource management stuff
* integrate new table with snapshots
* pass in result limit and offset as params
* combine create and update
* set up xorm store test
* add unit tests
* save some cpu
* remove unneeded arg
* regen swagger
* fix bug with result processing
* fix update create logic so that uid isn't required for lookup
* change offset to page
* regen swagger
* revert accidental changes to file
* curl command page should be 1 indexed
* add regex support for api tests
* revert dumb thing
* add api tests
* add unit test for core async workflow
* add xorm store unit tests
* fix typo
* remove unnecessary assignment
* add new apis
* add payloads
* create snapshot status type
* add some impl
* finish implementing update
* start implementing build snapshot func
* add more fake build logic
* add cancel endpoint. do some cleanup
* implement GetSnapshot
* implement upload snapshot
* merge onprem status with gms result
* get it working
* update comment
* rename list endpoint
* add query limit and offset
* add helper method to snapshot
* little bit of cleanup
* work on swagger annotations
* manual merge
* generate swagger specs
* clean up curl commands
* fix bugs found during final testing
* fix linter issue
* fix unit test
* chore(perf): Pre-allocate where possible (enable prealloc linter)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
* fix TestAlertManagers_buildRedactedAMs
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
* prealloc a slice that appeared after rebase
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
---------
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
* rename some stuff
* more renaming
* clean up api
* rename more functions
* rename cms -> gms
* update comment
* update swagger gen
* update endpoints
* overzealous
* final touches
* dont modify existing migrations
* break structs into domain and dtos
* add some conversion funcs
* fix build
* update frontend
* try to make swagger happy
* Cloud migration: create route to fetch cloud migration token
* implement gcomStub.ListTokens
* fix swagger for POST /cloudmigration/migration
* fix swagger for POST /cloudmigration/migration
* fix swagger for POST /cloudmigration/migration
* - Added migration to add a new collumn UID to both migration and migration_run tables.
- Added migration to set UID for records already existent in the database before adding a new column.
- Added UID field to CloudMigration and CloudMigrationRun dtos (model.go)
* Fix db migration
* Updating store and model
* Updating API to use UID
* fix typo
* update openapi specs and generated endpoints
* fix spec
* update openapi specs and generated endpoints
* Fixing db mapping
* Fix frontend
* fix migration
* remove migration uid from run fetch endpoint
* Revert "merge"
This reverts commit d654e4c530, reversing
changes made to 5fe0b483eb.
* manual merge
* rename some funcs for consistency
* make interfaces consistent
* validate uids
* update generated frontend api
* fix enterprise spec
* manually resolve api
* try again
* try yet again
* once more
---------
Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
* move run migration to the cloudmigrationimpl layer
* add migration run list logic down a layer
* remove useless comments
* pull cms calls into their own service