Commit Graph

1138 Commits

Author SHA1 Message Date
ryan 66d020eb7e skip migration if it is a big number 2018-04-05 09:51:08 +02:00
Daniel Lee 32264c61c4 Merge branch 'master' into dashboard-acl-ux2 2018-03-29 11:32:24 +02:00
bergquist 627df67992 dashboards: reject updates of provisioned dashboards 2018-03-27 15:12:47 +02:00
bergquist d6faa3d06f provisioning: improve UX when saving provisioned dashboards 2018-03-26 15:08:46 +02:00
ryan a0a6fa6fa5 remove constraint from sqlstore 2018-03-23 11:47:07 +01:00
ryan a5588b6957 Merge remote-tracking branch 'origin/annotations-created' into annotations-created
* origin/annotations-created:
  dooh
2018-03-23 11:44:21 +01:00
ryan 4ed1ec5174 Merge remote-tracking branch 'grafana/master' into annotations-created
* grafana/master: (30 commits)
  changelog: adds note about closing #11278
  docs: spelling
  docs: add intro paragraph to provisioning page
  Cleanup CircleCI V2 Conversion
  changelog: notes for #1271 and #2740
  graph: minor fixes to y-axes alignment feature
  added save icon to save buttons
  removed trash can icon from save buttons
  Return actual user ID in UserProfileDTO
  dashboard version cleanup: more tests and refactor
  minor refactor of dashboard version cleanup
  refactor: dashboard version cleanup
  limit number of rows deleted by dashboard version cleanup
  fix dashboard version cleanup on large datasets
  Allocated to a separate alignment block. Replaced the attribute of the second axis by the attribute of the axes.
  Fixed unit test.
  Changed the way this feature was activated. And changed tolltip.
  Added validation of input parameters.
  Resolved conflict
  Corrected work for graphs created before this feature.
  ...
2018-03-23 11:38:43 +01:00
Carl Bergquist f0d77804da Merge pull request #11329 from alexanderzobnin/fix-11278
fix dashboard version cleanup on large datasets
2018-03-23 10:53:51 +01:00
Ryan McKinley 164ddb16c9 dooh 2018-03-22 20:48:40 +01:00
ryan 0c7294593c update the updated column! 2018-03-22 20:05:04 +01:00
ryan d554c6f9be using circle as my tester 2018-03-22 19:44:47 +01:00
ryan fa021b547a using circle as my tester 2018-03-22 19:39:30 +01:00
ryan db91033b6e adding tests, but they arent running locally 2018-03-22 19:33:33 +01:00
Gerben Meijer e722732021 Return actual user ID in UserProfileDTO
This fixes calls to /api/user where ID is currently always 0
2018-03-22 16:30:04 +01:00
ryan 20353db966 convert epoch to milliseconds 2018-03-22 16:21:47 +01:00
ryan a2bbd89a9e adding updated column 2018-03-22 15:52:09 +01:00
Alexander Zobnin 0ffcea08c7 dashboard version cleanup: more tests and refactor 2018-03-22 15:18:05 +03:00
ryan 3898ea02e6 adding created column 2018-03-22 02:22:58 +01:00
Alexander Zobnin 2ade0881b1 minor refactor of dashboard version cleanup 2018-03-21 22:48:17 +03:00
Alexander Zobnin 3f85fcce2d refactor: dashboard version cleanup 2018-03-21 21:01:15 +03:00
Alexander Zobnin f976b690ca limit number of rows deleted by dashboard version cleanup 2018-03-21 20:26:27 +03:00
Alexander Zobnin fc2d1d6ca9 fix dashboard version cleanup on large datasets 2018-03-21 17:23:05 +03:00
Daniel Lee 1cef373d16 Merge remote-tracking branch 'upstream/master' into update-xorm 2018-03-20 19:21:58 +01:00
Daniel Lee 9cdd7cb04c database: expose SetConnMaxLifetime as config setting
For MySQL, setting this to be shorter than the wait_timeout MySQL setting
solves the issue with connection errors after the session has timed out for
the connection to the database via xorm.
2018-03-16 01:09:00 +01:00
Daniel Lee 5a3ba68a9c database: fixes after xorm update 2018-03-16 00:09:29 +01:00
Daniel Lee 1c20126f87 database: update xorm to v0.6.4 and xorm core to v0.5.7 2018-03-16 00:02:50 +01:00
Marcus Efraimsson ef3588c1f8 docker: mssql and mssql tests blocks with common build context 2018-03-15 09:49:53 +01:00
Marcus Efraimsson 57d46a706c mssql datasource: additional data type tests 2018-03-13 19:54:29 +01:00
Marcus Efraimsson d4beee2bb0 Merge branch 'master' into mssql_datasource 2018-03-13 16:03:02 +01:00
bergquist 061a418f0f style: dont expose func outside package 2018-03-13 11:24:10 +01:00
bergquist ff6108051d removes unused variables 2018-03-07 16:40:24 +01:00
Carl Bergquist 3f6e525755 Merge pull request #10942 from grafana/pausing_alerts_updates_timestamp
Pausing/un alerts now updates new_state_date
2018-03-07 15:40:12 +01:00
Daniel Lee 3b836c9c5f Merge pull request #10996 from grafana/snapshot_permissions
Snapshot fixes and changes to snapshot list
2018-02-23 09:17:59 +01:00
Daniel Lee fe49182b9d snapshots: fixes cleanup of old snapshots
Snapshot cleanup did not work due to time.Now syntax error. Added test
for it as well to catch any future errors.

Added error and debug logging so that it is possible to see any errors in the future.

Removed an unused configuration value and deprecated the remove expired snapshots
setting.
2018-02-22 16:12:16 +01:00
Marcus Efraimsson 3f588b4c48 dashboards: created/updated and createdby/updatedby should be set before save
If creating a new folder/dashboard created/updated and createdby/updatedby should always be set.
If updating an existing folder/dashboard updated and updatedby should always be set.
2018-02-22 11:54:28 +01:00
Daniel Lee 7d9a9fa29c snapshots: change to snapshot list query
Admins can see all snapshots. Other roles can only see their own
snapshots.

Added permission check for deleting snapshots - admins can delete
any snapshot, other roles can delete their own snapshots or
snapshots that they have access to via dashboard permissions.
2018-02-21 13:39:08 +01:00
Marcus Efraimsson 02278f90a7 dashboards: make fake dashboard guardian available to other packages 2018-02-20 18:08:19 +01:00
Marcus Efraimsson 39aba03483 dashboards: created date should be set when creating a folder/dashboard 2018-02-20 13:54:31 +01:00
Marcus Efraimsson fce1e3f7f1 Merge branch 'master' into 10630_folder_api 2018-02-19 13:32:45 +01:00
Marcus Efraimsson 53cd39fde5 Shouldn't be able to overwrite a dashboard if you don't have permissions (#10900)
* dashboards: new command for validating dashboard before update

Removes validation logic from saveDashboard and later on use the new command for validating
dashboard before saving a dashboard. This due to the fact that we need to validate permissions
for overwriting other dashboards by uid and title.

* dashboards: use the new command for validating dashboard before saving

Had to refactor dashboard provisioning a bit to be able to sidetrack the permission validation
in a somewhat reasonable way.
Adds some initial tests of the dashboard repository, but needs to be extended later. At least
now you can mock the dashboard guardian

* dashboards: removes validation logic in the save dashboard api layer

Use the dashboard repository solely for create/update dashboards and let it do all
the validation. One exception regarding quota validation which still is in api layer
since that logic is in a macaron middleware.
Need to move out-commented api tests later.

* dashboards: fix database tests for validate and saving dashboards

* dashboards: rename dashboard repository to dashboard service

Split the old dashboard repository interface in two new interfaces, IDashboardService and
IDashboardProvisioningService. Makes it more explicit when using it from the provisioning package
and there's no possibility of calling an incorrect method for saving a dashboard.

* database: make the InitTestDB function available to use from other packages

* dashboards: rename ValidateDashboardForUpdateCommand and some refactoring

* dashboards: integration tests of dashboard service

* dashboard: fix sqlstore test due to folder exist validation

* dashboards: move dashboard service integration tests to sqlstore package

Had to move it to the sqlstore package due to concurrency problems when running
against mysql and postgres. Using InitTestDB from two packages added conflicts
when clearing and running migrations on the test database

* dashboards: refactor how to find id to be used for save permission check

* dashboards: remove duplicated dashboard tests

* dashboards: cleanup dashboard service integration tests

* dashboards: handle save dashboard errors and return correct http status

* fix: remove log statement

* dashboards: import dashboard should use dashboard service

Had to move alerting commands to models package due to problems with import cycles of packages.

* dashboards: cleanup dashboard api tests and add some tests for post dashboard

* dashboards: rename dashboard service interfaces

* dashboards: rename dashboard guardian interface
2018-02-19 11:12:56 +01:00
Leonard Gram fe357a72d9 login: migration fix. 2018-02-16 17:36:28 +01:00
Leonard Gram 0053be9882 login: uses epochs for login throtting.
Closes #10937
2018-02-16 17:25:46 +01:00
Leonard Gram 1f3442020b alerts: refactoring tests 2018-02-16 14:37:10 +01:00
Leonard Gram c5226a945b alerting: pausing alerts modifies updated.
When pausing an alert the updated field is
modified to the current time.

Closes #10191
2018-02-16 14:24:52 +01:00
Torkel Ödegaard 8af2c9f1f8 test: added integration test for #10941 2018-02-16 14:17:41 +01:00
Torkel Ödegaard 5323971c21 refactoring: alert rule query refactoring (#10941) 2018-02-16 13:56:04 +01:00
bergquist 529fc022d5 db: reduce name column size in dashboard_provisoning
ref #10931
2018-02-16 11:49:17 +01:00
Daniel Lee b9d572bdec teams: adds some validation to the API 2018-02-16 11:46:20 +01:00
bergquist 56907eef69 tests: makes sure we all migrations are working 2018-02-14 15:30:29 +01:00
Leonard Gram fa1b92a12b provisioning: uses unix epoch timestamps. (#10907)
* provisioning: uses unix epoch timestamps.
2018-02-14 15:28:30 +01:00