feat: enable notebooks and annotations (#21972)
* feat: remove notebooks feature flags * feat: turn on annotations feature flag * chore: removed unused UI feature flags * docs: add line to CHANGELOG about notebooks and annotations * chore: update CHANGELOGpull/21998/head
parent
09f5f48aeb
commit
11e5ce0dd3
|
@ -22,6 +22,10 @@ This release upgrades the project to `go` version 1.16.
|
||||||
|
|
||||||
Because of the version bump to `go`, the macOS build for this release requires at least version 10.12 Sierra to run.
|
Because of the version bump to `go`, the macOS build for this release requires at least version 10.12 Sierra to run.
|
||||||
|
|
||||||
|
### Notebooks and Annotations
|
||||||
|
|
||||||
|
Support for Notebooks and Annotations is included with this release.
|
||||||
|
|
||||||
### SQLite Metadata Store
|
### SQLite Metadata Store
|
||||||
|
|
||||||
This release adds an embedded SQLite database for storing metadata required by the latest UI features like Notebooks and Annotations.
|
This release adds an embedded SQLite database for storing metadata required by the latest UI features like Notebooks and Annotations.
|
||||||
|
@ -53,6 +57,7 @@ This release adds an embedded SQLite database for storing metadata required by t
|
||||||
1. [21910](https://github.com/influxdata/influxdb/pull/21910): Added `--ui-disabled` option to `influxd` to allow for running with the UI disabled.
|
1. [21910](https://github.com/influxdata/influxdb/pull/21910): Added `--ui-disabled` option to `influxd` to allow for running with the UI disabled.
|
||||||
1. [21938](https://github.com/influxdata/influxdb/pull/21938): Added route to delete individual secret.
|
1. [21938](https://github.com/influxdata/influxdb/pull/21938): Added route to delete individual secret.
|
||||||
1. [21958](https://github.com/influxdata/influxdb/pull/21958): Telemetry improvements: Do not record telemetry data for non-existant paths; replace invalid static asset paths with a slug.
|
1. [21958](https://github.com/influxdata/influxdb/pull/21958): Telemetry improvements: Do not record telemetry data for non-existant paths; replace invalid static asset paths with a slug.
|
||||||
|
1. [21972](https://github.com/influxdata/influxdb/pull/21972): Added support for notebooks and annotations.
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
|
38
flags.yml
38
flags.yml
|
@ -55,26 +55,6 @@
|
||||||
contact: Query Team
|
contact: Query Team
|
||||||
lifetime: permanent
|
lifetime: permanent
|
||||||
|
|
||||||
- name: Notebooks
|
|
||||||
description: Determine if the notebook feature's route and navbar icon are visible to the user
|
|
||||||
key: notebooks
|
|
||||||
default: false
|
|
||||||
contact: Monitoring Team
|
|
||||||
lifetime: temporary
|
|
||||||
expose: true
|
|
||||||
|
|
||||||
# This notebooksApi flag only controls the specific API calls that the frontend uses,
|
|
||||||
# not if the notebooks button is enabled on the sidebar. The notebooks flag (above) controls
|
|
||||||
# the display of the notebooks button on the sidebar. The notebooksAPI flag should be set to true
|
|
||||||
# to ensure the UI sends requests that the OSS backend can handle.
|
|
||||||
- name: Notebooks Service API
|
|
||||||
description: Enable the Equivalent notebooksd Service API
|
|
||||||
key: notebooksApi
|
|
||||||
default: true
|
|
||||||
contact: Edge Team
|
|
||||||
lifetime: temporary
|
|
||||||
expose: true
|
|
||||||
|
|
||||||
- name: Inject Latest Success Time
|
- name: Inject Latest Success Time
|
||||||
description: Inject the latest successful task run timestamp into a Task query extern when executing.
|
description: Inject the latest successful task run timestamp into a Task query extern when executing.
|
||||||
key: injectLatestSuccessTime
|
key: injectLatestSuccessTime
|
||||||
|
@ -94,22 +74,6 @@
|
||||||
default: false
|
default: false
|
||||||
expose: true
|
expose: true
|
||||||
|
|
||||||
- name: UI CSV Uploader
|
|
||||||
description: Adds the ability to upload data from a CSV file to a bucket
|
|
||||||
key: csvUploader
|
|
||||||
default: true
|
|
||||||
contact: Monitoring Team
|
|
||||||
expose: true
|
|
||||||
lifetime: temporary
|
|
||||||
|
|
||||||
- name: Editable Telegraf Configurations
|
|
||||||
description: Edit telegraf configurations from the UI
|
|
||||||
key: editTelegrafs
|
|
||||||
default: true
|
|
||||||
contact: Monitoring Team
|
|
||||||
expose: true
|
|
||||||
lifetime: temporary
|
|
||||||
|
|
||||||
- name: Default Monaco Selection to EOF
|
- name: Default Monaco Selection to EOF
|
||||||
description: Positions the cursor at the end of the line(s) when using the monaco editor
|
description: Positions the cursor at the end of the line(s) when using the monaco editor
|
||||||
key: cursorAtEOF
|
key: cursorAtEOF
|
||||||
|
@ -137,7 +101,7 @@
|
||||||
- name: Annotations UI
|
- name: Annotations UI
|
||||||
description: Management, display, and manual addition of Annotations from the UI
|
description: Management, display, and manual addition of Annotations from the UI
|
||||||
key: annotations
|
key: annotations
|
||||||
default: false
|
default: true
|
||||||
contact: Monitoring Team
|
contact: Monitoring Team
|
||||||
lifetime: temporary
|
lifetime: temporary
|
||||||
expose: true
|
expose: true
|
||||||
|
|
|
@ -86,34 +86,6 @@ func QueryTracing() BoolFlag {
|
||||||
return queryTracing
|
return queryTracing
|
||||||
}
|
}
|
||||||
|
|
||||||
var notebooks = MakeBoolFlag(
|
|
||||||
"Notebooks",
|
|
||||||
"notebooks",
|
|
||||||
"Monitoring Team",
|
|
||||||
false,
|
|
||||||
Temporary,
|
|
||||||
true,
|
|
||||||
)
|
|
||||||
|
|
||||||
// Notebooks - Determine if the notebook feature's route and navbar icon are visible to the user
|
|
||||||
func Notebooks() BoolFlag {
|
|
||||||
return notebooks
|
|
||||||
}
|
|
||||||
|
|
||||||
var notebooksApi = MakeBoolFlag(
|
|
||||||
"Notebooks Service API",
|
|
||||||
"notebooksApi",
|
|
||||||
"Edge Team",
|
|
||||||
true,
|
|
||||||
Temporary,
|
|
||||||
true,
|
|
||||||
)
|
|
||||||
|
|
||||||
// NotebooksServiceApi - Enable the Equivalent notebooksd Service API
|
|
||||||
func NotebooksServiceApi() BoolFlag {
|
|
||||||
return notebooksApi
|
|
||||||
}
|
|
||||||
|
|
||||||
var injectLatestSuccessTime = MakeBoolFlag(
|
var injectLatestSuccessTime = MakeBoolFlag(
|
||||||
"Inject Latest Success Time",
|
"Inject Latest Success Time",
|
||||||
"injectLatestSuccessTime",
|
"injectLatestSuccessTime",
|
||||||
|
@ -156,34 +128,6 @@ func TimeFilterFlags() BoolFlag {
|
||||||
return timeFilterFlags
|
return timeFilterFlags
|
||||||
}
|
}
|
||||||
|
|
||||||
var csvUploader = MakeBoolFlag(
|
|
||||||
"UI CSV Uploader",
|
|
||||||
"csvUploader",
|
|
||||||
"Monitoring Team",
|
|
||||||
true,
|
|
||||||
Temporary,
|
|
||||||
true,
|
|
||||||
)
|
|
||||||
|
|
||||||
// UiCsvUploader - Adds the ability to upload data from a CSV file to a bucket
|
|
||||||
func UiCsvUploader() BoolFlag {
|
|
||||||
return csvUploader
|
|
||||||
}
|
|
||||||
|
|
||||||
var editTelegrafs = MakeBoolFlag(
|
|
||||||
"Editable Telegraf Configurations",
|
|
||||||
"editTelegrafs",
|
|
||||||
"Monitoring Team",
|
|
||||||
true,
|
|
||||||
Temporary,
|
|
||||||
true,
|
|
||||||
)
|
|
||||||
|
|
||||||
// EditableTelegrafConfigurations - Edit telegraf configurations from the UI
|
|
||||||
func EditableTelegrafConfigurations() BoolFlag {
|
|
||||||
return editTelegrafs
|
|
||||||
}
|
|
||||||
|
|
||||||
var cursorAtEOF = MakeBoolFlag(
|
var cursorAtEOF = MakeBoolFlag(
|
||||||
"Default Monaco Selection to EOF",
|
"Default Monaco Selection to EOF",
|
||||||
"cursorAtEOF",
|
"cursorAtEOF",
|
||||||
|
@ -230,7 +174,7 @@ var annotations = MakeBoolFlag(
|
||||||
"Annotations UI",
|
"Annotations UI",
|
||||||
"annotations",
|
"annotations",
|
||||||
"Monitoring Team",
|
"Monitoring Team",
|
||||||
false,
|
true,
|
||||||
Temporary,
|
Temporary,
|
||||||
true,
|
true,
|
||||||
)
|
)
|
||||||
|
@ -247,13 +191,9 @@ var all = []Flag{
|
||||||
memoryOptimizedFill,
|
memoryOptimizedFill,
|
||||||
memoryOptimizedSchemaMutation,
|
memoryOptimizedSchemaMutation,
|
||||||
queryTracing,
|
queryTracing,
|
||||||
notebooks,
|
|
||||||
notebooksApi,
|
|
||||||
injectLatestSuccessTime,
|
injectLatestSuccessTime,
|
||||||
enforceOrgDashboardLimits,
|
enforceOrgDashboardLimits,
|
||||||
timeFilterFlags,
|
timeFilterFlags,
|
||||||
csvUploader,
|
|
||||||
editTelegrafs,
|
|
||||||
cursorAtEOF,
|
cursorAtEOF,
|
||||||
refreshSingleCell,
|
refreshSingleCell,
|
||||||
rangeAnnotations,
|
rangeAnnotations,
|
||||||
|
@ -267,13 +207,9 @@ var byKey = map[string]Flag{
|
||||||
"memoryOptimizedFill": memoryOptimizedFill,
|
"memoryOptimizedFill": memoryOptimizedFill,
|
||||||
"memoryOptimizedSchemaMutation": memoryOptimizedSchemaMutation,
|
"memoryOptimizedSchemaMutation": memoryOptimizedSchemaMutation,
|
||||||
"queryTracing": queryTracing,
|
"queryTracing": queryTracing,
|
||||||
"notebooks": notebooks,
|
|
||||||
"notebooksApi": notebooksApi,
|
|
||||||
"injectLatestSuccessTime": injectLatestSuccessTime,
|
"injectLatestSuccessTime": injectLatestSuccessTime,
|
||||||
"enforceOrgDashboardLimits": enforceOrgDashboardLimits,
|
"enforceOrgDashboardLimits": enforceOrgDashboardLimits,
|
||||||
"timeFilterFlags": timeFilterFlags,
|
"timeFilterFlags": timeFilterFlags,
|
||||||
"csvUploader": csvUploader,
|
|
||||||
"editTelegrafs": editTelegrafs,
|
|
||||||
"cursorAtEOF": cursorAtEOF,
|
"cursorAtEOF": cursorAtEOF,
|
||||||
"refreshSingleCell": refreshSingleCell,
|
"refreshSingleCell": refreshSingleCell,
|
||||||
"rangeAnnotations": rangeAnnotations,
|
"rangeAnnotations": rangeAnnotations,
|
||||||
|
|
|
@ -9,11 +9,9 @@ import (
|
||||||
|
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/influxdata/influxdb/v2"
|
"github.com/influxdata/influxdb/v2"
|
||||||
"github.com/influxdata/influxdb/v2/kit/feature"
|
|
||||||
"github.com/influxdata/influxdb/v2/kit/platform"
|
"github.com/influxdata/influxdb/v2/kit/platform"
|
||||||
"github.com/influxdata/influxdb/v2/mock"
|
"github.com/influxdata/influxdb/v2/mock"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"go.uber.org/zap"
|
|
||||||
"go.uber.org/zap/zaptest"
|
"go.uber.org/zap/zaptest"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -200,9 +198,7 @@ func TestNotebookHandler(t *testing.T) {
|
||||||
func newTestServer(t *testing.T) (*httptest.Server, *mock.MockNotebookService) {
|
func newTestServer(t *testing.T) (*httptest.Server, *mock.MockNotebookService) {
|
||||||
ctrlr := gomock.NewController(t)
|
ctrlr := gomock.NewController(t)
|
||||||
svc := mock.NewMockNotebookService(ctrlr)
|
svc := mock.NewMockNotebookService(ctrlr)
|
||||||
// server needs to have a middleware to annotate the request context with the
|
server := NewNotebookHandler(zaptest.NewLogger(t), svc)
|
||||||
// appropriate feature flags while notebooks is still behind a feature flag
|
|
||||||
server := annotatedTestServer(NewNotebookHandler(zaptest.NewLogger(t), svc))
|
|
||||||
return httptest.NewServer(server), svc
|
return httptest.NewServer(server), svc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,15 +223,3 @@ func doTestRequest(t *testing.T, req *http.Request, wantCode int, needJSON bool)
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
func annotatedTestServer(serv http.Handler) http.Handler {
|
|
||||||
notebooksFlag := feature.MakeFlag("", "notebooks", "", true, 0, true)
|
|
||||||
notebooksApiFlag := feature.MakeFlag("", "notebooksApi", "", true, 0, true)
|
|
||||||
|
|
||||||
return feature.NewHandler(
|
|
||||||
zap.NewNop(),
|
|
||||||
feature.DefaultFlagger(),
|
|
||||||
[]feature.Flag{notebooksFlag, notebooksApiFlag},
|
|
||||||
serv,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue