feat: implement reserved service name validation for Apl services - #1074
Open
CasLubbers wants to merge 2 commits into
Open
feat: implement reserved service name validation for Apl services#1074CasLubbers wants to merge 2 commits into
CasLubbers wants to merge 2 commits into
Conversation
CasLubbers
requested review from
dennisvankekem and
ferruhcihan
as code owners
August 26, 2026 09:08
2 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Implements validation to prevent creation/update of APL team services whose names are reserved due to collisions with per-team platform hostnames.
Changes:
- Added
RESERVED_SERVICE_NAMESenvironment validator with a default reserved list. - Enforced reserved-name validation in
createAplServiceandeditAplService. - Added Jest coverage for reserved-name behavior and env overrides; updated
package-lock.json.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/validators.ts | Adds a new env validator for RESERVED_SERVICE_NAMES. |
| src/otomi-stack.ts | Parses reserved names and rejects reserved service names on create/edit. |
| src/otomi-stack.test.ts | Adds tests for reserved-name validation and env customization. |
| package-lock.json | Lockfile metadata updates (removed peer flags in multiple entries). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+217
to
+223
| function getReservedServiceNames(): Set<string> { | ||
| return new Set( | ||
| env.RESERVED_SERVICE_NAMES.split(',') | ||
| .map((name) => name.trim().toLowerCase()) | ||
| .filter((name) => name.length > 0), | ||
| ) | ||
| } |
Comment on lines
+227
to
+229
| if (reserved.has(name.trim().toLowerCase())) { | ||
| throw new ValidationError(`Service name is reserved. Reserved names: ${Array.from(reserved).join(', ')}`) | ||
| } |
Comment on lines
+41
to
+45
| it('trims whitespace and ignores case', () => { | ||
| let assertServiceNameNotReserved: typeof import('./serviceUtils').assertServiceNameNotReserved | ||
| jest.isolateModules(() => { | ||
| ;({ assertServiceNameNotReserved } = require('./serviceUtils')) | ||
| }) |
Comment on lines
+275
to
+276
| it('allows a non-reserved name on create', async () => { | ||
| await expect(otomiStack.createAplService(teamId, buildService('my-service'))).resolves.not.toThrow() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.