Skip to content

refactor: update all Coder plugin code to use Backstage API system and API factories #123

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

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bf02e9a
refactor: finish splitting off all api logic into separate files
Parkreiner Apr 23, 2024
ce1f0ac
chore: update Backstage setup/plugin code
Parkreiner Apr 23, 2024
2049da1
chore: update all hook definitions
Parkreiner Apr 23, 2024
e35a0a7
fix: update useCoderWorkspacesQuery
Parkreiner Apr 23, 2024
5a8e10e
chore: update references for all auth wrappers
Parkreiner Apr 23, 2024
19a0100
chore: update imports for CoderProvider
Parkreiner Apr 23, 2024
c2ee1c5
fix: update type imports for setup.tsx file
Parkreiner Apr 23, 2024
84cfdbb
fix: update all remaining type imports
Parkreiner Apr 23, 2024
f33b4e7
fix: make sure auth state is cached when distributed across multiple …
Parkreiner Apr 23, 2024
de847b9
fix: stabilize value of React client better
Parkreiner Apr 24, 2024
60638a0
refactor: move auth UI logic back into provider
Parkreiner Apr 24, 2024
935a24e
wip: commit progress on Auth provider changes
Parkreiner Apr 24, 2024
944281b
Merge branch 'mes/api-factories-03' into mes/api-factories-04
Parkreiner Apr 24, 2024
3924576
wip: commit progress on auth provider refactor
Parkreiner Apr 24, 2024
82b4b5b
Merge branch 'mes/api-factories-03' into mes/api-factories-04
Parkreiner Apr 24, 2024
63d0f27
chore: delete old endpoint
Parkreiner Apr 24, 2024
c92443f
refactor: finish moving all user-facing code to provider
Parkreiner Apr 24, 2024
c6caa7f
fix: tighten up StatusInfo type
Parkreiner Apr 24, 2024
0c7b556
refactor: delete old useCoderTokenAuth file
Parkreiner Apr 24, 2024
0d8b977
fix: resolve more failing test cases
Parkreiner Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
318 changes: 0 additions & 318 deletions plugins/backstage-plugin-coder/src/api.ts

This file was deleted.

11 changes: 8 additions & 3 deletions plugins/backstage-plugin-coder/src/api/CoderClient.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import {
import { CoderTokenAuth } from './CoderTokenAuth';
import type { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
import { CoderAuthApi } from './Auth';
import { server, wrappedGet } from '../testHelpers/server';
import {
dummyAuthValidationEndpoint,
server,
wrappedGet,
} from '../testHelpers/server';

type SetupClientInput = Readonly<{
authApi?: CoderAuthApi;
Expand Down Expand Up @@ -189,10 +193,11 @@ describe(`${CoderClient.name}`, () => {
authApi.registerNewToken(mockCoderAuthToken);

const newBaseUrl = 'https://www.zombo.com/api/you-can-do-anything';
const serverRouteUrl = `${newBaseUrl}${defaultCoderClientConfigOptions.proxyPrefix}${defaultCoderClientConfigOptions.apiRoutePrefix}/users/me/login-type`;
const newRoute =
`${newBaseUrl}${defaultCoderClientConfigOptions.proxyPrefix}${defaultCoderClientConfigOptions.apiRoutePrefix}${dummyAuthValidationEndpoint}` as const;

server.use(
wrappedGet(serverRouteUrl, (_, res, ctx) => {
wrappedGet(newRoute, (_, res, ctx) => {
return res(ctx.status(200));
}),
);
Expand Down
Loading