* Activate schema validation and align underlying systems
* update to save as v0 if not the right schema version
* Resolve merge conflicts
* Move RequireApiErrorStatus to tests package
* Add mutation tests
* Fix lint
* Only do min version check if dashboard is v1
* Fix lint and disable provisioning test
* Revert provisioning changes
* Revert more tests and add schema test
* Reran gen
* SQL Dashboard save
* Adjust APIVERSION
* Fixed mutation test
* Add logging on downgrade
---------
Co-authored-by: Marco de Abreu <18629099+marcoabreu@users.noreply.github.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
* role based fallback
* disable permissions cache with provisioning
* fallback to role based
* test with editor (not admin)
* test with editor (not admin)
* fix imports
* lint
* editor can create folders
* Split in multiple files
* Refactor sync even further
* Move more things between RepositoryResources
* Add status patcher
* Interface for sync functions
* Interface for compare function
* Add syncer back
* Move interfaces
* Move execute complete
* Return currentRef in syncer
* Add repository status test
* Add initial sync tests
* Fix a couple of spots
* Make initial sync tests work
* Fix register.go
* Add initial tests for sync worker
* Finish tests for sync
* Add incremental tests
* Add TODO
* Finish incremental tests
* Move folder creation to full sync
* Move interfaces
* Add initial full sync tests
* Update tests
* Reshape things
* Add changes test
* Fix register
* Add some tests
* Add more tests
* Add test
* WIP
* WIP: delete test
* Add more full test
* More tests
* Add tests for folder creation
* Add folder tests full sync
* Full coverage full sync
* Clean up tests
* Add more tests for changes function
* Enhance tests for Changes function to cover error scenarios and empty paths
- Added test cases for handling empty file paths and folder resources.
- Updated error message formatting in the Compare function for clarity.
* Add unit tests
* Failed initial patch
* Add tests failed repository resources
* Add test failed getting client
* Test for successful and unsuccessful syncs
* Add final tests for worker
* Fix existing tests
* Add missing test
* Fix spelling mistake
* Fix flake in changes test
* Add repository resources interface for export worker
* Add mocks for repository resources
* Add unit tests for ExportWorker's IsSupported method
* Add unit tests for ExportWorker's Process method, covering scenarios for missing export settings, write permissions, branch restrictions, and client creation failures.
* Fix unit tests
* Single function
* Add more unit tests
* Add test for failed folder
* Fail export folder errors
* Add another test
* Positive folder export
* Too many folder export errors
* Too many errors on folder export
* Partial folder errors
* Add test for nested folder
* Add test dashboard export
* More cases
* Ignore existing dashboards
* Fix folder tests
* Fix clonable test
* Add clone failure test
* Add test clean up without push
* Working tests
* Use mock clonable
* Add unit tests for IsWriteAllowed
* Add behaviour to cover ref equal to configured branch
* Fix worker test
* Fix linting
* Split clone and push
* Wrapper for clone and push
* Separate methods for resources export
* Separate folder export
* Simplify single signature
* Refactor a bit more
* Separate folder export function
* Split it into different files
* Add FIXME
* Export function mock
* Export Resources tests
* Add test for cannot find client
* Check for branch
* Fix registry
* Move folder export tests
* Pass wrapper function
* Add worker tests
* Fail if branch is passed for clonable repositories
* Fix merge issues
* Add repository resources interface for export worker
* Add mocks for repository resources
* Add unit tests for ExportWorker's IsSupported method
* Add unit tests for ExportWorker's Process method, covering scenarios for missing export settings, write permissions, branch restrictions, and client creation failures.
* Fix unit tests
* Single function
* Add more unit tests
* Add test for failed folder
* Fail export folder errors
* Add another test
* Positive folder export
* Too many folder export errors
* Too many errors on folder export
* Partial folder errors
* Add test for nested folder
* Add test dashboard export
* More cases
* Ignore existing dashboards
* Fix folder tests
* Fix clonable test
* Add clone failure test
* Add test clean up without push
* Working tests
* Use mock clonable
* Add unit tests for IsWriteAllowed
* Add behaviour to cover ref equal to configured branch
* Fix worker test
* Fix linting
* Split clone and push
* Wrapper for clone and push
* Run validation on config updates
* Refactor code
* Add debug lines
* Remove test check on admission
* Organize imports
* Delegate events to the API client
* Extend error notification
* Deep copy default data
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Clarity-89 <homes89@ukr.net>
* Use interface for factories
* Add most mocks to unit test jobs
* Generate more mocks for main jobs package
* Interface for parser
* Use clients directly without parser
* Regenerate mock
* Eliminate resource clients from Parser
* Interface for folder tree
* Separate DryRun into separate method
* Fix linting
* Remove errors
* Remove checks in dualwriter
* Fix unit tests
* Add TODOs
* Dry Run as non-critical error
* Add TODOs
* Address TODO
* Fix tests
* Fix linting
* Deprecate dashboard name from path completely
* Use MissingName error also in parser
* Return 206 for non-critical errors
* Remove TODOs for previous dry-run
* Record webhook pinged event
* Add TODO for webhook creation updated
* Hack to wire client
* Revert accidental change in controller
* Wire the client
* Use factory method
* Remove omit empty
* Regenerate client
* Fix compilation
* Every 30 seconds if not pinged
* Move lines around
* Use different approach
* Added as part of the controller
* Exponential backoff for waiting for ping
* More stuff
* Revert changes in controller
* Add separate webhook section in overview
* Change order of translations
* Update ping within 1 minute
* Last event update
* Extract translation
* Display last event in frontend
* Refactor the logic around update
* Fix the type to marshal
* Move to new repository
* Rename it to dual writer
* Rename the function
* Rename the methods
* Rename to exportResource
* Clean up logic in migrate and add TODOs
* Add TODOs
* Use generic client for unprovisioned
* ForEachResource
* More consolidation
* Refactor more around client
* Consolidate constants
* ForEachFolder
* More use of constants
* Add FIXME notes
* Use more constant
* Remove Dashboard
* Pass tree to folder manager
* Replicate tree
* Reduce export complexity
* More refactoring
* Use the ForEach for loading users
* Limit in-memory folders
* Isolate the object
* Improve the export function
* Move resources to resources package
* Move delete operation
* Move more logic
* More consolidation
* More renaming
* Fix more issues
* Ensure path exists when created a resource
* Simply append error
* Fix receiver lint issue
* Fix cyclomatic complexity
* Fix linting
* Remove folder path creation
We should not write after the context is cancelled. This causes tests to fail as they are trying to clean up. To try to
accommodate this, we'll need to listen to the context in any loop where we don't immediately get other instructions from
e.g. trying to do an HTTP request.
* Add behavior for hidden
* Rename to IsFilePathSupported
* Modify sync
* Revert renaming
* Fix the tests
* Add more tests
* Maintain empty folders until next full pulling
* Fix wording
* Consider the file as ignored
* Handle folder creation in sync
* Record folder creation / update
* Fix in manual test
* Ensure / slash for folders
* Refactor the tests
* Keep safe path
* Fix some cases
* Remove log lines
* fix: go git migration should pretend the path is the repo root
The migration was broken due to its having the path already in the repository, then adding it once more. This now
pretends the path is the repository root as intended.
* chore: remove test log
* fix: reduce permissions of directory
* chore: make update-workspace
* Provisioning: Gracefully handle AlreadyExists errors
When this occurs, the job is already in the store. The vast majority of use-cases (which currently is all of them!) will
be fine with just accepting that as an OK.
* chore: make update-workspace
* fix: return error, but expect it in tests