@@ -163,7 +163,7 @@ func TestSubAgentAPI(t *testing.T) {
163
163
agentID ,err := uuid .FromBytes (createResp .Agent .Id )
164
164
require .NoError (t ,err )
165
165
166
- agent ,err := api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),agentID )//nolint:gocritic // this is a test.
166
+ agent ,err := api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),agentID )
167
167
require .NoError (t ,err )
168
168
169
169
assert .Equal (t ,tt .agentName ,agent .Name )
@@ -621,7 +621,7 @@ func TestSubAgentAPI(t *testing.T) {
621
621
agentID ,err := uuid .FromBytes (createResp .Agent .Id )
622
622
require .NoError (t ,err )
623
623
624
- apps ,err := api .Database .GetWorkspaceAppsByAgentID (dbauthz .AsSystemRestricted (ctx ),agentID )//nolint:gocritic // this is a test.
624
+ apps ,err := api .Database .GetWorkspaceAppsByAgentID (dbauthz .AsSystemRestricted (ctx ),agentID )
625
625
require .NoError (t ,err )
626
626
627
627
// Sort the apps for determinism
@@ -751,7 +751,7 @@ func TestSubAgentAPI(t *testing.T) {
751
751
agentID ,err := uuid .FromBytes (createResp .Agent .Id )
752
752
require .NoError (t ,err )
753
753
754
- apps ,err := db .GetWorkspaceAppsByAgentID (dbauthz .AsSystemRestricted (ctx ),agentID )//nolint:gocritic // this is a test.
754
+ apps ,err := db .GetWorkspaceAppsByAgentID (dbauthz .AsSystemRestricted (ctx ),agentID )
755
755
require .NoError (t ,err )
756
756
require .Len (t ,apps ,1 )
757
757
require .Equal (t ,"k5jd7a99-duplicate-slug" ,apps [0 ].Slug )
@@ -789,7 +789,7 @@ func TestSubAgentAPI(t *testing.T) {
789
789
require .NoError (t ,err )
790
790
791
791
// Then: It is deleted.
792
- _ ,err = db .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),childAgent .ID )//nolint:gocritic // this is a test.
792
+ _ ,err = db .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),childAgent .ID )
793
793
require .ErrorIs (t ,err ,sql .ErrNoRows )
794
794
})
795
795
@@ -830,10 +830,10 @@ func TestSubAgentAPI(t *testing.T) {
830
830
require .NoError (t ,err )
831
831
832
832
// Then: The correct one is deleted.
833
- _ ,err = api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),childAgentOne .ID )//nolint:gocritic // this is a test.
833
+ _ ,err = api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),childAgentOne .ID )
834
834
require .ErrorIs (t ,err ,sql .ErrNoRows )
835
835
836
- _ ,err = api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),childAgentTwo .ID )//nolint:gocritic // this is a test.
836
+ _ ,err = api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),childAgentTwo .ID )
837
837
require .NoError (t ,err )
838
838
})
839
839
@@ -871,7 +871,7 @@ func TestSubAgentAPI(t *testing.T) {
871
871
var notAuthorizedError dbauthz.NotAuthorizedError
872
872
require .ErrorAs (t ,err ,& notAuthorizedError )
873
873
874
- _ ,err = db .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),childAgentOne .ID )//nolint:gocritic // this is a test.
874
+ _ ,err = db .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),childAgentOne .ID )
875
875
require .NoError (t ,err )
876
876
})
877
877
@@ -912,7 +912,7 @@ func TestSubAgentAPI(t *testing.T) {
912
912
require .NoError (t ,err )
913
913
914
914
// Verify that the apps were created
915
- apps ,err := api .Database .GetWorkspaceAppsByAgentID (dbauthz .AsSystemRestricted (ctx ),subAgentID )//nolint:gocritic // this is a test.
915
+ apps ,err := api .Database .GetWorkspaceAppsByAgentID (dbauthz .AsSystemRestricted (ctx ),subAgentID )
916
916
require .NoError (t ,err )
917
917
require .Len (t ,apps ,2 )
918
918
@@ -923,7 +923,7 @@ func TestSubAgentAPI(t *testing.T) {
923
923
require .NoError (t ,err )
924
924
925
925
// Then: The agent is deleted
926
- _ ,err = api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),subAgentID )//nolint:gocritic // this is a test.
926
+ _ ,err = api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),subAgentID )
927
927
require .ErrorIs (t ,err ,sql .ErrNoRows )
928
928
929
929
// And: The apps are *retained* to avoid causing issues
@@ -1068,7 +1068,7 @@ func TestSubAgentAPI(t *testing.T) {
1068
1068
agentID ,err := uuid .FromBytes (createResp .Agent .Id )
1069
1069
require .NoError (t ,err )
1070
1070
1071
- subAgent ,err := api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),agentID )//nolint:gocritic // this is a test.
1071
+ subAgent ,err := api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),agentID )
1072
1072
require .NoError (t ,err )
1073
1073
1074
1074
require .Equal (t ,len (tt .expectedApps ),len (subAgent .DisplayApps ),"display apps count mismatch" )
@@ -1118,14 +1118,14 @@ func TestSubAgentAPI(t *testing.T) {
1118
1118
require .NoError (t ,err )
1119
1119
1120
1120
// Verify display apps
1121
- subAgent ,err := api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),agentID )//nolint:gocritic // this is a test.
1121
+ subAgent ,err := api .Database .GetWorkspaceAgentByID (dbauthz .AsSystemRestricted (ctx ),agentID )
1122
1122
require .NoError (t ,err )
1123
1123
require .Len (t ,subAgent .DisplayApps ,2 )
1124
1124
require .Equal (t ,database .DisplayAppVscode ,subAgent .DisplayApps [0 ])
1125
1125
require .Equal (t ,database .DisplayAppWebTerminal ,subAgent .DisplayApps [1 ])
1126
1126
1127
1127
// Verify regular apps
1128
- apps ,err := api .Database .GetWorkspaceAppsByAgentID (dbauthz .AsSystemRestricted (ctx ),agentID )//nolint:gocritic // this is a test.
1128
+ apps ,err := api .Database .GetWorkspaceAppsByAgentID (dbauthz .AsSystemRestricted (ctx ),agentID )
1129
1129
require .NoError (t ,err )
1130
1130
require .Len (t ,apps ,1 )
1131
1131
require .Equal (t ,"v4qhkq17-custom-app" ,apps [0 ].Slug )
@@ -1190,7 +1190,7 @@ func TestSubAgentAPI(t *testing.T) {
1190
1190
})
1191
1191
1192
1192
// When: We list the sub agents.
1193
- listResp ,err := api .ListSubAgents (ctx ,& proto.ListSubAgentsRequest {})//nolint:gocritic // this is a test.
1193
+ listResp ,err := api .ListSubAgents (ctx ,& proto.ListSubAgentsRequest {})
1194
1194
require .NoError (t ,err )
1195
1195
1196
1196
listedChildAgents := listResp .Agents