Skip to content

Commit

Permalink
feat: remove feature flag from notebooks backend
Browse files Browse the repository at this point in the history
  • Loading branch information
williamhbaker committed Jun 4, 2021
1 parent fd9a088 commit 9492c64
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion flags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
- name: Notebooks Service API
description: Enable the Equivalent notebooksd Service API
key: notebooksApi
default: false
default: true
contact: Edge Team
lifetime: temporary
expose: true
Expand Down
4 changes: 2 additions & 2 deletions kit/feature/list.go

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

15 changes: 0 additions & 15 deletions notebooks/transport/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"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/errors"
kithttp "github.com/influxdata/influxdb/v2/kit/transport/http"
Expand Down Expand Up @@ -55,7 +54,6 @@ func NewNotebookHandler(
middleware.Recoverer,
middleware.RequestID,
middleware.RealIP,
h.mwNotebookFlag, // temporary, remove when feature flag for notebooks is removed
)

r.Route("/", func(r chi.Router) {
Expand All @@ -79,19 +77,6 @@ func (h *NotebookHandler) Prefix() string {
return prefixNotebooks
}

func (h *NotebookHandler) mwNotebookFlag(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
flags := feature.FlagsFromContext(r.Context())

if !flags["notebooks"].(bool) || !flags["notebooksApi"].(bool) {
h.api.Respond(w, r, http.StatusNoContent, nil)
return
}

next.ServeHTTP(w, r)
})
}

// get a list of all notebooks for an org
func (h *NotebookHandler) handleGetNotebooks(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
Expand Down

0 comments on commit 9492c64

Please sign in to comment.