Skip to content

Commit e189dc1

Browse files
authored
fix: complete Tasks GA promotion (docs, site) (#20927)
## Summary Completes the Coder Tasks GA promotion by updating swagger tags and regenerating API documentation and updating the frontend API structure. ## Related Follows #20923 and #20921 which promoted Tasks from Beta/Experimental to GA. --- 🤖 This change was written by Claude Sonnet 4.5 Thinking using [mux](https://github.com/coder/mux) and reviewed by a human 🏂
1 parent 2f399ea commit e189dc1

File tree

19 files changed

+118
-129
lines changed

19 files changed

+118
-129
lines changed

coderd/aitasks.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
// @Security CoderSessionToken
3636
// @Accept json
3737
// @Produce json
38-
// @Tags Experimental
38+
// @Tags Tasks
3939
// @Param user path string true "Username, user ID, or 'me' for the authenticated user"
4040
// @Param request body codersdk.CreateTaskRequest true "Create task request"
4141
// @Success 201 {object} codersdk.Task
@@ -401,7 +401,7 @@ func deriveTaskCurrentState(
401401
// @ID list-ai-tasks
402402
// @Security CoderSessionToken
403403
// @Produce json
404-
// @Tags Experimental
404+
// @Tags Tasks
405405
// @Param q query string false "Search query for filtering tasks. Supports: owner:<username/uuid/me>, organization:<org-name/uuid>, status:<status>"
406406
// @Success 200 {object} codersdk.TasksListResponse
407407
// @Router /tasks [get]
@@ -501,7 +501,7 @@ func (api *API) convertTasks(ctx context.Context, requesterID uuid.UUID, dbTasks
501501
// @ID get-ai-task-by-id-or-name
502502
// @Security CoderSessionToken
503503
// @Produce json
504-
// @Tags Experimental
504+
// @Tags Tasks
505505
// @Param user path string true "Username, user ID, or 'me' for the authenticated user"
506506
// @Param task path string true "Task ID, or task name"
507507
// @Success 200 {object} codersdk.Task
@@ -573,7 +573,7 @@ func (api *API) taskGet(rw http.ResponseWriter, r *http.Request) {
573573
// @Summary Delete AI task
574574
// @ID delete-ai-task
575575
// @Security CoderSessionToken
576-
// @Tags Experimental
576+
// @Tags Tasks
577577
// @Param user path string true "Username, user ID, or 'me' for the authenticated user"
578578
// @Param task path string true "Task ID, or task name"
579579
// @Success 202
@@ -642,7 +642,7 @@ func (api *API) taskDelete(rw http.ResponseWriter, r *http.Request) {
642642
// @ID update-ai-task-input
643643
// @Security CoderSessionToken
644644
// @Accept json
645-
// @Tags Experimental
645+
// @Tags Tasks
646646
// @Param user path string true "Username, user ID, or 'me' for the authenticated user"
647647
// @Param task path string true "Task ID, or task name"
648648
// @Param request body codersdk.UpdateTaskInputRequest true "Update task input request"
@@ -722,7 +722,7 @@ func (api *API) taskUpdateInput(rw http.ResponseWriter, r *http.Request) {
722722
// @ID send-input-to-ai-task
723723
// @Security CoderSessionToken
724724
// @Accept json
725-
// @Tags Experimental
725+
// @Tags Tasks
726726
// @Param user path string true "Username, user ID, or 'me' for the authenticated user"
727727
// @Param task path string true "Task ID, or task name"
728728
// @Param request body codersdk.TaskSendRequest true "Task input request"
@@ -791,7 +791,7 @@ func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) {
791791
// @ID get-ai-task-logs
792792
// @Security CoderSessionToken
793793
// @Produce json
794-
// @Tags Experimental
794+
// @Tags Tasks
795795
// @Param user path string true "Username, user ID, or 'me' for the authenticated user"
796796
// @Param task path string true "Task ID, or task name"
797797
// @Success 200 {object} codersdk.TaskLogsResponse

coderd/apidoc/docs.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,10 +1166,6 @@
11661166
"title": "Enterprise",
11671167
"path": "./reference/api/enterprise.md"
11681168
},
1169-
{
1170-
"title": "Experimental",
1171-
"path": "./reference/api/experimental.md"
1172-
},
11731169
{
11741170
"title": "Files",
11751171
"path": "./reference/api/files.md"
@@ -1214,6 +1210,10 @@
12141210
"title": "Schemas",
12151211
"path": "./reference/api/schemas.md"
12161212
},
1213+
{
1214+
"title": "Tasks",
1215+
"path": "./reference/api/tasks.md"
1216+
},
12171217
{
12181218
"title": "Templates",
12191219
"path": "./reference/api/templates.md"
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/api/api.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2644,22 +2644,6 @@ class ApiMethods {
26442644
markAllInboxNotificationsAsRead = async () => {
26452645
await this.axios.put<void>("/api/v2/notifications/inbox/mark-all-as-read");
26462646
};
2647-
}
2648-
2649-
// Experimental API methods call endpoints under the /api/experimental/ prefix.
2650-
// These endpoints are not stable and may change or be removed at any time.
2651-
//
2652-
// All methods must be defined with arrow function syntax. See the docstring
2653-
// above the ApiMethods class for a full explanation.
2654-
2655-
export type TaskFeedbackRating = "good" | "okay" | "bad";
2656-
2657-
export type CreateTaskFeedbackRequest = {
2658-
rate: TaskFeedbackRating;
2659-
comment?: string;
2660-
};
2661-
class ExperimentalApiMethods {
2662-
constructor(protected readonly axios: AxiosInstance) {}
26632647

26642648
createTask = async (
26652649
user: string,
@@ -2716,6 +2700,22 @@ class ExperimentalApiMethods {
27162700
setTimeout(() => res(), 500);
27172701
});
27182702
};
2703+
}
2704+
2705+
export type TaskFeedbackRating = "good" | "okay" | "bad";
2706+
2707+
export type CreateTaskFeedbackRequest = {
2708+
rate: TaskFeedbackRating;
2709+
comment?: string;
2710+
};
2711+
2712+
// Experimental API methods call endpoints under the /api/experimental/ prefix.
2713+
// These endpoints are not stable and may change or be removed at any time.
2714+
//
2715+
// All methods must be defined with arrow function syntax. See the docstring
2716+
// above the ApiMethods class for a full explanation.
2717+
class ExperimentalApiMethods {
2718+
constructor(protected readonly axios: AxiosInstance) {}
27192719

27202720
getAIBridgeInterceptions = async (options: SearchParamOptions) => {
27212721
const url = getURLWithSearchParams(

site/src/modules/dashboard/Navbar/NavbarView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ const TasksNavItem: FC<TasksNavItemProps> = ({ user }) => {
207207
};
208208
const { data: idleCount } = useQuery({
209209
queryKey: ["tasks", filter],
210-
queryFn: () => API.experimental.getTasks(filter),
210+
queryFn: () => API.getTasks(filter),
211211
refetchInterval: 1_000 * 60,
212212
enabled: canSeeTasks,
213213
refetchOnWindowFocus: true,

site/src/modules/tasks/TaskDeleteDialog/TaskDeleteDialog.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const DeleteTaskSuccess: Story = {
2727
},
2828
},
2929
beforeEach: () => {
30-
spyOn(API.experimental, "deleteTask").mockResolvedValue();
30+
spyOn(API, "deleteTask").mockResolvedValue();
3131
},
3232
play: async ({ canvasElement, step }) => {
3333
const body = within(canvasElement.ownerDocument.body);
@@ -39,7 +39,7 @@ export const DeleteTaskSuccess: Story = {
3939
await userEvent.click(confirmButton);
4040
await step("Confirm delete", async () => {
4141
await waitFor(() => {
42-
expect(API.experimental.deleteTask).toHaveBeenCalledWith(
42+
expect(API.deleteTask).toHaveBeenCalledWith(
4343
MockTask.owner_name,
4444
MockTask.id,
4545
);

site/src/modules/tasks/TaskDeleteDialog/TaskDeleteDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const TaskDeleteDialog: FC<TaskDeleteDialogProps> = ({
2020
}) => {
2121
const queryClient = new QueryClient();
2222
const deleteTaskMutation = useMutation({
23-
mutationFn: () => API.experimental.deleteTask(task.owner_name, task.id),
23+
mutationFn: () => API.deleteTask(task.owner_name, task.id),
2424
onSuccess: async () => {
2525
await queryClient.invalidateQueries({ queryKey: ["tasks"] });
2626
},

site/src/modules/tasks/TaskFeedbackDialog/TaskFeedbackDialog.stories.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const Idle: Story = {};
2121

2222
export const Submitting: Story = {
2323
beforeEach: async () => {
24-
spyOn(API.experimental, "createTaskFeedback").mockImplementation(() => {
24+
spyOn(API, "createTaskFeedback").mockImplementation(() => {
2525
return new Promise(() => {});
2626
});
2727
},
@@ -53,7 +53,7 @@ export const Success: Story = {
5353
},
5454
decorators: [withGlobalSnackbar],
5555
beforeEach: async () => {
56-
spyOn(API.experimental, "createTaskFeedback").mockResolvedValue();
56+
spyOn(API, "createTaskFeedback").mockResolvedValue();
5757
},
5858
play: async ({ canvasElement, step }) => {
5959
const body = within(canvasElement.ownerDocument.body);
@@ -77,20 +77,17 @@ export const Success: Story = {
7777

7878
step("submitted successfully", async () => {
7979
await body.findByText("Feedback submitted successfully");
80-
expect(API.experimental.createTaskFeedback).toHaveBeenCalledWith(
81-
MockTask.id,
82-
{
83-
rate: "regular",
84-
comment: "This is my comment",
85-
},
86-
);
80+
expect(API.createTaskFeedback).toHaveBeenCalledWith(MockTask.id, {
81+
rate: "regular",
82+
comment: "This is my comment",
83+
});
8784
});
8885
},
8986
};
9087

9188
export const Failure: Story = {
9289
beforeEach: async () => {
93-
spyOn(API.experimental, "createTaskFeedback").mockRejectedValue(
90+
spyOn(API, "createTaskFeedback").mockRejectedValue(
9491
mockApiError({
9592
message: "Failed to submit feedback",
9693
detail: "Server is down",

0 commit comments

Comments
 (0)