Skip to content

feat: implement reserved service name validation for Apl services - #1074

Open
CasLubbers wants to merge 2 commits into
mainfrom
APL-2099
Open

feat: implement reserved service name validation for Apl services#1074
CasLubbers wants to merge 2 commits into
mainfrom
APL-2099

Conversation

@CasLubbers

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_NAMES environment validator with a default reserved list.
  • Enforced reserved-name validation in createAplService and editAplService.
  • 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 thread src/otomi-stack.ts Outdated
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 thread src/otomi-stack.ts Outdated
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(', ')}`)
}
Copilot AI review requested due to automatic review settings August 26, 2026 09:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Comment on lines +41 to +45
it('trims whitespace and ignores case', () => {
let assertServiceNameNotReserved: typeof import('./serviceUtils').assertServiceNameNotReserved
jest.isolateModules(() => {
;({ assertServiceNameNotReserved } = require('./serviceUtils'))
})
Comment thread src/otomi-stack.test.ts
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()
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.

2 participants