Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd145a71

Browse files
committed
docs: complete Tasks GA promotion
Update swagger tags and refactor frontend to use dedicated TasksApiMethods class.- Change@tags Experimental to@tags Tasks in coderd/aitasks.go- Extract TasksApiMethods from ExperimentalApiMethods- Update all API.experimental.* task calls to API.tasks.*---🤖 This change was written by Claude Sonnet 4.5 Thinking using [mux](https://github.com/coder/mux) and reviewed by a human 🏂
1 parent02bac71 commitd145a71

File tree

19 files changed

+117
-120
lines changed

19 files changed

+117
-120
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-
// @TagsExperimental
38+
// @TagsTasks
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-
// @TagsExperimental
404+
// @TagsTasks
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-
// @TagsExperimental
504+
// @TagsTasks
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-
// @TagsExperimental
576+
// @TagsTasks
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-
// @TagsExperimental
645+
// @TagsTasks
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-
// @TagsExperimental
725+
// @TagsTasks
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-
// @TagsExperimental
794+
// @TagsTasks
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 aboutcustomizing 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 aboutcustomizing 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"

‎docs/reference/api/experimental.md‎renamed to ‎docs/reference/api/tasks.md‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎site/src/api/api.ts‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,11 @@ export type GetProvisionerDaemonsParams = {
440440
*/
441441
classApiMethods{
442442
experimental:ExperimentalApiMethods;
443+
tasks:TasksApiMethods;
443444

444445
constructor(protectedreadonlyaxios:AxiosInstance){
445446
this.experimental=newExperimentalApiMethods(this.axios);
447+
this.tasks=newTasksApiMethods(this.axios);
446448
}
447449

448450
login=async(
@@ -2646,19 +2648,16 @@ class ApiMethods {
26462648
};
26472649
}
26482650

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-
26552651
exporttypeTaskFeedbackRating="good"|"okay"|"bad";
26562652

26572653
exporttypeCreateTaskFeedbackRequest={
26582654
rate:TaskFeedbackRating;
26592655
comment?:string;
26602656
};
2661-
classExperimentalApiMethods{
2657+
2658+
// All methods must be defined with arrow function syntax. See the docstring
2659+
// above the ApiMethods class for a full explanation.
2660+
classTasksApiMethods{
26622661
constructor(protectedreadonlyaxios:AxiosInstance){}
26632662

26642663
createTask=async(
@@ -2716,6 +2715,15 @@ class ExperimentalApiMethods {
27162715
setTimeout(()=>res(),500);
27172716
});
27182717
};
2718+
}
2719+
2720+
// Experimental API methods call endpoints under the /api/experimental/ prefix.
2721+
// These endpoints are not stable and may change or be removed at any time.
2722+
//
2723+
// All methods must be defined with arrow function syntax. See the docstring
2724+
// above the ApiMethods class for a full explanation.
2725+
classExperimentalApiMethods{
2726+
constructor(protectedreadonlyaxios:AxiosInstance){}
27192727

27202728
getAIBridgeInterceptions=async(options:SearchParamOptions)=>{
27212729
consturl=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.tasks.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.tasks,"deleteTask").mockResolvedValue();
3131
},
3232
play:async({ canvasElement, step})=>{
3333
constbody=within(canvasElement.ownerDocument.body);
@@ -39,7 +39,7 @@ export const DeleteTaskSuccess: Story = {
3939
awaituserEvent.click(confirmButton);
4040
awaitstep("Confirm delete",async()=>{
4141
awaitwaitFor(()=>{
42-
expect(API.experimental.deleteTask).toHaveBeenCalledWith(
42+
expect(API.tasks.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
constqueryClient=newQueryClient();
2222
constdeleteTaskMutation=useMutation({
23-
mutationFn:()=>API.experimental.deleteTask(task.owner_name,task.id),
23+
mutationFn:()=>API.tasks.deleteTask(task.owner_name,task.id),
2424
onSuccess:async()=>{
2525
awaitqueryClient.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
exportconstSubmitting:Story={
2323
beforeEach:async()=>{
24-
spyOn(API.experimental,"createTaskFeedback").mockImplementation(()=>{
24+
spyOn(API.tasks,"createTaskFeedback").mockImplementation(()=>{
2525
returnnewPromise(()=>{});
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.tasks,"createTaskFeedback").mockResolvedValue();
5757
},
5858
play:async({ canvasElement, step})=>{
5959
constbody=within(canvasElement.ownerDocument.body);
@@ -77,20 +77,17 @@ export const Success: Story = {
7777

7878
step("submitted successfully",async()=>{
7979
awaitbody.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.tasks.createTaskFeedback).toHaveBeenCalledWith(MockTask.id,{
81+
rate:"regular",
82+
comment:"This is my comment",
83+
});
8784
});
8885
},
8986
};
9087

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp