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

Commit7eb5519

Browse files
committed
Merge branch 'main' into provisionerdaemon
2 parentse87f31d +d76737b commit7eb5519

File tree

11 files changed

+107
-96
lines changed

11 files changed

+107
-96
lines changed

‎coderd/coderdtest/coderdtest.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ func New(t *testing.T) Server {
119119

120120
pubsub,err=database.NewPubsub(context.Background(),sqlDB,connectionURL)
121121
require.NoError(t,err)
122+
t.Cleanup(func() {
123+
_=pubsub.Close()
124+
})
122125
}
123126

124127
handler:=coderd.New(&coderd.Options{

‎coderd/workspacehistory_test.go‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ func TestWorkspaceHistory(t *testing.T) {
5757
hist,err:=client.ProjectHistory(context.Background(),user.Organization,project.Name,projectHistory.Name)
5858
require.NoError(t,err)
5959
returnhist.Import.Status.Completed()
60-
},time.Second,10*time.Millisecond)
60+
},3*time.Second,50*time.Millisecond)
6161
returnprojectHistory
6262
}
6363

6464
t.Run("AllHistory",func(t*testing.T) {
6565
t.Parallel()
6666
server:=coderdtest.New(t)
67-
_=server.AddProvisionerd(t)
6867
user:=server.RandomInitialUser(t)
68+
_=server.AddProvisionerd(t)
6969
project,workspace:=setupProjectAndWorkspace(t,server.Client,user)
7070
history,err:=server.Client.ListWorkspaceHistory(context.Background(),"",workspace.Name)
7171
require.NoError(t,err)
@@ -86,8 +86,8 @@ func TestWorkspaceHistory(t *testing.T) {
8686
t.Run("LatestHistory",func(t*testing.T) {
8787
t.Parallel()
8888
server:=coderdtest.New(t)
89-
_=server.AddProvisionerd(t)
9089
user:=server.RandomInitialUser(t)
90+
_=server.AddProvisionerd(t)
9191
project,workspace:=setupProjectAndWorkspace(t,server.Client,user)
9292
_,err:=server.Client.WorkspaceHistory(context.Background(),"",workspace.Name,"")
9393
require.Error(t,err)
@@ -106,8 +106,8 @@ func TestWorkspaceHistory(t *testing.T) {
106106
t.Run("CreateHistory",func(t*testing.T) {
107107
t.Parallel()
108108
server:=coderdtest.New(t)
109-
_=server.AddProvisionerd(t)
110109
user:=server.RandomInitialUser(t)
110+
_=server.AddProvisionerd(t)
111111
project,workspace:=setupProjectAndWorkspace(t,server.Client,user)
112112
projectHistory:=setupProjectHistory(t,server.Client,user,project,map[string]string{
113113
"main.tf":`resource "null_resource" "example" {}`,
@@ -131,8 +131,8 @@ func TestWorkspaceHistory(t *testing.T) {
131131
t.Run("CreateHistoryAlreadyInProgress",func(t*testing.T) {
132132
t.Parallel()
133133
server:=coderdtest.New(t)
134-
_=server.AddProvisionerd(t)
135134
user:=server.RandomInitialUser(t)
135+
_=server.AddProvisionerd(t)
136136
project,workspace:=setupProjectAndWorkspace(t,server.Client,user)
137137
projectHistory:=setupProjectHistory(t,server.Client,user,project,map[string]string{
138138
"some":"content",
@@ -154,8 +154,8 @@ func TestWorkspaceHistory(t *testing.T) {
154154
t.Run("CreateHistoryInvalidProjectVersion",func(t*testing.T) {
155155
t.Parallel()
156156
server:=coderdtest.New(t)
157-
_=server.AddProvisionerd(t)
158157
user:=server.RandomInitialUser(t)
158+
_=server.AddProvisionerd(t)
159159
_,workspace:=setupProjectAndWorkspace(t,server.Client,user)
160160

161161
_,err:=server.Client.CreateWorkspaceHistory(context.Background(),"",workspace.Name, coderd.CreateWorkspaceHistoryRequest{

‎database/query.sql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ WHERE
2929
ANDnested.completed_at ISNULL
3030
ANDnested.provisioner= ANY(@types :: provisioner_type [ ])
3131
ORDER BY
32-
nested.created FOR
32+
nested.created_at FOR
3333
UPDATE
3434
SKIP LOCKED
3535
LIMIT

‎database/query.sql.go‎

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

‎develop.sh‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ function create_initial_user() {
1414
# TODO: We need to wait for `coderd` to spin up -
1515
# need to replace with a deterministic strategy
1616
sleep 5s
17-
17+
1818
curl -X POST \
19-
-d"{\"email\":\"$EMAIL\",\"username\":\"$USERNAME\",\"organization\":\"$ORGANIZATION\",\"password\":\"$PASSWORD\"}" \
20-
-H'Content-Type:application/json' \
21-
http://localhost:3000/api/v2/user
19+
-d"{\"email\":\"$EMAIL\",\"username\":\"$USERNAME\",\"organization\":\"$ORGANIZATION\",\"password\":\"$PASSWORD\"}" \
20+
-H'Content-Type:application/json' \
21+
http://localhost:3000/api/v2/user
2222
}
2323

2424
# Do initial build - a dev build for coderd.
@@ -29,4 +29,9 @@ make bin/coderd
2929
# This is a way to run multiple processes in parallel, and have Ctrl-C work correctly
3030
# to kill both at the same time. For more details, see:
3131
# https://stackoverflow.com/questions/3004811/how-do-you-run-multiple-programs-in-parallel-from-a-bash-script
32-
(trap'kill 0' SIGINT; create_initial_user& CODERV2_HOST=http://127.0.0.1:3000 yarn dev& ./bin/coderd)
32+
(
33+
trap'kill 0' SIGINT
34+
create_initial_user&
35+
CODERV2_HOST=http://127.0.0.1:3000 yarn --cwd=./site dev&
36+
./bin/coderd
37+
)

‎peer/conn.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ func (c *Conn) init() error {
145145

146146
c.rtc.OnNegotiationNeeded(c.negotiate)
147147
c.rtc.OnICEConnectionStateChange(func(iceConnectionState webrtc.ICEConnectionState) {
148+
ifc.isClosed() {
149+
return
150+
}
151+
148152
c.opts.Logger.Debug(context.Background(),"ice connection state updated",
149153
slog.F("state",iceConnectionState))
150154

‎provisionerd/provisionerd.go‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,7 @@ func (p *provisionerDaemon) runJob(ctx context.Context) {
214214
}
215215
}
216216
}()
217-
gofunc() {
218-
select {
219-
case<-p.closed:
220-
case<-ctx.Done():
221-
}
222-
217+
deferfunc() {
223218
// Cleanup the work directory after execution.
224219
err:=os.RemoveAll(p.opts.WorkDirectory)
225220
iferr!=nil {

‎site/dev.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if (process.env.CODERV2_HOST) {
1717

1818
console.log(`Using CODERV2_HOST:${coderV2Host}`)
1919

20-
constapp=next({ dev,dir:"./site"})
20+
constapp=next({ dev,dir:"."})
2121
consthandle=app.getRequestHandler()
2222

2323
app

‎site/jest.config.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ module.exports = {
3131
"<rootDir>/**/*.ts",
3232
"<rootDir>/**/*.tsx",
3333
"!<rootDir>/**/*.stories.tsx",
34+
"!<rootDir>/_jest/**/*.*",
3435
"!<rootDir>/.next/**/*.*",
3536
"!<rootDir>/api.ts",
37+
"!<rootDir>/coverage/**/*.*",
3638
"!<rootDir>/dev.ts",
39+
"!<rootDir>/jest-runner.eslint.config.js",
40+
"!<rootDir>/jest.config.js",
3741
"!<rootDir>/next-env.d.ts",
3842
"!<rootDir>/next.config.js",
3943
"!<rootDir>/out/**/*.*",

‎site/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"http-proxy-middleware":"2.0.2",
4545
"jest":"27.4.7",
4646
"jest-runner-eslint":"1.0.0",
47-
"next":"12.0.9",
47+
"next":"12.0.10",
4848
"next-router-mock":"^0.6.5",
4949
"prettier":"2.5.1",
5050
"react":"17.0.2",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp