Skip to content

feat: remove v1 endpoints#1006

Open
dennisvankekem wants to merge 9 commits into
mainfrom
APL-1353
Open

feat: remove v1 endpoints#1006
dennisvankekem wants to merge 9 commits into
mainfrom
APL-1353

Conversation

@dennisvankekem
Copy link
Copy Markdown
Contributor

@dennisvankekem dennisvankekem commented Jun 1, 2026

Remove the v1 endpoints for team

Includes:

  • services
  • NetPols
  • Workloads
  • SealedSecrets
  • Builds
  • CodeRepo
  • Teams

Does not include
v1/policies

console: linode/apl-console#798
api: #1006

@dennisvankekem dennisvankekem marked this pull request as ready for review June 1, 2026 10:03
@dennisvankekem dennisvankekem changed the title feat: removed coderepo v1 feat: remove v1 endpoints Jun 1, 2026
@j-zimnowoda j-zimnowoda requested a review from Copilot June 1, 2026 11:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes deprecated /v1 API surface for team-related resources (teams, services, netpols, workloads, sealed secrets, builds, code repos, and k8s secrets), consolidating behavior on /v2 “APL” endpoints and updating the OpenAPI spec, handler calls, and tests accordingly (leaving /v1/policies intact as noted in the PR description).

Changes:

  • Drop /v1 OpenAPI paths and delete corresponding src/api/v1/** operation handler modules for the removed endpoints.
  • Update OtomiStack and /v2 handlers/tests to use *Apl* methods and APL request/response shapes.
  • Remove the K8sSecret OpenAPI schema/type and migrate sealedsecretskeys to /v2.

Reviewed changes

Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/otomi-stack.ts Removes v1-shaped helpers and renames delete/list methods to APL variants used by v2 endpoints.
src/otomi-stack.test.ts Updates tests to call APL team creation and APL code repo APIs.
src/otomi-models.ts Removes K8sSecret type export derived from OpenAPI components.
src/openapi/k8sSecret.yaml Deletes the K8sSecret schema definition.
src/openapi/api.yaml Removes /v1 paths for the deprecated endpoints; removes K8sSecret component; moves sealedsecretskeys to /v2.
src/middleware/jwt.test.ts Updates tests to create teams via createAplTeam with APL shapes.
src/api/v2/workloadNames.ts Switches to getAllAplWorkloadNames() on the stack.
src/api/v2/teams/{teamId}/workloads/{workloadName}.ts Updates delete handler to call deleteAplWorkload().
src/api/v2/teams/{teamId}/services/{serviceName}.ts Updates delete handler to call deleteAplService().
src/api/v2/teams/{teamId}/sealedsecrets/{sealedSecretName}.ts Updates delete handler to call deleteAplSealedSecret().
src/api/v2/teams/{teamId}/netpols/{netpolName}.ts Updates delete handler to call deleteAplNetpol().
src/api/v2/teams/{teamId}/coderepos/{codeRepositoryName}.ts Updates delete handler to call deleteAplCodeRepo().
src/api/v2/teams/{teamId}/builds/{buildName}.ts Updates delete handler to call deleteAplBuild().
src/api/v2/teams/{teamId}.ts Updates delete handler to call deleteAplTeam().
src/api/v2/sealedsecretskeys.ts Aligns handler documentation/namespace with the /v2/sealedsecretskeys endpoint.
src/api/v2/namespaces/namespaces.ts Switches to getAplNamespacesWithSealedSecrets() on the stack.
src/api/v1/workloads.ts Removes v1 workloads collection handler.
src/api/v1/workloadCatalog.ts Removes v1 workload catalog handler.
src/api/v1/teams/{teamId}/workloads/{workloadName}/values.ts Removes v1 workload values handlers.
src/api/v1/teams/{teamId}/workloads/{workloadName}.ts Removes v1 workload item handlers.
src/api/v1/teams/{teamId}/workloads.ts Removes v1 team workloads handlers.
src/api/v1/teams/{teamId}/services/{serviceName}.ts Removes v1 service item handlers.
src/api/v1/teams/{teamId}/services.ts Removes v1 team services handlers.
src/api/v1/teams/{teamId}/sealedsecrets/{sealedSecretName}.ts Removes v1 sealed secret item handlers.
src/api/v1/teams/{teamId}/sealedsecrets.ts Removes v1 team sealed secrets handlers.
src/api/v1/teams/{teamId}/netpols/{netpolName}.ts Removes v1 netpol item handlers.
src/api/v1/teams/{teamId}/netpols.ts Removes v1 team netpols handlers.
src/api/v1/teams/{teamId}/k8sSecrets.ts Removes v1 k8s secrets handler.
src/api/v1/teams/{teamId}/coderepos/{codeRepositoryName}.ts Removes v1 code repo item handlers.
src/api/v1/teams/{teamId}/coderepos.ts Removes v1 team code repos handlers.
src/api/v1/teams/{teamId}/builds/{buildName}.ts Removes v1 build item handlers.
src/api/v1/teams/{teamId}/builds.ts Removes v1 team builds handlers.
src/api/v1/teams/{teamId}.ts Removes v1 team item handler.
src/api/v1/teams.ts Removes v1 teams collection handlers.
src/api/v1/services.ts Removes v1 services collection handler.
src/api/v1/sealedsecrets.ts Removes v1 sealed secrets collection handler.
src/api/v1/netpols.ts Removes v1 netpols collection handler.
src/api/v1/coderepos.ts Removes v1 code repos collection handler.
src/api/v1/builds.ts Removes v1 builds collection handler.
src/api.authz.test.ts Drops v1 authz tests for removed endpoints.
src/api-v2.authz.test.ts Updates expected v2 method list and adds/adjusts v2 authz coverage where v1 coverage was removed.
Comments suppressed due to low confidence (1)

src/api/v2/sealedsecretskeys.ts:6

  • The debug namespace still uses ...:sealedsecrets, but this handler serves the sealedsecretskeys endpoint. Using a more specific namespace makes logs easier to filter and avoids confusion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/otomi-stack.test.ts
Comment on lines 189 to 207
test('should not create a password when password is specified', async () => {
const myPassword = 'someAwesomePassword'
await otomiStack.createTeam({ name: 'test', password: myPassword })
await otomiStack.createAplTeam({
metadata: {
name: 'test',
labels: {
'apl.io/teamId': 'test',
},
},
spec: {},
kind: 'AplTeamSettingSet',
})

// Password should NOT be in the team settings (it's encrypted in a SealedSecret)
const teamSettings = otomiStack.fileStore.getTeamResource('AplTeamSettingSet', 'test', 'settings')

expect(teamSettings).toBeDefined()
expect(teamSettings?.spec.password).toBeUndefined()

// Verify Git operations were called (SealedSecret was written)
expect(mockGit.writeTextFile).toHaveBeenCalled()
})
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.

4 participants