* remove result field from alert notification commands and queries
* fix a few more tests
* ok, linter
* remove alert result fields
* fix api calls
* et tu, linter
* Elasticsearch: Implement schema for query
* Comment out types I am not sure how to do
* Manually fix typing for PipelineMetricAggregationWithMultipleBucketPaths and BasePipelineMetricAggregation
* Import types to types.ts to have single source of truth
* Cleanup, reorder
* Remove unnecesary Schema.
* Fix test
* Refactor
* Add steps in the pipeline for cloning enterprise when running PR tests.
* Removed enterprise-check from the github action workflows, and removed it from the codeowners file.
* Add is_paused attr to the POST alert rule group endpoint
* Add is_paused to alerting API POST alert rule group
* Fixed tests
* Add is_paused to alerting gettable endpoints
* Fix integration tests
* Alerting: allow to pause existing rules (#62401)
* Display Pause Rule switch in Editing Rule form
* add isPaused property to form interface and dto
* map isPaused prop with is_paused value from DTO
Also update test snapshots
* Append '(Paused)' text on alert list state column when appropriate
* Change Switch styles according to discussion with UX
Also adding a tooltip with info what this means
* Adjust styles
* Fix alignment and isPaused type definition
Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
* Fix test
* Fix test
* Fix RuleList test
---------
Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
* wip
* Fix tests and add comments to clarify AlertRuleWithOptionals
* Fix one more test
* Fix tests
* Fix typo in comment
* Fix alert rule(s) cannot be paused via API
* Add integration tests for alerting api pausing flow
* Remove duplicated integration test
---------
Co-authored-by: Virginia Cepeda <virginia.cepeda@grafana.com>
Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
Co-authored-by: George Robinson <george.robinson@grafana.com>
* Create cue file and gen ts/go types
* Use generated schema in ts/go
* Run make den-cue to update report
* Manually extend Phlare query
* Updates
* Add default queryType
* Run make gen-cue to Update report.json
* Kindsys: Replace DeclForGen with kindsys.Kind
DeclForGen was always unnecessary - it just wasn't obvious on initial
implementation, when we were focused on generating unique types for each
core kind. This removes it, considerably simplifying interactions with
kindsys - virtually everything now just relies on kindsys.Kind and its
derived interfaces.
* Removed unused jenny
* Rename params in jennies
* Fix json serialization of state values
* Simplify two of the tests
* Fix linter complaint
* Don't return error if we fail to look up dashboard, just log it and move on
* Address linter complaint
* Config: Make frontend settings a struct rather than map
remove frontend settings to setting package
remove frontend settings struct to dtos package
rearrange structs to avoid cycles
rename getFrontendSettings fn
omitempty
fix login test
fix middleware test
* wip some enterprise types
* cleanup, moved structs from enterprise
* ci
* Use suggested value for uid
* update the snapshot
* use __expr__
* replace all -100 with __expr__
* update snapshot
* more changes
* revert redundant change
* Use expr.DatasourceUID where it's possible
* generate files
* extend IsInherited function to work for nested folders
* add tests
* update tests and logic
* process inherited permissions seprately to correctly grey them out in the frontend
* Use dbName in jsonData instead of database
* Use dbName in instead of database
* Remove database fields and define dbName instead
* Fix tests
* set database field as empty string
* Tempo data query wip
* Replace TempoQuery with new type from schema
* Added some documentation for each DataQuery field
* Change limit type from number to int64
* Use TempoDataQuery instead of local model in the backend
* Update report.json
* add .TemplateData property to data in order to populate template <title> tags with the compiled subject value
* update all templates
* re-enable integration test and update implementation to check changes
* chore: fmt
* add HiddenSubject template func and update text templates
* slight performance improvement, only execute subject template once
* update template I missed
---------
Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
* Allow pausing alerts from provisioning
* Update swagger
* Add IsPaused to provision export endpoints
* Add pause field in sample.yml
* Add exception for reset state in first loop iteration of scheduler if rule is paused
* Update provision definition and swagger docs
* Fix provisioning export tests
* Suggestion: Simplify if condition
* Add more context to a comment
* add nested folder scope inheritance to managed permission services
* add a more specific erorr
* remove circular dependencies
* use errutil for returning erorr
* fix tests
* fix tests
* define a new error in ac package
* AuthN: Update signature of redirect client and RedirectURL function
* OAuth: use authn.Service to perform oauth authentication and login if feature toggle is enabled
* AuthN: register oauth clients
* AuthN: set auth module metadata
* AuthN: add logs for failed login attempts
* AuthN: Don't use enable disabled setting
* OAuth: only run hooks when authnService feature toggle is disabled
* OAuth: Add function to handle oauth errors from authn.Service
* WIP
* Update pkg/services/login/authinfo.go
* fix: merge
* change order to internal last
* adds: docs
* add: configuration for defaults and sample
* Update docs/sources/setup-grafana/configure-grafana/_index.md
Co-authored-by: Jo <joao.guerreiro@grafana.com>
* Update docs/sources/setup-grafana/configure-grafana/_index.md
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
---------
Co-authored-by: Jo <joao.guerreiro@grafana.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
* Add verify-starlark build action that returns an error for starlark files with lint
Relies on `buildifier` tool.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Add verify_starlark_step to PR pipeline
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Manually fetch buildifier in curl_image until a new build_image is created
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Format with buildifier
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Remove all unused variables retaining one unused function
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Use snake_case for variable
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Replace deprecated dictionary concatenation with .update() method
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Start adding docstrings for all modules and functions
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Prefer os.WriteFile as ioutil.WriteFile has been deprecated since go 1.16
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Attempt to document the behavior of the init_enterprise_step
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Document test_backend pipeline
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Document enterprise_downstream_step
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Document the pipeline utility function
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Document publish_images_step
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Document publish_images_steps
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Document enterprise2_pipelines function
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Add tags table for Starlark files.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Document test_frontend
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Document windows function
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Add docstrings to verifystarlark functions
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Refactor error handling to be more clear and document complex behavior
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Split errors into execution errors and verification errors
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Document all other library functions
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Add local variables to TAGS
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Add blank line between all Args and Returns sections
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix new linting errors
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Lint new Starlark files
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Correct buildifier binary mv
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Document the need to set nofile ulimit to at least 2048
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Update build-container to include buildifier
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Ensure buildifier binary is executable
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix valid content test
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Simply return execution error
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Only check files rather than fixing them
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Use updated build-container with executable buildifier
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Test that context cancellation stops execution
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Simplify error handling
Return execution errors that short circuit WalkDir rather than
separately tracking that error.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Remove fetching of buildifier binary now that it is in the build-container
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Use build image in verify-starlark step
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Use semver tag
The image is the same but uses a semver tag to make it clearer that
this is a forward upgrade from the old version.
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Use node 18 image with buildifier
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* feat: make api request to /loki/api/v1/index/stats
* fix: add /index/stats to callResource valid urls
* feat: make call to getQueryStats when the query changes
* feat: render user tooltip displaying the estimated value for processed data
* fix: add new props to component tests
* test: add tests for query size estimation
* fix: disable error message on request failure
* refactor: add suggestions from code review
* refactor: only pass required query string
This adds provisioning endpoints for downloading alert rules and alert rule groups in a
format that is compatible with file provisioning. Each endpoint supports both json and
yaml response types via Accept header as well as a query parameter
download=true/false that will set Content-Disposition to recommend initiating a download
or inline display.
This also makes some package changes to keep structs with potential to drift closer
together. Eventually, other alerting file structs should also move into this new file
package, but the rest require some refactoring that is out of scope for this PR.
* add loki contextfilter component
* add `getLogRowContextUi` support to DataSourceAPI
* add `runContextQuery` to LogRowContextProvider
* pass `getRowContextUi` to `LogRowContext`
* adapt LogRowContext to show datasource ui
* implement LogRowContextUi in Loki
* add `logsContextDatasourceUi` feature flag
* change state to `Alpha`
* disable the feature if `logsContextDatasourceUi` is not set
* don't fetch labels in the constructor
* adjust to right height
* remove unnecessary eslint disable
* add test for LokiContextUi
* move code down in datasource.ts
* rename `refresh` to `runContextQuery`
* update datasource tests
* don't update if `updateFilter` fn changes
* organized imports in datasource.test.ts
* don't trigger on intialization changes
* change tag to `experimental`
* move `getLogRowContextUi` to props
* Add checker and update the resource filter function for new search
* Add tests for checker
* small fixes
* handle location for panels correctly
* clean up checker code and extend the tests for it
* more fixes, but tests don't quite work yet
* a small change to return error
* cleanup
* more simplification
* fix tests
* correct wrong argument ordering & use constant
* Apply suggestions from code review
Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
* import
* check general folder from permission checker function
* handle root folder aka general folder properly
* update tests
* clean up
* lint
* add fix from main
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
* AuthN: store post auth hooks in a priority list and update registration
function to take a priority
* AuthN: store post login hooks in a priority list and update registration function to take a priority
* AuthN: Change priority for sync user
The old GrafanaComURL setting didn't have the /api suffix so needed it
adding on by the proxy director, but the new GrafanaComAPIURL setting is
assumed to already point directly to the API and doesn't need an
additional suffix.
This is the only place in the codebase that GrafanaComAPIURL is used.
* update Delete and Reset methods to return state transitions
this will be used by notifier code to decide whether alert needs to be sent or not.
* update scheduler to provide reason to delete states and use transitions
* update FromAlertsStateToStoppedAlert to accept StateTransition and filter by old state
* fixup
* fix tests