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

Commit1b883f3

Browse files
authored
Merge branch 'main' into jakehwll/routing-ai-governance
2 parents7a4bf51 +b90c74a commit1b883f3

File tree

153 files changed

+3546
-1915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+3546
-1915
lines changed

‎.github/actions/setup-sqlc/action.yaml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ runs:
55
using:"composite"
66
steps:
77
-name:Setup sqlc
8-
uses:sqlc-dev/setup-sqlc@c0209b9199cd1cce6a14fc27cabcec491b651761# v4.0.0
9-
with:
10-
sqlc-version:"1.27.0"
8+
# uses: sqlc-dev/setup-sqlc@c0209b9199cd1cce6a14fc27cabcec491b651761 # v4.0.0
9+
# with:
10+
# sqlc-version: "1.30.0"
11+
12+
# Switched to coder/sqlc fork to fix ambiguous column bug, see:
13+
# - https://github.com/coder/sqlc/pull/1
14+
# - https://github.com/sqlc-dev/sqlc/pull/4159
15+
shell:bash
16+
run:|
17+
CGO_ENABLED=1 go install github.com/coder/sqlc/cmd/sqlc@aab4e865a51df0c43e1839f81a9d349b41d14f05

‎.github/actions/setup-tf/action.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ runs:
77
-name:Install Terraform
88
uses:hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd# v3.1.2
99
with:
10-
terraform_version:1.13.0
10+
terraform_version:1.13.4
1111
terraform_wrapper:false

‎.github/workflows/ci.yaml‎

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,17 @@ jobs:
204204
205205
# Needed for helm chart linting
206206
-name:Install helm
207-
uses:azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4# v4.3.1
208-
with:
209-
version:v3.9.2
207+
# uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
208+
# with:
209+
# version: v3.9.2
210+
# The below is taken from https://helm.sh/docs/intro/install/#from-apt-debianubuntu
211+
run:|
212+
set -euo pipefail
213+
sudo apt-get install curl gpg apt-transport-https --yes
214+
curl -fsSL https://packages.buildkite.com/helm-linux/helm-debian/gpgkey | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
215+
echo "deb [signed-by=/usr/share/keyrings/helm.gpg] https://packages.buildkite.com/helm-linux/helm-debian/any/ any main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
216+
sudo apt-get update
217+
sudo apt-get install helm
210218
211219
-name:make lint
212220
run:|
@@ -376,22 +384,14 @@ jobs:
376384
id:go-paths
377385
uses:./.github/actions/setup-go-paths
378386

379-
-name:Download Go Build Cache
380-
id:download-go-build-cache
381-
uses:./.github/actions/test-cache/download
382-
with:
383-
key-prefix:test-go-build-${{ runner.os }}-${{ runner.arch }}
384-
cache-path:${{ steps.go-paths.outputs.cached-dirs }}
385-
386387
-name:Setup Go
387388
uses:./.github/actions/setup-go
388389
with:
389390
# Runners have Go baked-in and Go will automatically
390391
# download the toolchain configured in go.mod, so we don't
391392
# need to reinstall it. It's faster on Windows runners.
392393
use-preinstalled-go:${{ runner.os == 'Windows' }}
393-
# Cache is already downloaded above
394-
use-cache:false
394+
use-cache:true
395395

396396
-name:Setup Terraform
397397
uses:./.github/actions/setup-tf
@@ -505,12 +505,6 @@ jobs:
505505
name:failed-test-db-dump-${{matrix.os}}
506506
path:"**/*.test.sql"
507507

508-
-name:Upload Go Build Cache
509-
uses:./.github/actions/test-cache/upload
510-
with:
511-
cache-key:${{ steps.download-go-build-cache.outputs.cache-key }}
512-
cache-path:${{ steps.go-paths.outputs.cached-dirs }}
513-
514508
-name:Upload Test Cache
515509
uses:./.github/actions/test-cache/upload
516510
with:

‎.github/workflows/dogfood.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
with:
4141
# Pinning to 2.28 here, as Nix gets a "error: [json.exception.type_error.302] type must be array, but is string"
4242
# on version 2.29 and above.
43-
nix_version:"2.28.4"
43+
nix_version:"2.28.5"
4444

4545
-uses:nix-community/cache-nix-action@135667ec418502fa5a3598af6fb9eb733888ce6a# v6.1.3
4646
with:

‎Makefile‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -636,16 +636,16 @@ TAILNETTEST_MOCKS := \
636636
tailnet/tailnettest/subscriptionmock.go
637637

638638
AIBRIDGED_MOCKS :=\
639-
enterprise/x/aibridged/aibridgedmock/clientmock.go\
640-
enterprise/x/aibridged/aibridgedmock/poolmock.go
639+
enterprise/aibridged/aibridgedmock/clientmock.go\
640+
enterprise/aibridged/aibridgedmock/poolmock.go
641641

642642
GEN_FILES :=\
643643
tailnet/proto/tailnet.pb.go\
644644
agent/proto/agent.pb.go\
645645
provisionersdk/proto/provisioner.pb.go\
646646
provisionerd/proto/provisionerd.pb.go\
647647
vpn/vpn.pb.go\
648-
enterprise/x/aibridged/proto/aibridged.pb.go\
648+
enterprise/aibridged/proto/aibridged.pb.go\
649649
$(DB_GEN_FILES)\
650650
$(SITE_GEN_FILES)\
651651
coderd/rbac/object_gen.go\
@@ -697,7 +697,7 @@ gen/mark-fresh:
697697
provisionersdk/proto/provisioner.pb.go\
698698
provisionerd/proto/provisionerd.pb.go\
699699
vpn/vpn.pb.go\
700-
enterprise/x/aibridged/proto/aibridged.pb.go\
700+
enterprise/aibridged/proto/aibridged.pb.go\
701701
coderd/database/dump.sql\
702702
$(DB_GEN_FILES)\
703703
site/src/api/typesGenerated.ts\
@@ -768,8 +768,8 @@ codersdk/workspacesdk/agentconnmock/agentconnmock.go: codersdk/workspacesdk/agen
768768
go generate ./codersdk/workspacesdk/agentconnmock/
769769
touch"$@"
770770

771-
$(AIBRIDGED_MOCKS): enterprise/x/aibridged/client.go enterprise/x/aibridged/pool.go
772-
go generate ./enterprise/x/aibridged/aibridgedmock/
771+
$(AIBRIDGED_MOCKS): enterprise/aibridged/client.go enterprise/aibridged/pool.go
772+
go generate ./enterprise/aibridged/aibridgedmock/
773773
touch"$@"
774774

775775
agent/agentcontainers/dcspec/dcspec_gen.go:\
@@ -822,13 +822,13 @@ vpn/vpn.pb.go: vpn/vpn.proto
822822
--go_opt=paths=source_relative\
823823
./vpn/vpn.proto
824824

825-
enterprise/x/aibridged/proto/aibridged.pb.go: enterprise/x/aibridged/proto/aibridged.proto
825+
enterprise/aibridged/proto/aibridged.pb.go: enterprise/aibridged/proto/aibridged.proto
826826
protoc\
827827
--go_out=.\
828828
--go_opt=paths=source_relative\
829829
--go-drpc_out=.\
830830
--go-drpc_opt=paths=source_relative\
831-
./enterprise/x/aibridged/proto/aibridged.proto
831+
./enterprise/aibridged/proto/aibridged.proto
832832

833833
site/src/api/typesGenerated.ts: site/node_modules/.installed$(wildcard scripts/apitypings/*)$(shell find ./codersdk$(FIND_EXCLUSIONS) -type f -name '*.go')
834834
# -C sets the directory for the go run command

‎agent/agentcontainers/api.go‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,8 +682,6 @@ func (api *API) updaterLoop() {
682682
}else {
683683
prevErr=nil
684684
}
685-
default:
686-
api.logger.Debug(api.ctx,"updater loop ticker skipped, update in progress")
687685
}
688686

689687
returnnil// Always nil to keep the ticker going.

‎agent/files.go‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ func (a *agent) editFile(ctx context.Context, path string, edits []workspacesdk.
250250
transforms[i]=replace.String(edit.Search,edit.Replace)
251251
}
252252

253-
tmpfile,err:=afero.TempFile(a.filesystem,"",filepath.Base(path))
253+
// Create an adjacent file to ensure it will be on the same device and can be
254+
// moved atomically.
255+
tmpfile,err:=afero.TempFile(a.filesystem,filepath.Dir(path),filepath.Base(path))
254256
iferr!=nil {
255257
returnhttp.StatusInternalServerError,err
256258
}

‎cli/exp_task_list_test.go‎

Lines changed: 10 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package cli_test
22

33
import (
44
"bytes"
5-
"context"
65
"database/sql"
76
"encoding/json"
87
"io"
@@ -19,10 +18,7 @@ import (
1918
"github.com/coder/coder/v2/cli/clitest"
2019
"github.com/coder/coder/v2/coderd/coderdtest"
2120
"github.com/coder/coder/v2/coderd/database"
22-
"github.com/coder/coder/v2/coderd/database/dbauthz"
2321
"github.com/coder/coder/v2/coderd/database/dbfake"
24-
"github.com/coder/coder/v2/coderd/database/dbgen"
25-
"github.com/coder/coder/v2/coderd/database/dbtime"
2622
"github.com/coder/coder/v2/coderd/util/slice"
2723
"github.com/coder/coder/v2/codersdk"
2824
"github.com/coder/coder/v2/pty/ptytest"
@@ -43,76 +39,22 @@ func makeAITask(t *testing.T, db database.Store, orgID, adminID, ownerID uuid.UU
4339
},
4440
}).Do()
4541

46-
ws:= database.WorkspaceTable{
42+
build:=dbfake.WorkspaceBuild(t,db, database.WorkspaceTable{
4743
OrganizationID:orgID,
4844
OwnerID:ownerID,
4945
TemplateID:tv.Template.ID,
50-
}
51-
build:=dbfake.WorkspaceBuild(t,db,ws).
46+
}).
5247
Seed(database.WorkspaceBuild{
5348
TemplateVersionID:tv.TemplateVersion.ID,
5449
Transition:transition,
55-
}).WithAgent().Do()
56-
dbgen.WorkspaceBuildParameters(t,db, []database.WorkspaceBuildParameter{
57-
{
58-
WorkspaceBuildID:build.Build.ID,
59-
Name:codersdk.AITaskPromptParameterName,
60-
Value:prompt,
61-
},
62-
})
63-
agents,err:=db.GetWorkspaceAgentsByWorkspaceAndBuildNumber(
64-
dbauthz.AsSystemRestricted(context.Background()),
65-
database.GetWorkspaceAgentsByWorkspaceAndBuildNumberParams{
66-
WorkspaceID:build.Workspace.ID,
67-
BuildNumber:build.Build.BuildNumber,
68-
},
69-
)
70-
require.NoError(t,err)
71-
require.NotEmpty(t,agents)
72-
agentID:=agents[0].ID
73-
74-
// Create a workspace app and set it as the sidebar app.
75-
app:=dbgen.WorkspaceApp(t,db, database.WorkspaceApp{
76-
AgentID:agentID,
77-
Slug:"task-sidebar",
78-
DisplayName:"Task Sidebar",
79-
External:false,
80-
})
81-
82-
// Update build flags to reference the sidebar app and HasAITask=true.
83-
err=db.UpdateWorkspaceBuildFlagsByID(
84-
dbauthz.AsSystemRestricted(context.Background()),
85-
database.UpdateWorkspaceBuildFlagsByIDParams{
86-
ID:build.Build.ID,
87-
HasAITask: sql.NullBool{Bool:true,Valid:true},
88-
HasExternalAgent: sql.NullBool{Bool:false,Valid:false},
89-
SidebarAppID: uuid.NullUUID{UUID:app.ID,Valid:true},
90-
UpdatedAt:build.Build.UpdatedAt,
91-
},
92-
)
93-
require.NoError(t,err)
94-
95-
// Create a task record in the tasks table for the new data model.
96-
task:=dbgen.Task(t,db, database.TaskTable{
97-
OrganizationID:orgID,
98-
OwnerID:ownerID,
99-
Name:build.Workspace.Name,
100-
WorkspaceID: uuid.NullUUID{UUID:build.Workspace.ID,Valid:true},
101-
TemplateVersionID:tv.TemplateVersion.ID,
102-
TemplateParameters: []byte("{}"),
103-
Prompt:prompt,
104-
CreatedAt:dbtime.Now(),
105-
})
106-
107-
// Link the task to the workspace app.
108-
dbgen.TaskWorkspaceApp(t,db, database.TaskWorkspaceApp{
109-
TaskID:task.ID,
110-
WorkspaceBuildNumber:build.Build.BuildNumber,
111-
WorkspaceAgentID: uuid.NullUUID{UUID:agentID,Valid:true},
112-
WorkspaceAppID: uuid.NullUUID{UUID:app.ID,Valid:true},
113-
})
114-
115-
returntask
50+
}).
51+
WithAgent().
52+
WithTask(database.TaskTable{
53+
Prompt:prompt,
54+
},nil).
55+
Do()
56+
57+
returnbuild.Task
11658
}
11759

11860
funcTestExpTaskList(t*testing.T) {

‎cli/exp_task_test.go‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ func createAITaskTemplate(t *testing.T, client *codersdk.Client, orgID uuid.UUID
293293
{
294294
Type:&proto.Response_Plan{
295295
Plan:&proto.PlanComplete{
296-
Parameters: []*proto.RichParameter{{Name:codersdk.AITaskPromptParameterName,Type:"string"}},
297296
HasAiTasks:true,
298297
},
299298
},
@@ -328,9 +327,7 @@ func createAITaskTemplate(t *testing.T, client *codersdk.Client, orgID uuid.UUID
328327
},
329328
AiTasks: []*proto.AITask{
330329
{
331-
SidebarApp:&proto.AITaskSidebarApp{
332-
Id:taskAppID.String(),
333-
},
330+
AppId:taskAppID.String(),
334331
},
335332
},
336333
},

‎cli/testdata/coder_list_--output_json.golden‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"allow_renames": false,
9191
"favorite": false,
9292
"next_start_at": "====[timestamp]=====",
93-
"is_prebuild": false
93+
"is_prebuild": false,
94+
"task_id": null
9495
}
9596
]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp