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

Dashboards: Allow dashboards with same name in different folders #70378

Merged
merged 2 commits into from Jun 26, 2023

Conversation

joshhunt
Copy link
Contributor

  • Grafana previously used to validate that your dashboard name is unique in the folder you're saving to
  • Folder: Replace folderId with folderUid #58393 regressed this behaviour to instead validate the name globally
    • it started passing in folderUID (string) instead of folderID (number) to the search API which only supports ID
    • this remained hidden because the parameters were typed to any :(
  • This PR changes ValidationSrv to use getGrafanaSearcher which handles converting folder ID to UID for search (it also uses search v2 if configured) to search the correct folder

Requires #70376 to work with SQLSearcher/Search v1

Fixes #69611

@joshhunt joshhunt added type/bug add to changelog mob session Something solved during a mob session no-backport Skip backport of PR labels Jun 20, 2023
@joshhunt joshhunt added this to the 10.1.x milestone Jun 20, 2023
@joshhunt joshhunt requested review from grafanabot and a team as code owners June 20, 2023 11:29
@joshhunt joshhunt requested review from dprokop and evictorero and removed request for a team June 20, 2023 11:29
Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
@joshhunt joshhunt force-pushed the joshhunt/mob-dash-name-validation branch from 817f4de to cc28395 Compare June 20, 2023 11:30
Copy link
Member

@torkelo torkelo left a comment

Choose a reason for hiding this comment

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

nice" , been wanting to troubleshoot why there was an error with the same name (in two different folders)

@natellium natellium added the team/grafana-dashboards Dashboards squad label Jun 23, 2023
@joshhunt joshhunt merged commit e50cf55 into main Jun 26, 2023
16 checks passed
@joshhunt joshhunt deleted the joshhunt/mob-dash-name-validation branch June 26, 2023 11:49
LudoVio pushed a commit that referenced this pull request Jun 26, 2023
)

* Dashboards: Allow dashboards with same name in different folders

Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>

* fix

---------

Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
harisrozajac pushed a commit that referenced this pull request Jun 29, 2023
)

* Dashboards: Allow dashboards with same name in different folders

Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>

* fix

---------

Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
harisrozajac pushed a commit that referenced this pull request Jun 30, 2023
)

* Dashboards: Allow dashboards with same name in different folders

Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>

* fix

---------

Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
@ricky-undeadcoders ricky-undeadcoders modified the milestones: 10.1.x, 10.1.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog area/frontend mob session Something solved during a mob session no-backport Skip backport of PR team/grafana-dashboards Dashboards squad type/bug
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

Allow creating dashboards with duplicate names in different folders
6 participants