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

feat(DTO): deterministic transfer model names #2389

Merged
merged 4 commits into from
Sep 30, 2023

Conversation

provinzkraut
Copy link
Member

We currently ensure uniqueness of the generated transfer model names by appending a random string to a base name. This makes debugging and testing harder in cases where you want to reference / compare the models between runs, since the names differ on every run.

This PR introduces a helper function that generates a unique name by simply appending an increasing integer to the base name, ensuring that, given nothing else changed, transfer models will have the same names.

@provinzkraut provinzkraut requested review from a team as code owners September 30, 2023 09:25
litestar/utils/helpers.py Outdated Show resolved Hide resolved
@provinzkraut provinzkraut enabled auto-merge (squash) September 30, 2023 17:22
@sonarcloud
Copy link

sonarcloud bot commented Sep 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@provinzkraut provinzkraut merged commit 4ef5fee into main Sep 30, 2023
17 checks passed
@provinzkraut provinzkraut deleted the dto-transfer-type-deterministic-name branch September 30, 2023 17:28
@github-actions
Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/2389

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