Skip to content

Commit

Permalink
feat: enable notebooks and annotations (influxdata#21972)
Browse files Browse the repository at this point in the history
* 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 CHANGELOG
  • Loading branch information
williamhbaker authored Jul 29, 2021
1 parent 09f5f48 commit 11e5ce0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 119 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

### Notebooks and Annotations

Support for Notebooks and Annotations is included with this release.

### SQLite Metadata Store

This release adds an embedded SQLite database for storing metadata required by the latest UI features like Notebooks and Annotations.
Expand Down Expand Up @@ -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. [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. [21972](https://github.com/influxdata/influxdb/pull/21972): Added support for notebooks and annotations.

### Bug Fixes

Expand Down
38 changes: 1 addition & 37 deletions flags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,6 @@
contact: Query Team
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
description: Inject the latest successful task run timestamp into a Task query extern when executing.
key: injectLatestSuccessTime
Expand All @@ -94,22 +74,6 @@
default: false
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
description: Positions the cursor at the end of the line(s) when using the monaco editor
key: cursorAtEOF
Expand Down Expand Up @@ -137,7 +101,7 @@
- name: Annotations UI
description: Management, display, and manual addition of Annotations from the UI
key: annotations
default: false
default: true
contact: Monitoring Team
lifetime: temporary
expose: true
66 changes: 1 addition & 65 deletions kit/feature/list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 1 addition & 17 deletions notebooks/transport/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import (

"github.com/golang/mock/gomock"
"github.com/influxdata/influxdb/v2"
"github.com/influxdata/influxdb/v2/kit/feature"
"github.com/influxdata/influxdb/v2/kit/platform"
"github.com/influxdata/influxdb/v2/mock"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"go.uber.org/zap/zaptest"
)

Expand Down Expand Up @@ -200,9 +198,7 @@ func TestNotebookHandler(t *testing.T) {
func newTestServer(t *testing.T) (*httptest.Server, *mock.MockNotebookService) {
ctrlr := gomock.NewController(t)
svc := mock.NewMockNotebookService(ctrlr)
// server needs to have a middleware to annotate the request context with the
// appropriate feature flags while notebooks is still behind a feature flag
server := annotatedTestServer(NewNotebookHandler(zaptest.NewLogger(t), svc))
server := NewNotebookHandler(zaptest.NewLogger(t), svc)
return httptest.NewServer(server), svc
}

Expand All @@ -227,15 +223,3 @@ func doTestRequest(t *testing.T, req *http.Request, wantCode int, needJSON bool)
}
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,
)
}

0 comments on commit 11e5ce0

Please sign in to comment.