Skip to content

feat: add slug property to app, use in URLs #4573

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

Merged
merged 18 commits into from
Oct 28, 2022
Merged

Conversation

deansheather
Copy link
Member

@deansheather deansheather commented Oct 16, 2022

Closes #4571, Closes #4674

Adds slug property to workspace_apps in the database, which is copied from the new required terraform slug property in templates. This new slug property is the only property accepted in application URLs including proxy path URLs. Existing bookmarks or tabs will need to be recreated from the dashboard to get new URLs in most cases (unless the app's display_name field matches the slug field).

The app "display_name" field is still used for the button in the dashboard.

coder_app resource names must match the regex provisioner.ValidAppNameRegex:

^[a-z0-9](-?[a-z0-9])*$

Which is essentially:

  1. Must start with alphanumeric
  2. Can contain alphanumeric or hyphen characters
  3. Cannot contain two consecutive hyphens
  4. Must end with alphanumeric

image

TODO:

  • create new slug field in the terraform provider
  • add a test that ensures invalid workspace app slugs get rejected by the terraform provisioner
  • update the terraform provider in all templates

@deansheather deansheather requested a review from a team as a code owner October 16, 2022 19:30
@deansheather deansheather requested review from jsjoeio and kylecarbs and removed request for a team October 16, 2022 19:30
@deansheather deansheather requested a review from coadler October 17, 2022 18:23
Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

FE: great work!

@deansheather deansheather enabled auto-merge (squash) October 28, 2022 17:30
@deansheather deansheather merged commit 10df2fd into main Oct 28, 2022
@deansheather deansheather deleted the dean/app-urls-use-slug branch October 28, 2022 17:41
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible issue with subdomains Non URL-safe characters in app names cause them to be inaccessible over subdomains
4 participants