Api: Make subproject alias optional, defaulting to child slug - #13247
Merged
Conversation
`validate_alias` ran the duplicate-alias and format checks even when the alias was omitted or explicitly null, and `validate_subproject_alias` crashed on `None` when checking for slashes. Skip those checks when no alias is given, since the model already defaults it to the child's slug.
humitos
approved these changes
Aug 19, 2026
| self._get_response_dict("projects-subprojects-list_POST"), | ||
| ) | ||
|
|
||
| def test_projects_subprojects_list_post_without_alias(self): |
Member
There was a problem hiding this comment.
Do we have a test for an alias that is invalid already? It seems we don't, because we are changing the response in that case and there is no test updated/failing.
We should probably add one here as well.
Member
Author
There was a problem hiding this comment.
We had some for non-unique aliases and aliases with slashes. I added one to test invalid characters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The alias is optional, it defaults to the child slug.
Fixes https://read-the-docs.sentry.io/issues/7678634010/?alert_rule_id=229005&alert_timestamp=1787063322148&alert_type=email&environment=production¬ification_uuid=b08d2e40-fd96-4391-899a-58ebdd9955e1&project=148442&referrer=alert_email