Repository navigation
Refactor Backstage templates: improve UX and simplify service naming #10
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ apiVersion: scaffolder.backstage.io/v1beta3 | |||||
| kind: Template | ||||||
| metadata: | ||||||
| name: release-service | ||||||
| title: π Release Service | ||||||
| title: Release Service | ||||||
| description: Build and release a service to the preview cluster. Provide a host for web services, or leave empty for a background worker. | ||||||
| tags: | ||||||
| - release | ||||||
|
|
@@ -14,87 +14,77 @@ metadata: | |||||
| spec: | ||||||
| owner: group:admin | ||||||
| type: deployment | ||||||
| presentation: | ||||||
| buttonLabels: | ||||||
| createButtonText: 'Release Service' | ||||||
| reviewButtonText: 'Review & Release' | ||||||
|
|
||||||
| parameters: | ||||||
| - title: Component Info | ||||||
| - title: Service & Source | ||||||
| required: | ||||||
| - teamName | ||||||
| - serviceName | ||||||
| - dockerfileRepo | ||||||
| - gitTag | ||||||
| properties: | ||||||
| teamName: | ||||||
| title: Team Name | ||||||
| title: Team | ||||||
| type: string | ||||||
| description: "Select your team" | ||||||
| ui:field: MyGroupsPicker | ||||||
| serviceName: | ||||||
| title: Component Name | ||||||
| type: string | ||||||
| pattern: "^[a-z0-9][a-z0-9-]{0,62}$" | ||||||
|
|
||||||
| - title: Source Repository | ||||||
| required: | ||||||
| - dockerfileRepo | ||||||
| - gitTag | ||||||
| properties: | ||||||
| dockerfileRepo: | ||||||
| title: GitHub Repository | ||||||
| type: string | ||||||
| description: >- | ||||||
| owner/repo containing the Dockerfile (e.g. dmitriimashkov/my-app). | ||||||
| For private repos: install the GitHub App at https://github.com/apps/mctl-me/installations/new | ||||||
| or provide a PAT below. | ||||||
| description: "Repository containing the Dockerfile (e.g. dmitriimashkov/my-app). The repo name will be used as the service name." | ||||||
|
||||||
| description: "Repository containing the Dockerfile (e.g. dmitriimashkov/my-app). The repo name will be used as the service name." | |
| description: "Repository containing the Dockerfile (e.g. dmitriimashkov/my-app). The repo name will be used as the service name and must be lowercase with hyphens only to be a valid Kubernetes service name." |
Copilot
AI
Feb 20, 2026
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.
The repository description previously included a helpful link to install the GitHub App ("install the GitHub App at https://github.com/apps/mctl-me/installations/new"). This link has been removed in favor of a more concise description. Consider retaining the installation link in the repoPat field description or in the dockerfileRepo description, as it helps users understand the alternative to providing a PAT.
Copilot
AI
Feb 20, 2026
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.
The removal of the serviceName parameter and its validation pattern is a breaking change that eliminates an important safeguard. The previous pattern ^[a-z0-9][a-z0-9-]{0,62}$ ensured the service name would be valid for Kubernetes resource names and DNS labels.
With the automatic derivation from dockerfileRepo, there's no validation to ensure the extracted repo name will be Kubernetes-compatible. Repository names can contain uppercase letters, dots, and underscores (per the pattern on line 38), which are not valid in Kubernetes resource names.
Consider either:
- Keeping the
serviceNamefield as an editable field with a default value derived from the repo name, or - Adding validation/transformation logic to ensure the derived name is Kubernetes-compatible
| pattern: "^[a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+$" | |
| pattern: "^[a-zA-Z0-9._-]+/[a-z0-9][a-z0-9-]{0,62}$" |
Copilot
AI
Feb 20, 2026
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.
The updated description removes the helpful link to create a PAT (previously included: "Create at: https://github.com/settings/tokens?type=beta"). While the new description is more concise, it would be helpful to retain this link or mention where users can create the PAT, as finding the correct settings page can be non-obvious for users unfamiliar with GitHub's fine-grained tokens.
| Fine-grained PAT with 'Contents: Read' scope. | |
| Fine-grained PAT with 'Contents: Read' scope. Create at: https://github.com/settings/tokens?type=beta |
Copilot
AI
Feb 20, 2026
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.
The repoPat field has been moved within the same section but is now positioned between dockerfileRepo and dockerfilePath, which breaks the logical flow. The PAT is an authentication credential, while dockerfilePath is a path configuration related to dockerfileRepo.
Consider moving repoPat after dockerfilePath to maintain better logical grouping: repository β path β version tag β authentication.
Copilot
AI
Feb 20, 2026
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.
The repoName filter is not a standard Backstage scaffolder filter. This will cause the template to fail at runtime when trying to process this expression.
If this is intended to extract the repository name from "owner/repo" format (e.g., "dmitriimashkov/my-app" β "my-app"), you'll need to either:
- Define a custom filter in the Backstage app configuration, or
- Use a different approach to extract the repo name
Additionally, even if the filter exists, there's a validation mismatch: the GitHub Actions workflow expects component_name to match the pattern ^[a-z0-9][a-z0-9-]{0,62}$ (lowercase alphanumeric with hyphens), but repository names can contain uppercase letters, dots, and underscores according to the dockerfileRepo pattern. The filter would need to normalize the extracted name to be Kubernetes-compatible.
Copilot
AI
Feb 20, 2026
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.
The same repoName filter issue applies here. This filter is not a standard Backstage scaffolder filter and will cause runtime failures. The component_name value passed to the GitHub Actions workflow must match the pattern ^[a-z0-9][a-z0-9-]{0,62}$ as validated in the workflow, but there's no guarantee that extracting the repo name from dockerfileRepo will produce a valid value.
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.
The rocket emoji has been removed from the template title. While the PR description mentions this is for "consistency", it would be helpful to verify this aligns with the actual convention. The provision-database template still uses an emoji (ποΈ) and update-environment uses βοΈ. If the goal is to remove emojis for consistency, those templates should be updated as well, or this template should retain its emoji.