Skip to content

Commit 21960ed

Browse files
committed
Merge branch 'main' into 20241220_RSDK-9587-generate-series-of-waypoints-to-cover-surface-given-a-pcd-mesh
2 parents 46fa02b + fe84eee commit 21960ed

File tree

237 files changed

+9610
-4396
lines changed

Some content is hidden

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

237 files changed

+9610
-4396
lines changed

.github/CODEOWNERS

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
# Team SDK is responsible for CLI best practices and wishes to maintain insight into any
22
# changes currently being made to the CLI codebase.
3-
/cli/ @viamrobotics/sdk-netcode
3+
/cli/app.go @viamrobotics/sdk-netcode
4+
/cli/CONTRIBUTING.md @viamrobotics/sdk-netcode
5+
/cli/STYLEGUIDE.md @viamrobotics/sdk-netcode
6+

.github/workflows/docker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676

7777
test:
7878
needs: docker-cache
79-
uses: viamrobotics/rdk/.github/workflows/test.yml@main
79+
uses: ./.github/workflows/test.yml
8080
secrets:
8181
MONGODB_TEST_OUTPUT_URI: ${{ secrets.MONGODB_TEST_OUTPUT_URI }}
8282
DOCKER_PUBLIC_READONLY_PAT: ${{ secrets.DOCKER_PUBLIC_READONLY_PAT }}

.github/workflows/test-module-generation.yml

+22-23
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@ jobs:
1313
language: ["python", "go"]
1414
resource:
1515
[
16-
{ subtype: "arm", type: "component" },
17-
{ subtype: "audio_input", type: "component" },
18-
{ subtype: "base", type: "component" },
19-
{ subtype: "board", type: "component" },
20-
{ subtype: "camera", type: "component" },
21-
{ subtype: "encoder", type: "component" },
22-
{ subtype: "gantry", type: "component" },
23-
{ subtype: "generic", type: "component" },
24-
{ subtype: "gripper", type: "component" },
25-
{ subtype: "input", type: "component" },
26-
{ subtype: "motor", type: "component" },
27-
{ subtype: "movement_sensor", type: "component" },
28-
{ subtype: "pose_tracker", type: "component" },
29-
{ subtype: "power_sensor", type: "component" },
30-
{ subtype: "sensor", type: "component" },
31-
{ subtype: "servo", type: "component" },
16+
{ subtype: "arm" },
17+
{ subtype: "audio_input" },
18+
{ subtype: "base" },
19+
{ subtype: "board" },
20+
{ subtype: "camera" },
21+
{ subtype: "encoder" },
22+
{ subtype: "gantry" },
23+
{ subtype: "generic_component" },
24+
{ subtype: "gripper" },
25+
{ subtype: "input" },
26+
{ subtype: "motor" },
27+
{ subtype: "movement_sensor" },
28+
{ subtype: "pose_tracker" },
29+
{ subtype: "power_sensor" },
30+
{ subtype: "sensor" },
31+
{ subtype: "servo" },
3232

33-
{ subtype: "generic", type: "service" },
34-
{ subtype: "mlmodel", type: "service" },
35-
{ subtype: "motion", type: "service" },
36-
{ subtype: "navigation", type: "service" },
37-
{ subtype: "slam", type: "service" },
38-
{ subtype: "vision", type: "service" },
33+
{ subtype: "generic-service" },
34+
{ subtype: "mlmodel" },
35+
{ subtype: "motion" },
36+
{ subtype: "navigation" },
37+
{ subtype: "slam" },
38+
{ subtype: "vision" },
3939
]
4040
steps:
4141
- name: Checkout Code
@@ -53,7 +53,6 @@ jobs:
5353
--language "${{ matrix.language }}" \
5454
--public-namespace "my-org" \
5555
--resource-subtype "${{ matrix.resource.subtype }}" \
56-
--resource-type "${{ matrix.resource.type }}" \
5756
--model-name "model-name" \
5857
--dry-run
5958

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: Run go unit tests
7474
run: |
7575
chmod -R a+rwx . # temporary fix for arm runners
76-
sudo apt-get install -y python3-venv
76+
sudo apt-get update && sudo apt-get install -y python3-venv
7777
sudo --preserve-env=MONGODB_TEST_OUTPUT_URI,GITHUB_SHA,GITHUB_RUN_ID,GITHUB_RUN_NUMBER,GITHUB_RUN_ATTEMPT,GITHUB_X_PR_BASE_SHA,GITHUB_X_PR_BASE_REF,GITHUB_X_HEAD_REF,GITHUB_X_HEAD_SHA,GITHUB_REPOSITORY -Hu testbot bash -lc 'make test-go'
7878
7979
- name: Upload test.json
@@ -108,7 +108,7 @@ jobs:
108108
--platform linux/arm/v7 \
109109
-v `pwd`:/rdk \
110110
ghcr.io/viamrobotics/rdk-devenv:armhf-cache \
111-
sudo -Hu testbot bash -lc 'sudo apt-get install -y python3-venv && cd /rdk && go test -v ./...'
111+
sudo -Hu testbot bash -lc 'sudo apt-get update && sudo apt-get install -y python3-venv && cd /rdk && go test -v ./...'
112112
113113
motion_tests:
114114
name: Test Longer-running Motion Plans if affected

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,6 @@ web/cmd/server/*.core
9292

9393
# direnv (optional dev tool)
9494
.envrc
95+
96+
# codegpt
97+
.codegpt/*

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ full-static:
8383

8484
windows:
8585
mkdir -p bin/windows
86-
GOOS=windows go build -tags no_cgo -ldflags="-extldflags=-static $(COMMON_LDFLAGS)" -o bin/windows/viam-server-$(shell go env GOARCH) ./web/cmd/server
86+
GOOS=windows go build -tags no_cgo -ldflags="-extldflags=-static $(COMMON_LDFLAGS)" -o bin/windows/viam-server-$(shell go env GOARCH).exe ./web/cmd/server
87+
cd bin/windows && zip viam.zip viam-server-$(shell go env GOARCH).exe
8788

8889
server-static-compressed: server-static
8990
upx --best --lzma $(BIN_OUTPUT_PATH)/viam-server

app/app_client.go

+11
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,17 @@ func (c *AppClient) OrganizationGetLogo(ctx context.Context, orgID string) (stri
857857
return resp.Url, nil
858858
}
859859

860+
// ListOAuthApps gets the client's list of OAuth applications.
861+
func (c *AppClient) ListOAuthApps(ctx context.Context, orgID string) ([]string, error) {
862+
resp, err := c.client.ListOAuthApps(ctx, &pb.ListOAuthAppsRequest{
863+
OrgId: orgID,
864+
})
865+
if err != nil {
866+
return nil, err
867+
}
868+
return resp.ClientIds, nil
869+
}
870+
860871
// CreateLocation creates a location with the given name under the given organization.
861872
func (c *AppClient) CreateLocation(ctx context.Context, orgID, name string, opts *CreateLocationOptions) (*Location, error) {
862873
var parentID *string

app/app_client_test.go

+28
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,21 @@ func TestAppClient(t *testing.T) {
740740
test.That(t, resp, test.ShouldEqual, "https://logo.com")
741741
})
742742

743+
t.Run("ListOAuthApps", func(t *testing.T) {
744+
grpcClient.ListOAuthAppsFunc = func(
745+
ctx context.Context, in *pb.ListOAuthAppsRequest, opts ...grpc.CallOption,
746+
) (*pb.ListOAuthAppsResponse, error) {
747+
test.That(t, in.OrgId, test.ShouldEqual, organizationID)
748+
return &pb.ListOAuthAppsResponse{
749+
ClientIds: []string{"clientId"},
750+
}, nil
751+
}
752+
753+
resp, err := client.ListOAuthApps(context.Background(), organizationID)
754+
test.That(t, err, test.ShouldBeNil)
755+
test.That(t, resp, test.ShouldResemble, []string{"clientId"})
756+
})
757+
743758
t.Run("GetSupportEmail", func(t *testing.T) {
744759
grpcClient.OrganizationGetSupportEmailFunc = func(
745760
ctx context.Context, in *pb.OrganizationGetSupportEmailRequest, opts ...grpc.CallOption,
@@ -989,6 +1004,19 @@ func TestAppClient(t *testing.T) {
9891004
test.That(t, err, test.ShouldBeNil)
9901005
})
9911006

1007+
t.Run("EnableBillingSevice", func(t *testing.T) {
1008+
grpcClient.EnableBillingServiceFunc = func(
1009+
ctx context.Context, in *pb.EnableBillingServiceRequest, opts ...grpc.CallOption,
1010+
) (*pb.EnableBillingServiceResponse, error) {
1011+
test.That(t, in.OrgId, test.ShouldEqual, organizationID)
1012+
test.That(t, in.BillingAddress, test.ShouldResemble, &pbAddress)
1013+
return &pb.EnableBillingServiceResponse{}, nil
1014+
}
1015+
1016+
err := client.EnableBillingService(context.Background(), organizationID, &address)
1017+
test.That(t, err, test.ShouldBeNil)
1018+
})
1019+
9921020
t.Run("UpdateBillingService", func(t *testing.T) {
9931021
grpcClient.UpdateBillingServiceFunc = func(
9941022
ctx context.Context, in *pb.UpdateBillingServiceRequest, opts ...grpc.CallOption,

app/billing_client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func (c *BillingClient) SendPaymentRequiredEmail(ctx context.Context, customerOr
192192
}
193193

194194
func usageCostTypeFromProto(costType pb.UsageCostType) UsageCostType {
195-
//nolint:exhaustive
195+
//nolint:exhaustive,deprecated,staticcheck
196196
switch costType {
197197
case pb.UsageCostType_USAGE_COST_TYPE_UNSPECIFIED:
198198
return UsageCostTypeUnspecified

app/billing_client_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,22 @@ func usageCostTypeToProto(costType UsageCostType) pb.UsageCostType {
101101
case UsageCostTypeUnspecified:
102102
return pb.UsageCostType_USAGE_COST_TYPE_UNSPECIFIED
103103
case UsageCostTypeDataUpload:
104+
//nolint:deprecated,staticcheck
104105
return pb.UsageCostType_USAGE_COST_TYPE_DATA_UPLOAD
105106
case UsageCostTypeDataEgress:
107+
//nolint:deprecated,staticcheck
106108
return pb.UsageCostType_USAGE_COST_TYPE_DATA_EGRESS
107109
case UsageCostTypeRemoteControl:
108110
return pb.UsageCostType_USAGE_COST_TYPE_REMOTE_CONTROL
109111
case UsageCostTypeStandardCompute:
110112
return pb.UsageCostType_USAGE_COST_TYPE_STANDARD_COMPUTE
111113
case UsageCostTypeCloudStorage:
114+
//nolint:deprecated,staticcheck
112115
return pb.UsageCostType_USAGE_COST_TYPE_CLOUD_STORAGE
113116
case UsageCostTypeBinaryDataCloudStorage:
114117
return pb.UsageCostType_USAGE_COST_TYPE_BINARY_DATA_CLOUD_STORAGE
115118
case UsageCostTypeOtherCloudStorage:
119+
//nolint:deprecated,staticcheck
116120
return pb.UsageCostType_USAGE_COST_TYPE_OTHER_CLOUD_STORAGE
117121
case UsageCostTypePerMachine:
118122
return pb.UsageCostType_USAGE_COST_TYPE_PER_MACHINE

app/data_client.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,11 @@ func (d *DataClient) TabularDataBySQL(ctx context.Context, organizationID, sqlQu
438438

439439
// TabularDataByMQL queries tabular data with MQL (MongoDB Query Language) queries.
440440
func (d *DataClient) TabularDataByMQL(
441-
ctx context.Context, organizationID string, mqlQueries []map[string]interface{},
441+
ctx context.Context, organizationID string, query []map[string]interface{},
442442
) ([]map[string]interface{}, error) {
443443
mqlBinary := [][]byte{}
444-
for _, query := range mqlQueries {
445-
binary, err := bson.Marshal(query)
444+
for _, q := range query {
445+
binary, err := bson.Marshal(q)
446446
if err != nil {
447447
return nil, fmt.Errorf("failed to marshal BSON query: %w", err)
448448
}

cli/CONTRIBUTING.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing
2+
3+
Contributions to the Viam CLI are always welcome and appreciated! Every bit helps, and
4+
credit will always be given.
5+
6+
## Types of Contributions
7+
8+
### Report Bugs
9+
10+
If you are reporting a bug, please include:
11+
12+
- Your operating system name and version.
13+
- Which version of the viam CLI you are using (viewable with command `viam version`)
14+
- Any details about your local setup that might be helpful in troubleshooting.
15+
- The observed behavior.
16+
- Detailed steps to reproduce the bug.
17+
18+
### Fix Bugs
19+
20+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
21+
wanted" is open to whoever wants to implement it.
22+
23+
### Implement Features
24+
25+
Look through the GitHub issues for features. Anything tagged with "enhancement"
26+
and "help wanted" is open to whoever wants to implement it. When contributing, please
27+
consult the [style guide](STYLEGUIDE.md) to ensure consistency within the codebase.
28+
29+
### Write Documentation
30+
31+
You can never have enough documentation! Please feel free to contribute to any
32+
part of the documentation, such as the official docs, docstrings, or even
33+
on the web in blog posts, articles, and such.
34+
35+
### Submit Feedback
36+
37+
If you are proposing a feature:
38+
39+
- Explain in detail how it would work.
40+
- Keep the scope as narrow as possible, to make it easier to implement.
41+
42+
## Get Started!
43+
44+
Ready to contribute? You can follow the instructions in [README.md](README.md) to install and develop
45+
the viam CLI tool.
46+
47+
## Pull Request Guidelines
48+
49+
Before you submit a pull request, check that it meets these guidelines:
50+
51+
1. The pull request should include additional tests if appropriate.
52+
2. If the pull request adds functionality, the docs should be updated.
53+
3. The pull request should work for all currently supported operating systems and versions of Python.
54+
55+

0 commit comments

Comments
 (0)