-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Folders: Fix creating/updating a folder whose title has leading and trailing spaces #80909
Conversation
Since this is already in the wild, I think we need a migration too. |
|
||
db := sqlstore.InitTestDB(t) | ||
cfg := setting.NewCfg() | ||
features := featuremgmt.WithFeatures() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] [non-blocker] Do we need ProvideStore
to receive an empty *FeatureManagement
or could we create features
like this and reuse it when creating Service
?
features := featuremgmt.WithFeatures() | |
features := featuremgmt.WithFeatures(featuremgmt.FlagNestedFolders) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually features
is redundant (is not used inside the nested folder store) so I have removed it
but to answer your question: yes, we can create the features like this and pass the same to the service.
this will be addressed by #80972 |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-80909-to-v10.3.x origin/v10.3.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 4243079cb52de57ba816e4c2a4eddcd7c11bb133 When the conflicts are resolved, stage and commit the changes:
If you have the GitHub CLI installed: # Push the branch to GitHub:
git push --set-upstream origin backport-80909-to-v10.3.x
# Create the PR body template
PR_BODY=$(gh pr view 80909 --json body --template 'Backport 4243079cb52de57ba816e4c2a4eddcd7c11bb133 from #80909{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v10.3.x] Folders: Fix creating/updating a folder whose title has leading and trailing spaces" --body-file - --label "type/bug" --label "area/backend" --label "add to changelog" --label "backport" --base v10.3.x --milestone 10.3.x --web Or, if you don't have the GitHub CLI installed (we recommend you install it!): # Push the branch to GitHub:
git push --set-upstream origin backport-80909-to-v10.3.x
# Create a pull request where the `base` branch is `v10.3.x` and the `compare`/`head` branch is `backport-80909-to-v10.3.x`.
# Remove the local backport branch
git switch main
git branch -D backport-80909-to-v10.3.x |
…ding and trailing spaces (#81006) Folders: Fix creating/updating a folder whose title has leading and trailing spaces (#80909) * Add tests * Folders: Fix creating folder whose title has leading and trailing spaces * Fix folder update * Remove redundant argument * Fix test (cherry picked from commit 4243079)
…railing spaces (#80909) * Add tests * Folders: Fix creating folder whose title has leading and trailing spaces * Fix folder update * Remove redundant argument * Fix test
What is this feature?
Temporarily folders are store in both
dashboard
andfolder
table. This fixes an inconsistency in two tables that used to occur if the folder title used to contain leading and trailing spaces because if thefolder
table was stored as is, while in thedashboard
table was store trimmed.Why do we need this feature?
[Add a description of the problem the feature is trying to solve.]
Who is this feature for?
[Add information on what kind of user the feature is for.]
Which issue(s) does this PR fix?:
Fixes #
Special notes for your reviewer:
Please check that: