-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
Unsanitize user and org names in DB #4762
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4762 +/- ##
==========================================
- Coverage 28.29% 28.28% -0.01%
==========================================
Files 398 399 +1
Lines 28295 28318 +23
==========================================
+ Hits 8005 8011 +6
- Misses 19580 19594 +14
- Partials 710 713 +3 ☔ View full report in Codecov by Sentry. |
server/store/datastore/migration/024_unsanitize_org_and_user_names.go
Outdated
Show resolved
Hide resolved
server/store/datastore/migration/024_unsanitize_org_and_user_names.go
Outdated
Show resolved
Hide resolved
server/store/datastore/migration/024_unsanitize_org_and_user_names.go
Outdated
Show resolved
Hide resolved
server/store/datastore/migration/024_unsanitize_org_and_user_names.go
Outdated
Show resolved
Hide resolved
…ames.go Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
…ames.go Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
…ames.go Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
…ames.go Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Tests are failing. |
Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
After thinking of it again, I'm not sure if thats the best approach. Cant really say why but I see a lot of potential for issues and corner cases. Looks like this issue only occurs with forgejo/gitea and the api returns mixed capitalization while the forge only supports case-insensitive values. What do you think? Edit: Tested it. You can create an org "Foo" in gitea and in that case its even displayed as "Foo" in the url.... But you cant create "foo" with the error "The organization name is already taken." This is a somewhat inconsistent behavior upstream, however I think we should switch back to the initial approach from @pat-s |
If all users are sanitized, the user list in the UI would also reflect a non-optimal state. The simplest fix which also wouldn't require a migration would probably be to just sanitize the comparison call of |
Why does the license header of the migration start with |
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
|
Strange, I started to add a method to the storage interface to directly get an org by name and forge-id, that might prevent such cases. Forge-id 0 sounds like not set at all (gos default for not setting a number). |
Yeah maybe we mixed in too much different fixes into this PR? Can we revert it to focus on the sanitizing issue and move other improvements to another PR? I have a backup of the DB before the migration from this PR so I can also re-test this PR. |
Extracted most other changes to #4817 |
I don't know where this PR stands now and what there is do to - appreciated if somebody could clarify or apply the necessary actions. |
As more changes are required for #4817, can we revert those changes here so we can merge it? |
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
@xoxys Will you test this again after merge? Is a patch release planned after merge? |
Tested the PR already. Can login again but had no time to test fresh install and migration again. |
I don't think we need a patch, we can just release 3.1.0. This bug is present in most older versions anyways... |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
Appreciated if somebody could release 3.1.0 when it fits. Thanks for getting this merged. |
fix #3614
As discussed in chat, preferred to use non-sanitized values everywhere.