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

Commita199c49

Browse files
committed
chore: reparent under experimental pkg
1 parent7f3955a commita199c49

File tree

7 files changed

+334
-342
lines changed

7 files changed

+334
-342
lines changed

‎Makefile‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ GEN_FILES := \
641641
provisionersdk/proto/provisioner.pb.go\
642642
provisionerd/proto/provisionerd.pb.go\
643643
vpn/vpn.pb.go\
644-
aibridged/proto/aibridged.pb.go\
644+
enterprise/x/aibridged/proto/aibridged.pb.go\
645645
$(DB_GEN_FILES)\
646646
$(SITE_GEN_FILES)\
647647
coderd/rbac/object_gen.go\
@@ -690,7 +690,7 @@ gen/mark-fresh:
690690
provisionersdk/proto/provisioner.pb.go\
691691
provisionerd/proto/provisionerd.pb.go\
692692
vpn/vpn.pb.go\
693-
aibridged/proto/aibridged.pb.go\
693+
enterprise/x/aibridged/proto/aibridged.pb.go\
694694
coderd/database/dump.sql\
695695
$(DB_GEN_FILES)\
696696
site/src/api/typesGenerated.ts\
@@ -810,13 +810,13 @@ vpn/vpn.pb.go: vpn/vpn.proto
810810
--go_opt=paths=source_relative\
811811
./vpn/vpn.proto
812812

813-
aibridged/proto/aibridged.pb.go: aibridged/proto/aibridged.proto
813+
enterprise/x/aibridged/proto/aibridged.pb.go:enterprise/x/aibridged/proto/aibridged.proto
814814
protoc\
815815
--go_out=.\
816816
--go_opt=paths=source_relative\
817817
--go-drpc_out=.\
818818
--go-drpc_opt=paths=source_relative\
819-
./aibridged/proto/aibridged.proto
819+
./enterprise/x/aibridged/proto/aibridged.proto
820820

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

‎aibridged/proto/aibridged.pb.go‎renamed to ‎enterprise/x/aibridged/proto/aibridged.pb.go‎

Lines changed: 289 additions & 288 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
File renamed without changes.

‎aibridged/proto/aibridged_drpc.pb.go‎renamed to ‎enterprise/x/aibridged/proto/aibridged_drpc.pb.go‎

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

‎coderd/aibridgedserver/aibridgedserver.go‎renamed to ‎enterprise/x/aibridgedserver/aibridgedserver.go‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ import (
1818

1919
"cdr.dev/slog"
2020

21-
"github.com/coder/coder/v2/aibridged/proto"
2221
"github.com/coder/coder/v2/coderd/database"
2322
"github.com/coder/coder/v2/coderd/database/dbauthz"
2423
"github.com/coder/coder/v2/coderd/database/dbtime"
2524
"github.com/coder/coder/v2/coderd/externalauth"
2625
"github.com/coder/coder/v2/coderd/httpmw"
2726
codermcp"github.com/coder/coder/v2/coderd/mcp"
2827
"github.com/coder/coder/v2/codersdk"
28+
"github.com/coder/coder/v2/enterprise/x/aibridged/proto"
2929
)
3030

3131
var (
@@ -75,9 +75,7 @@ type Server struct {
7575
lifecycleCtx context.Context
7676
storestore
7777
logger slog.Logger
78-
accessURLstring
7978
externalAuthConfigsmap[string]*externalauth.Config
80-
experiments codersdk.Experiments
8179

8280
coderMCPConfig*proto.MCPServerConfig// may be nil if not available
8381
}
@@ -102,9 +100,7 @@ func NewServer(lifecycleCtx context.Context, store store, logger slog.Logger, ac
102100
lifecycleCtx:lifecycleCtx,
103101
store:store,
104102
logger:logger.Named("aibridgedserver"),
105-
accessURL:accessURL,
106103
externalAuthConfigs:eac,
107-
experiments:experiments,
108104
coderMCPConfig:coderMCPConfig,
109105
},nil
110106
}
File renamed without changes.

‎coderd/aibridgedserver/aibridgedserver_test.go‎renamed to ‎enterprise/x/aibridgedserver/aibridgedserver_test.go‎

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"crypto/sha256"
66
"database/sql"
7+
"encoding/json"
78
"fmt"
89
"net"
910
"net/url"
@@ -20,15 +21,15 @@ import (
2021
"google.golang.org/protobuf/types/known/structpb"
2122
"google.golang.org/protobuf/types/known/timestamppb"
2223

23-
"github.com/coder/coder/v2/aibridged/proto"
24-
"github.com/coder/coder/v2/coderd/aibridgedserver"
2524
"github.com/coder/coder/v2/coderd/database"
2625
"github.com/coder/coder/v2/coderd/database/dbmock"
2726
"github.com/coder/coder/v2/coderd/database/dbtime"
2827
"github.com/coder/coder/v2/coderd/externalauth"
2928
codermcp"github.com/coder/coder/v2/coderd/mcp"
3029
"github.com/coder/coder/v2/codersdk"
3130
"github.com/coder/coder/v2/cryptorand"
31+
"github.com/coder/coder/v2/enterprise/x/aibridged/proto"
32+
"github.com/coder/coder/v2/enterprise/x/aibridgedserver"
3233
"github.com/coder/coder/v2/testutil"
3334
)
3435

@@ -135,8 +136,6 @@ func TestAuthorization(t *testing.T) {
135136
LastSeenAt:now,
136137
}
137138

138-
// Mock the call to insert an API key since dbgen seems to be the
139-
// best util to use to generate and fake an API key.
140139
keyID,_:=cryptorand.String(10)
141140
keySecret,_:=cryptorand.String(22)
142141
token:=fmt.Sprintf("%s-%s",keyID,keySecret)
@@ -368,23 +367,19 @@ func TestRecordInterception(t *testing.T) {
368367
initiatorID,err:=uuid.Parse(req.GetInitiatorId())
369368
assert.NoError(t,err,"parse interception initiator UUID")
370369

371-
db.EXPECT().InsertAIBridgeInterception(gomock.Any(),gomock.Cond(func(p database.InsertAIBridgeInterceptionParams)bool {
372-
if!assert.NotEqual(t,uuid.Nil,p.ID,"ID")||
373-
!assert.Equal(t,interceptionID,p.ID,"interception ID")||
374-
!assert.Equal(t,initiatorID,p.InitiatorID,"initiator ID")||
375-
!assert.Equal(t,req.GetProvider(),p.Provider,"provider")||
376-
!assert.Equal(t,req.GetModel(),p.Model,"model")||
377-
!assert.JSONEq(t,metadataJSON,string(p.Metadata),"metadata")||
378-
!assert.WithinDuration(t,req.GetStartedAt().AsTime(),p.StartedAt,time.Second,"started at") {
379-
returnfalse
380-
}
381-
returntrue
382-
})).Return(database.AIBridgeInterception{
370+
db.EXPECT().InsertAIBridgeInterception(gomock.Any(), database.InsertAIBridgeInterceptionParams{
371+
ID:interceptionID,
372+
InitiatorID:initiatorID,
373+
Provider:req.GetProvider(),
374+
Model:req.GetModel(),
375+
Metadata:json.RawMessage(metadataJSON),
376+
StartedAt:req.StartedAt.AsTime().UTC(),
377+
}).Return(database.AIBridgeInterception{
383378
ID:interceptionID,
384379
InitiatorID:initiatorID,
385380
Provider:req.GetProvider(),
386381
Model:req.GetModel(),
387-
StartedAt:req.GetStartedAt().AsTime(),
382+
StartedAt:req.StartedAt.AsTime().UTC(),
388383
},nil)
389384
},
390385
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp