Skip to content

werft/job-config: Make previews from 20+ character branches possible #8403

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

Conversation

ArthurSens
Copy link
Contributor

Signed-off-by: ArthurSens [email protected]

Description

This PR effectively makes it possible to create preview environments from super long branch names by cutting it into 20 characters max. The reasons why we can't use more than 20 characters are listed here.

I'm opening this as a draft because:
The initial idea of adding a label does not work out-of-the-box as we expected.

  • Label values can't have special characters like /, which are commonly used by our branch names
  • Label values still have a 63 characters limit

Creating this PR to start the discussion, should we give up on verifying a possible conflicting namespace? Should we go with a mixture of branch name + hash?

Related Issue(s)

Fixes https://github.com/gitpod-io/ops/issues/1252

How to test

Create a super long branch(from this PR) and create a new preview

Release Notes

NONE

@ArthurSens
Copy link
Contributor Author

pinging @gitpod-io/platform to talk about what is mentioned in the PR description

@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Merging #8403 (9c3b5f6) into main (2dce413) will decrease coverage by 3.35%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8403      +/-   ##
==========================================
- Coverage   14.53%   11.17%   -3.36%     
==========================================
  Files          51       18      -33     
  Lines        4872      993    -3879     
==========================================
- Hits          708      111     -597     
+ Misses       4102      880    -3222     
+ Partials       62        2      -60     
Flag Coverage Δ
components-gitpod-cli-app 11.17% <ø> (ø)
components-local-app-app-darwin-amd64 ?
components-local-app-app-darwin-arm64 ?
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?
components-ws-daemon-app ?
components-ws-daemon-lib ?
install-installer-raw-app ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
install/installer/pkg/common/objects.go
components/ws-daemon/pkg/cpulimit/dispatch.go
components/local-app/pkg/auth/auth.go
components/ws-daemon/pkg/content/hooks.go
components/ws-daemon/pkg/daemon/markunmount.go
install/installer/pkg/common/render.go
.../installer/pkg/components/ws-manager/deployment.go
...installer/pkg/components/ws-manager/rolebinding.go
...staller/pkg/components/ws-manager/networkpolicy.go
components/ws-daemon/pkg/content/archive.go
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2dce413...9c3b5f6. Read the comment docs.

@fullmetalrooster
Copy link
Contributor

fullmetalrooster commented Feb 23, 2022

This would break SSH access to preview environments as we use the branch name also in other places and we assume that the branchname is the same as the destname at multiple places.

VM_NAME="$(git symbolic-ref HEAD 2>&1 | awk '{ sub(/^refs\/heads\//, ""); $0 = tolower($0); gsub(/[^-a-z0-9]/, "-"); print }')"

@ArthurSens
Copy link
Contributor Author

dev/preview/ssh-proxy-command.sh

Good catch! I've also just noticed that you've opened #8316 (platform was not set as reviewers), I'm wondering our best option here is to just merge that one and work to get Harvester done ASAP

@stale
Copy link

stale bot commented Mar 6, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Mar 6, 2022
@mads-hartmann
Copy link
Contributor

@ArthurSens I believe we can close this in favour of #8692 now :)

@stale stale bot removed the meta: stale This issue/PR is stale and will be closed soon label Mar 10, 2022
@ArthurSens
Copy link
Contributor Author

Yep :)

@ArthurSens ArthurSens closed this Mar 10, 2022
@ArthurSens ArthurSens deleted the arthusens/mybranch-name-is-super-long-and-bigger-than-20-characters branch March 10, 2022 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants