-
Notifications
You must be signed in to change notification settings - Fork 1.3k
forcing the werft job to fail if the branch name is too long to suppo… #8316
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
forcing the werft job to fail if the branch name is too long to suppo… #8316
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8316 +/- ##
=========================================
+ Coverage 8.42% 11.17% +2.75%
=========================================
Files 33 18 -15
Lines 2339 993 -1346
=========================================
- Hits 197 111 -86
+ Misses 2137 880 -1257
+ Partials 5 2 -3
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
f05e1d4
to
e666dfe
Compare
// echo -n "gitpod.io/registry-facade_ready_ns_staging-" | wc -c | ||
const maxBranchNameLength = 20; | ||
if (deploymentConfig.destname.length > maxBranchNameLength) { | ||
werft.fail(phases.PREDEPLOY, `The branch name ${deploymentConfig.destname} is more than ${maxBranchNameLength} character. Please choose a shorter name!`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should fail much sooner than that - best before we do anything.
Note: don't forget to tie this to the absence of no-preview
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just shorten the destname to the required length instead of letting the job fail? E.g. here: gitpod/.werft/jobs/build/job-config.ts Lines 88 to 93 in 27b614e
|
IMO this is just a quick fix, and we should merge the early-as-possible error fix here. Hopefully we won't have this restriction too long, until we can use 1 VM / preview environment. |
I do not know all places where the branch-name is used and simply shortening it might break something down the line. |
0573ed4
to
3ed4306
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wulfthimm!
Let's get this merged - we're working on allowing longer names in parallel - follow https://github.com/gitpod-io/ops/issues/1252 if you're interested in that.
@wulfthimm Adding the hold label - the build job needs to be happy before this can be merged |
The base branch was changed.
3ed4306
to
da707ac
Compare
I added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wulfthimm I approved but added the hold label. Please merge this PR manually using Squash and merge so you can edit the commit message to get rid of the /werft command (otherwise branches off main won't get a preview environment)
@wulfthimm hah, okay, tide is a required check so you can't merge manually 😂 You have to
Then I can approve and Tide can merge it. |
…rt preview-environments
da707ac
to
d78dad7
Compare
@mads-hartmann It is ready now. |
@mads-hartmann someone would need to unhold if this should be merged |
/werft no-preview
Description
This set a limit for the branch name to 26 characters to make sure that preview-environments can get started. The length depends either on the length of the domain that is created or the label that is added by ws-daemon/registry-facade.
It does not solve the problem but at least gives a useful information instead of just failing.
Related Issue(s)
Fixes #8169
How to test
Run a preview environment on a branch with a long, 26 character at least, and a short name.
Release Notes
Documentation