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

refactor(api, db): team validation #1123

Merged
merged 6 commits into from
Nov 26, 2024

Conversation

AleksandrMatsko
Copy link
Member

@AleksandrMatsko AleksandrMatsko commented Nov 13, 2024

PR Summary

Before this PR it was possible to create teams with same names.

This PR forbids create/update of team with name which is alredy belongs to other team (no matter case, so names "Team name" and "Team Name" are the same then checking name existence).

Also:

  • Refactor team limits. Move limits to LimitsConfig.
  • Add tests for teams in dto package.

Note: Database schema is changed a bit. Added separate key ("moira-teams-by-names") to store team IDs by team names. Than saving/deleting team this key is also updated. Migrations are in #1124 .

@AleksandrMatsko AleksandrMatsko marked this pull request as ready for review November 13, 2024 11:16
@AleksandrMatsko AleksandrMatsko requested a review from a team as a code owner November 13, 2024 11:16
@AleksandrMatsko AleksandrMatsko changed the title refactor(api): team validation refactor(api, db): team validation Nov 13, 2024
database/redis/database.go Outdated Show resolved Hide resolved
database/redis/teams.go Outdated Show resolved Hide resolved
Tetrergeru
Tetrergeru previously approved these changes Nov 25, 2024
kissken
kissken previously approved these changes Nov 26, 2024
* feat: migrations for team validation

* feat: write log than team will be renamed

* refactor: logging then renaming teams, add timeout between modifying teams and committing changes
@AleksandrMatsko AleksandrMatsko dismissed stale reviews from kissken and Tetrergeru via 49c69a6 November 26, 2024 09:02
@AleksandrMatsko AleksandrMatsko merged commit 520c968 into master Nov 26, 2024
6 checks passed
@AleksandrMatsko AleksandrMatsko deleted the refactor/team-validation-in-api-and-db branch November 26, 2024 09:10
Copy link

Build and push Docker images with tag: 2024-11-26.520c968

1 similar comment
Copy link

Build and push Docker images with tag: 2024-11-26.520c968

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.

3 participants