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: team validation #1122

Closed
wants to merge 21 commits into from
Closed

Conversation

AleksandrMatsko
Copy link
Member

@AleksandrMatsko AleksandrMatsko commented Nov 12, 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.

updating from 2.13

Use following command to update to new version.

cli --update --from-version '2.13'

This command will do the following:

  1. Get all teams from DB.
  2. Group teams with same names.
  3. For teams with same names change name (example: ["name", "name", "name"] -> ["name", "name1", "name2"]).
  4. Update teams with name changed.
  5. Save pairs teamName:team.ID to "moira-teams-by-names" redis hash.

downgrading to 2.13

Use following command to downgrade to previous version.

cli --downgrade --to-version '2.13'

This command will delete "moira-teams-by-names" redis hash.

@AleksandrMatsko
Copy link
Member Author

/build

@AleksandrMatsko
Copy link
Member Author

/build

@AleksandrMatsko
Copy link
Member Author

/build

@AleksandrMatsko
Copy link
Member Author

/build

@AleksandrMatsko
Copy link
Member Author

/build

@AleksandrMatsko
Copy link
Member Author

/build

Copy link

Build and push Docker images with tag: refactor-team-validation.2024-11-13.45a0103

1 similar comment
Copy link

Build and push Docker images with tag: refactor-team-validation.2024-11-13.45a0103

@AleksandrMatsko AleksandrMatsko changed the base branch from master to refactor/team-validation-in-api-and-db November 13, 2024 11:03
@AleksandrMatsko AleksandrMatsko changed the base branch from refactor/team-validation-in-api-and-db to master November 13, 2024 11:10
@AleksandrMatsko
Copy link
Member Author

Split into #1123 and #1124

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.

1 participant