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

fix: truncate api names for old versions #405

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

RaduPetreTarean
Copy link
Contributor

We previously appended the stability of apis before the pivot date, this is made after the truncation to 63 characters.

Which results in invalid names if api names are too long, this truncates the name back to 63 characters

@RaduPetreTarean RaduPetreTarean requested a review from a team as a code owner January 29, 2025 10:23
@RaduPetreTarean RaduPetreTarean force-pushed the fix/truncate-api-names-before-pivot branch 2 times, most recently from 79ff8f4 to d249491 Compare February 3, 2025 15:49
availableTitleLen = 0
}
name = fmt.Sprintf("%."+strconv.Itoa(availableTitleLen)+"s%s%s",
toBackstageName(doc.Info.Title), name_suffix, stabilitySuffix)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are building the name from scratch again here then doing it above is redundant. You can remove the logic on line ~279.

Please also make sure you retain the comment that explains why we are doing this.

@RaduPetreTarean RaduPetreTarean force-pushed the fix/truncate-api-names-before-pivot branch from d249491 to f160c5d Compare February 4, 2025 10:27
We append the stability of apis before the pivot date

This is made after the truncation to 63 characters

Which results in invalid names if api names are too long

This truncates the name back to 63 characters
@RaduPetreTarean RaduPetreTarean force-pushed the fix/truncate-api-names-before-pivot branch from f160c5d to 60d244b Compare February 4, 2025 10:29
@RaduPetreTarean RaduPetreTarean merged commit 5ade893 into main Feb 4, 2025
13 checks passed
@RaduPetreTarean RaduPetreTarean deleted the fix/truncate-api-names-before-pivot branch February 4, 2025 10:57
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.

2 participants