Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add allowed cookies field in druid datasource settings #171

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

Spikatrix
Copy link

@Spikatrix Spikatrix commented Jan 8, 2024

Summary by CodeRabbit

  • New Features
    • Added the ability to specify allowed cookies for forwarding to the data source in Druid connection settings.

Copy link

coderabbitai bot commented Jan 8, 2024

Walkthrough

The Grafadruid-Druid datasource plugin for Grafana has been updated to handle cookie management. Specifically, it now allows users to specify which cookies should be retained when making requests to the Druid datasource. This is achieved through new UI components for cookie specification and updates to the configuration settings to include a keepCookies field.

Changes

File Path Change Summary
.../grafadruid-druid-datasource/ConfigEditor.tsx Added connectionJsonData property and included keepCookies in state's jsonData.
.../DruidHttpSettings.tsx Inserted TagsInput and InlineFormLabel for allowed cookies input.
.../types.ts Extended ConnectionSettingsOptions with optional jsonData.keepCookies.

🐇✨
To Grafana's code, a change we bestow,
With tags and cookies lined up in a row.
A rabbit's touch, so deft and so quick,
Now keep your cookies, just take your pick! 🍪🌟


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 10beaa2 and 8b9b400.
Files selected for processing (3)
  • public/app/plugins/datasource/grafadruid-druid-datasource/ConfigEditor.tsx (2 hunks)
  • public/app/plugins/datasource/grafadruid-druid-datasource/configuration/ConnectionSettings/DruidHttpSettings.tsx (2 hunks)
  • public/app/plugins/datasource/grafadruid-druid-datasource/configuration/ConnectionSettings/types.ts (1 hunks)
Additional comments: 4
public/app/plugins/datasource/grafadruid-druid-datasource/configuration/ConnectionSettings/types.ts (1)
  • 19-21: The addition of the keepCookies property to the ConnectionSettingsOptions interface is well-aligned with the PR objectives to allow users to specify cookies to be forwarded to the Druid data source.
public/app/plugins/datasource/grafadruid-druid-datasource/configuration/ConnectionSettings/DruidHttpSettings.tsx (1)
  • 95-107: The UI changes with the addition of TagsInput and InlineFormLabel in the DruidHttpSettings component are clear and user-friendly. Ensure that the user input is properly sanitized to prevent XSS vulnerabilities.
public/app/plugins/datasource/grafadruid-druid-datasource/ConfigEditor.tsx (2)
  • 60-62: The changes to include connectionJsonData in the onConnectionOptionsChange method are correctly implemented to handle the new keepCookies field.

  • 88-88: The defaulting of keepCookies to an empty array in the connectionOptions method is a good practice to avoid potential undefined issues.

@Spikatrix Spikatrix enabled auto-merge (squash) January 8, 2024 12:26
@Spikatrix Spikatrix merged commit 0b07a84 into fluxninja_micro_frontends Jan 8, 2024
@Spikatrix Spikatrix deleted the druid-datasource-cookies branch January 8, 2024 12:29
GurinderRawala added a commit that referenced this pull request Sep 3, 2024
* [v9.3.x] OAuth: Refactor OAuth parameters handling to support obtaining refresh tokens for Google OAuth (grafana#58940)

OAuth: Refactor OAuth parameters handling to support obtaining refresh tokens for Google OAuth (grafana#58782)

* Add ApprovalForce to AuthCodeOptions

* Extract access token validity check to a function

* Refactor

* Oauth: set options internally instead of exposing new function

* Align tests

* Remove unused function

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
(cherry picked from commit 9c98314)

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>

* [v9.3.x] Preferences: Add confirmation modal when saving org preferences (grafana#59119) (grafana#59141)

* Navigation: share logic between `buildBreadcrumbs` and `usePageTitle`… (grafana#59155)

Navigation: share logic between `buildBreadcrumbs` and `usePageTitle` (grafana#58819)

* simplify usePageTitle logic a bit

* use buildBreadcrumbs logic in usePageTitle

* always add home item to navTree, fix some tests

* fix remaining unit tests

(cherry picked from commit 824a562)

* [v9.3.x] CloudWatch: Cross-account querying support  (grafana#59389)

* add cross-account querying support

* fix tests

* FN FluxNinja changes

* Run `go mod tidy`

* Fix druid plugin registration

* FN FluxNinja changes

* FN FluxNinja changes

* Build: Streamline and sync dockerfiles (grafana#58101)

* streamline and sync dockerfiles

* improve go dependency cacheability

* unify alpine and ubuntu Dockerfiles

* include glibc support in locally-built alpine images

* FN Remove internationalization provider

* FN Update sankey panel (30b5be0b5bf03ee8c7)

* FN Render filters and time selector, hide loader despite pageNav and sectionNav

* FN Remove tenary expressions with explicit booleans in DashNav

* FN Use optional chaining - keybindingSrv in initDashboard

* FN Set isPublicDashboardView to false

* FN Set hiddenVariables in initial FN state

* FN Lint RenderFnDashboard

* FN Lint create-mfe

* Updated SSH Keys (#43)

* Time range selector changes (#42)

* changed time picker dropdown designs

* change time setting button

* added dark and light

* 7829 Read hiddenVariables, mode, FNDashboard from grfana's state (#44)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>

* Add tool versions (#45)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>

* Added support for updating nightly environment (#46)

* 7911 Add graphql datasource plugin (#47)

* 7911 Update FN_README

* 7911 Add graphql plugin

* 7911 Add graphql plugin

Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>

* 7911 Allow loading unsigned graphql plugin (#49)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>

* 7911 Modify url in graphql datasource plugin (#50)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>

* Minor grafadruid fixes (#51)

* Support Druid GroupBy queries (#52)

* 8225 Fix missing grafana loader (#53)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>

* Fix ad hoc filters (#54)

* 8238 Remove panel header menu (#55)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>

* added presisted time range (#56)

* Updates to latest instead of demo environment (#57)

* Loading dashboards with update function (#58)

* changed dashboard loading to use update fn

* removed extra package

* changed query filter designs (#59)

* Add ChatGPT-based PR Reviewer and Summarizer (#62)

* fix (#63)

* 8822 ci (#66)

* 8822 Remove dashes from dashboard filter labels

* 8822 Empty commit

---------

Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>

* 8740 Fix variables in titles by using PanelHeader component to render panel header (#64)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>

* update action

* update review job name (#69)

* Load dashboard with specific version passed from FN UI (#68)

* Add full metadata for versions query too (#70)

* 8963 Remove edit icons in dashboard row (#71)

Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>

* Update openai-review.yml (#73)

* Update openai-review.yml

* update action

* Fix table panel (#75)

* Grafana firefox (#77)

* vscode fix

* fixed firefox bugs

---------

Co-authored-by: Gurinder Singh <gurnder.rawala@fluxninja.com>

* Pull latest time range changes from upstream grafana (#78)

* Support math expressions for druid granularity (#81)

* Remove font size from global styles (#82)

* Add fnLoader in grafana instead of prop from parent mfe (#83)

* Fixed CircleCI config (#84)

* Font update, bug fixes (#85)

* Fix grafana bugs

* Update grafana font to source sans pro

* Revert code format change

* replace function error fix (#87)

* Add missing config in opsninja.yaml (#88)

* Update font to Source Sans Pro (#90)

* filter label design fix (#92)

* druid datasource fixes (#93)

* druid datasource fixes

* wire gen fix

* page definations fix (#94)

* Fix headers in Druid DS (#97)

Co-authored-by: Jakub Michalak <jakub.michalak@fluxninja.com>

* Pass headers to Druid query (#99)

* Fix headers in Druid variable queries (#100)

* typing error fix and modifications (#101)

* typing error fix and modifications

* react-use module installed

* Fix type error and adhoc filter alignment

* Fix one more type error

---------

Co-authored-by: Spikatrix <12792882+Spikatrix@users.noreply.github.com>

* render time range selector any where, removed dead code (#103)

* removed graphql data source, updated local test info in fn readme

* portal for time range selector

* Enable panel resizing (#105)

* Adhoc filter fix, update sankey plugin (#106)

* Adhoc filter style fix

* Update sankey plugin

* confirm grafana initialization (#107)

* window event to confirm initialization

* grafana start up status events

* Show filters icon only when there are some variables to show (#116)

* Don't panic on empty var Druid query (#123)

* Remove not needed GH Actions (#124)

* changed to cirular progress (#148)

* changed to cirular progress

* codeRabbit suggestions

* remove reviewer

* loader color fix (#150)

* page title Flux Ninja -> FluxNinja

* Add allowed cookies field in druid datasource settings (#171)

* Fix sentry heatmap crash (#168)

Co-authored-by: Gurinder Singh <gurinder.rawala@fluxninja.com>

* removed make doc workflow (#172)

* Coderabbit theme and fixes (#175)

* coderabbit theme

* theme change

* checkpoint

* fixes

* added coderabbit authentication

* Create deploy-cloud-run-grafana.yaml (#176)

* Update deploy-cloud-run-grafana.yaml

* Update deploy-cloud-run-grafana.yaml with CD

* webpack fix for prod (#177)

* added GH for prod (#178)

Co-authored-by: dikshant <raidikshant2@gmail.com>

* Deploy grafana image to cloud run

* Update deploy-cloud-run-grafana-prod.yaml

* dashboard style changes (#179)

* disabled drag for mfe (#180)

* changed error message to no data (#182)

* fix

* log fix

* rebase issues resolved

* webpack changes

* mfe fix

* checkpoint

* tooltip, icons fix

* deleted github actions

* dependency updates fix

* fixes

---------

Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com>
Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Joao Silva <100691367+JoaoSilvaGrafana@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
Co-authored-by: Katarzyna Ziomek-Zdanowicz <katarzyna.ziomek-zdanowicz@fluxninja.com>
Co-authored-by: Krzysztof Kwapisiewicz <krzysztof.kwapisiewicz@fluxninja.com>
Co-authored-by: Dan Cech <dcech@grafana.com>
Co-authored-by: Hardik Shingala <34568645+hdkshingala@users.noreply.github.com>
Co-authored-by: Gurinder Singh <108446046+gurinder39@users.noreply.github.com>
Co-authored-by: Kasia <24753130+ziomecka@users.noreply.github.com>
Co-authored-by: Szymon Bieńkowski <szymon.bienkowski@fluxninja.com>
Co-authored-by: Jakub Michalak <jakub.michalak@fluxninja.com>
Co-authored-by: Harjot Gill <harjot.gill@fluxninja.com>
Co-authored-by: Daria Bialobrzeska <88393714+DariaKunoichi@users.noreply.github.com>
Co-authored-by: Gurinder Singh <gurnder.rawala@fluxninja.com>
Co-authored-by: Jaseel <12792882+Spikatrix@users.noreply.github.com>
Co-authored-by: Gurinder Singh <gurinder.rawala@fluxninja.com>
Co-authored-by: dikshant-infracloud <160205839+dikshant-infracloud@users.noreply.github.com>
Co-authored-by: dikshant <raidikshant2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants