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

test: Workspace testing does not guarantee branch name creation #12801

Merged
merged 2 commits into from
Sep 9, 2022

Conversation

utam0k
Copy link
Contributor

@utam0k utam0k commented Sep 9, 2022

Description

The branch name will vary depending on the user name and other factors. And this logic is written in the server, so it is not tested in the workspace.

export function toBranchName(user: User, issueTitle: string, issueNr: number): string {
const titleWords = issueTitle
.toLowerCase()
.replace(/[^a-z]/g, "-")
.split("-")
.filter((w) => w.length > 0);
let localBranch = (user.name + "/").toLowerCase();
for (const segment of titleWords) {
if (localBranch.length > 30) {
break;
}
localBranch += segment + "-";
}
localBranch += issueNr;
return localBranch;
}

Related Issue(s)

Relates #12248

How to test

Run the test

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview

@utam0k utam0k requested a review from a team September 9, 2022 08:06
@roboquat roboquat added the size/S label Sep 9, 2022
@github-actions github-actions bot added the team: workspace Issue belongs to the Workspace team label Sep 9, 2022
@roboquat roboquat merged commit eacca79 into main Sep 9, 2022
@roboquat roboquat deleted the to/contexts_test branch September 9, 2022 09:32
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note-none size/S team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants