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

WIP [tugboat] Initial pass at placing a proxy that redirects to named URL #4399

Closed

Conversation

q0rban
Copy link

@q0rban q0rban commented Feb 23, 2021

This PR adds experimental support for human readable aliases that display in the URL bar when they are clicked from within the Tugboat UI.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 23, 2021 17:56 Destroyed
@ElijahLynn
Copy link
Contributor

We have to do something with the trusted hostname pattern as this is what it looks like when I click the preview button >
image

And is probably the reason the tests are failing too.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 23, 2021 22:15 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 23, 2021 23:58 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 24, 2021 18:08 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 24, 2021 18:32 Destroyed
@ElijahLynn
Copy link
Contributor

This is working functionally! Clicking either of these links redirects to the preview-name with the correct cms or web prefix now.

I think there might be an issue with tests still because of the redirect though.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 25, 2021 22:18 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat March 1, 2021 20:10 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat March 1, 2021 20:22 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat March 1, 2021 20:40 Destroyed
@ElijahLynn
Copy link
Contributor

I just ran these test cases in Chrome for DEMO and CI:

  1. ERR_NAME_NOT_RESOLVED: cms-very-long-hostname-part-121-2r1gqnh9pyzzjcwg9vvxa5ae3bpa3d4p.ci.cms.va.gov (label length = 65, hostname length = 79)
  2. SUCCESS: cms-very-long-hostname-part-12-2r1gqnh9pyzzjcwg9vvxa5ae3bpa3d4p.ci.cms.va.gov (label length = 64, hostname length = 78)
  3. ERR_NAME_NOT_RESOLVED: cms-very-long-hostname-part-123-stlrzate7j60gxrktefdoawtsn9xsmeg.demo.cms.va.gov (label length = 65, hostname length = 81)
  4. SUCCESS: cms-very-long-hostname-part-12-stlrzate7j60gxrktefdoawtsn9xsmeg.demo.cms.va.gov (label length = 64, hostname length = 80)

@ElijahLynn
Copy link
Contributor

I just ran these test cases in Chrome for DEMO and CI:

Same results on Firefox.

So it appears that the maximum hostname label length is 64 characters. The spec says 63 bytes so not sure where but I am off by one here.

The Tugboat TOKEN length is currently 33 CHARS, which leaves us 30 CHARS, minus the 4 CHAR prefix of web- or cms-, which is 26 CHAR minus one more for the off-by-one, which is 25 and what James has it trimmed to. So this confirms that the max CHARS we can stick in between is in fact 25. PREFIX + + TOKEN.

I think this is good to merge after I fix the conflicts and put a "why" comment on the trim length.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat March 3, 2021 00:02 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat March 3, 2021 00:06 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat March 3, 2021 00:13 Destroyed
…ing' warning"

This reverts commit ce634f3.

IDE likes this commit but `sh` does not:

'/bin/sh: 2: Syntax error: "|" unexpected'
@va-cms-bot va-cms-bot temporarily deployed to Tugboat March 3, 2021 00:17 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat March 3, 2021 00:37 Destroyed
@ElijahLynn
Copy link
Contributor

Given a Preview name of:

pr4399-james-tugboat-alias-generation-trim-length-testing-name

The resulting URL is https://cms-pr4399-james-tugboat-ali-feojue32sjv0ltus10z7byw7iz13zxa5.ci.cms.va.gov/.

Given:

Nebraska-Western Iowa health care

URL:

https://cms-nebraska-western-iowa-he-feojue32sjv0ltus10z7byw7iz13zxa5.ci.cms.va.gov/

@ElijahLynn
Copy link
Contributor

Closing for now as we can't implement this just yet as the URLs for 60+ demo environments will change. Will re-open if/when time comes.

@ElijahLynn ElijahLynn closed this Mar 12, 2021
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.

3 participants