* Add test rule generator support for recording rules
* Remove accidental add
* Recording rules appear in GetRulesForScheduling
* A couple more tests, updates, count
* No need to capture rule defs
* Add validation to check for existence of dashboard before creation
* add service mock for FindDashboard
* update tests
* reorder function
* update logic change to bool
* update naming validate dashboard
* add tests
* update return val
* remove bool return val
* simplify return statement
* update test
* remove extra spacing
* update mock
* remove unncessary space
* Alerting: separate out silence auth service preconditions checks
Will be useful for subsequent PR that adds metadata to silence response
* Add silence read wildcard scope to precondition for read all silences
* Fix missing `alt` text in images
* Fix `canonical` setting in AlertManager docs
* Fix `.`(dot) position in hyperlinks due to a temporary styling issue
* Revert "Fix `canonical` setting in AlertManager docs"
This reverts commit 65354b3642.
* Renamed Manage variables page to Add variables
* Renamed Inspect variables page to Manage and inspect variables
* Updated H1 on Add variables
* Moved Manage variables content to from Add varibles page to Manage and inspect variables page and updated text to fit
* Updated link style to ref URIs in Manage and inspect variables
* remove unused action set code, refactor the existing code
* fix import ordering
* use a separate interface for permission expansion after all, to avoid circular dependencies
* add comments, fix a test
* Social: link to OrgRoleMapper
* OIDC: support Generic Oauth org to role mappings
Fixes: #73448
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
* Handle when getAllOrgs fails in the org_role_mapper
* Add more tests
* OIDC: ensure orgs are evaluated from API when not from token
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
* OIDC: ensure AutoAssignOrg is applied with OrgMapping without RoleAttributeStrict
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
* Extend docs
* Fix test, lint
---------
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
* Add skeleton implementation for mode reconciliation between 1 and 2
* Track mode for each dual writer
* Add test for setting dual writer
* Include context when setting dual writing mode
---------
Co-authored-by: Dan Cech <dcech@grafana.com>
* GetSignedInUser unexported (renamed to getSignedInUser)
* GetSignedInUserWithCacheCtx renamed to GetSignedInUser
* added a check for a nil cacheservice (as defensive programming / test convenience)
* Also call storage on mode1. Add metrics
* Update comment
* Don't use compare function for now
* Remove very important space
* Finish add logging in mode2.
Also call US in mode1 in a non blocking way
* Improve code readability on modes 1 and 2
* Fix tests
* Rename vars
* Lint
* Return error from legacy write
* Renume useless defer
* [REVIEW] improvements
* Pass kind instead of name
* Use kind instead of name in metrics
* Only call latency metrics once
* Return error on writes to legacystore in mode1
* Move accesssor logic into the goroutine as well
* Add shim rule implementation for recording rules
* Give ruleFactory access to the original rule definition
* Schedule shim implementation if the rule is a recording rule
* Fix or suppress linter
* Fix nolint
* Read path, main API
* Define record field for incoming requests
* Refactor several alerting specific validators into two paths
* Refactor validateCondition actually contain all the condition validation logic
* Move condition validation inside rule path
* Validators for recording rules
* Wire feature flag through to validators
* Test for accepting a valid recording rule
* Tests for negative case, no UID
* Test for ignoring alerting fields
* Build conditions based on recording rules as well
* Regenerate swagger docs
* Fix CRUD test to cover the right thing
* Re-generate swagger docs with backdated v0.30.2 version
* Regenerate base spec
* Regenerate ngalert specs
* Regenerate top level specs
* Comment and rename
* Return struct instead of modifying ref