feat: remove v1 endpoints#1006
Open
dennisvankekem wants to merge 9 commits into
Open
Conversation
9 tasks
There was a problem hiding this comment.
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
/v1OpenAPI paths and delete correspondingsrc/api/v1/**operation handler modules for the removed endpoints. - Update
OtomiStackand/v2handlers/tests to use*Apl*methods and APL request/response shapes. - Remove the
K8sSecretOpenAPI 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 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() | ||
| }) |
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.
Remove the v1 endpoints for team
Includes:
Does not include
v1/policies
console: linode/apl-console#798
api: #1006