Skip to content

Commit

Permalink
Merge pull request #5046 from MegaWatt01/feat/add-api-client-coverage
Browse files Browse the repository at this point in the history
feat: add remainder of changset routes to API client
  • Loading branch information
stack72 authored Dec 2, 2024
2 parents d0d2b1c + e86f27a commit 9991cf4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 7 deletions.
51 changes: 45 additions & 6 deletions bin/si-api-test/sdf_api_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,62 @@ interface API_DESCRIPTION {
}

export const ROUTES = {
// Change Set Management ------------------------------------------------------
// /api/change_set - Change Set Management ---------------------------------------------------
abandon_vote: {
path: () => "/change_set/abandon_vote",
method: "POST",
},
abandon_change_set: {
path: () => "/change_set/abandon_change_set",
method: "POST",
},
add_action: {
path: () => "/change_set/add_action",
method: "POST",
},
apply_change_set: {
path: () => "/change_set/apply_change_set",
method: "POST",
},
create_change_set: {
path: () => "/change_set/create_change_set",
begin_abandon_approval_process: {
path: () => "/change_set/begin_abandon_approval_process",
method: "POST",
},
abandon_change_set: {
path: () => "/change_set/abandon_change_set",
begin_approval_process: {
path: () => "/change_set/begin_approval_process",
method: "POST",
},
cancel_abandon_approval_process: {
path: () => "/change_set/cancel_abandon_approval_process",
method: "POST",
},
open_change_sets: {
cancel_approval_process: {
path: () => "/change_set/cancel_approval_process",
method: "POST",
},
create_change_set: {
path: () => "/change_set/create_change_set",
method: "POST",
},
list_open_change_sets: {
path: () => "/change_set/list_open_change_sets",
method: "GET",
},
merge_vote: {
path: () => "/change_set/merge_vote",
method: "POST",
},
rebase_on_base: {
path: () => "/change_set/rebase_on_base",
method: "POST",
},
status_with_base: {
path: () => "/change_set/status_with_base",
method: "POST",
},

// V2/Workspaces ---------------------------------------------------------
// TODO(MegaWatt01): come back to properly format this hanging route
schema_variants: {
path: (vars: ROUTE_VARS) =>
`/v2/workspaces/${vars.workspaceId}/change-sets/${vars.changeSetId}/schema-variants`,
Expand Down
2 changes: 1 addition & 1 deletion bin/si-api-test/tests/6-get_head_changeset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from "node:assert";
import { SdfApiClient } from "../sdf_api_client.ts";

export default async function get_head_changeset(sdfApiClient: SdfApiClient) {
const data = await sdfApiClient.call({ route: "open_change_sets" });
const data = await sdfApiClient.call({ route: "list_open_change_sets" });

assert(data.headChangeSetId, "Expected headChangeSetId");
const head = data.changeSets.find((c) => c.id === data.headChangeSetId);
Expand Down

0 comments on commit 9991cf4

Please sign in to comment.