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

Remove trailing slash in container service host url if present #32

Merged
merged 4 commits into from
Jan 10, 2024

Conversation

nickpisciotta
Copy link
Contributor

Hey, I just made a Pull Request!

This change removes trailing backslashes "/" that are included in the Pulumi LightSail Container Service url output. This would impact frontend API request routing to backend endpoints.

✔️ Checklist

  • [N/A] A changeset describing the change and affected packages. (more info)
  • [N/A] Added or updated documentation
  • [N/A] Tests for new functionality and regression tests for bug fixes
  • [N/A] Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@nickpisciotta nickpisciotta requested a review from a team as a code owner January 4, 2024 18:14
Copy link
Contributor

@mitchhentgesspotify mitchhentgesspotify left a comment

Choose a reason for hiding this comment

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

Looks good other than one lint nit!

@@ -186,6 +186,7 @@ export const AWSProgram = (opts: OptionValues) => {
};

/* eslint-disable no-new */
const CONTAINER_SERVICE_URL = containerService.url.endsWith("/") ? containerService.url.slice(0, -1) : containerService.url
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move this up above the eslint-disable no-new? That line should be associated with the following line, so this should be moved up above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, sorry, didn't notice that or have the pre-commit running. Should be good now

Copy link
Contributor

@mitchhentgesspotify mitchhentgesspotify left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -185,6 +185,9 @@ export const AWSProgram = (opts: OptionValues) => {
DATABASE_PASSWORD: db?.masterPassword,
};

const CONTAINER_SERVICE_URL = containerService.url.endsWith('/')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pulumi variables are not strings, so thats why it is failing on tsc.

Something like containerService.url.apply(v => v.endsWith('/') ? v.slice(0, -1) : v) should work in this case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah okay. Thanks for that info! Made the change

@djamaile djamaile merged commit ebc537b into backstage:main Jan 10, 2024
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