Skip to content

Commit fe94932

Browse files
authored
Merge branch 'main' into dapr-bot
2 parents 14f2cb2 + 1de125f commit fe94932

40 files changed

+808
-47
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Report a bug with the Rust SDK
4+
title: ''
5+
labels: kind/bug
6+
assignees: ''
7+
8+
---
9+
## Expected Behavior
10+
11+
<!-- Briefly describe what you expect to happen -->
12+
13+
14+
## Actual Behavior
15+
16+
<!-- Briefly describe what is actually happening -->
17+
18+
19+
## Steps to Reproduce the Problem
20+
21+
<!-- How can this issue be reproduced (be detailed) -->
22+
23+
24+
## Release Note
25+
<!-- How should the fix for this issue be communicated in our release notes? It can be populated later. -->
26+
<!-- Keep it as a single line. Examples: -->
27+
<!-- RELEASE NOTE: **ADD** New feature in the Rust SDK. -->
28+
<!-- RELEASE NOTE: **FIX** Bug in Client. -->
29+
<!-- RELEASE NOTE: **UPDATE** Client dependencies. -->
30+
31+
RELEASE NOTE:

.github/ISSUE_TEMPLATE/discussion.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Discussion
3+
about: Start a discussion for the Dapr Rust SDK
4+
title: ''
5+
labels: kind/discussion
6+
assignees: ''
7+
8+
---
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature Request/Proposal
3+
about: Create a Feature Request/Proposal for the Rust SDK
4+
title: ''
5+
labels: kind/enhancement
6+
assignees: ''
7+
8+
---
9+
## Describe the feature/proposal
10+
11+
12+
13+
## Release Note
14+
<!-- How should this new feature be announced in our release notes? It can be populated later. -->
15+
<!-- Keep it as a single line. Examples: -->
16+
<!-- RELEASE NOTE: **ADD** New feature in the Rust SDK. -->
17+
<!-- RELEASE NOTE: **FIX** Bug in Client. -->
18+
<!-- RELEASE NOTE: **UPDATE** Client dependencies. -->
19+
20+
RELEASE NOTE:

.github/ISSUE_TEMPLATE/question.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Question
3+
about: Ask a question about the Rust SDK
4+
title: ''
5+
labels: kind/question
6+
assignees: ''
7+
8+
---
9+
## Question
10+
11+
12+
<!-- Ask your question here -->
13+
<!-- Include as much information as possible to find an answer quicker :) -->

.github/holopin.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
organization: dapr
2+
defaultSticker: clmjkxscc122740fl0mkmb7egi
3+
stickers:
4+
-
5+
id: clmjkxscc122740fl0mkmb7egi
6+
alias: ghc2023

.github/pull_request_template.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Description
2+
3+
<!--Please explain the changes you've made here-->
4+
5+
6+
7+
## Issue reference
8+
9+
<!--We strive to have all PR being opened based on an issue, where the problem or feature should be discussed prior to implementation.-->
10+
11+
<!--Please reference the issue(s) with a hashtag for example #100 -->
12+
This PR will close #number
13+
14+
## Checklist
15+
16+
<!-- This list is non-exhaustive, please ensure the tests are passing. -->
17+
<!--Please make sure you've completed the relevant tasks for this PR, out of the following list: -->
18+
19+
* [ ] Code compiles correctly
20+
* [ ] Created/updated tests
21+
* [ ] Extended the documentation

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name: dapr-rust-sdk
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
- release-*
88
tags:
99
- v*
1010
pull_request:
1111
branches:
12-
- master
12+
- main
1313
- release-*
1414

1515
env:
+212
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
name: validate-examples
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release-*
8+
tags:
9+
- v*
10+
pull_request:
11+
branches:
12+
- main
13+
- release-*
14+
workflow_dispatch:
15+
inputs:
16+
daprdapr_commit:
17+
description: "Dapr/Dapr commit to build custom daprd from"
18+
required: false
19+
default: ""
20+
daprcli_commit:
21+
description: "Dapr/CLI commit to build custom dapr CLI from"
22+
required: false
23+
default: ""
24+
repository_dispatch:
25+
types: [validate-examples]
26+
merge_group:
27+
jobs:
28+
setup:
29+
runs-on: ubuntu-latest
30+
env:
31+
GOOS: linux
32+
GOARCH: amd64
33+
GOPROXY: https://proxy.golang.org
34+
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install/install.sh
35+
DAPR_CLI_REF: ${{ github.event.inputs.daprcli_commit }}
36+
DAPR_REF: ${{ github.event.inputs.daprdapr_commit }}
37+
CHECKOUT_REPO: ${{ github.repository }}
38+
CHECKOUT_REF: ${{ github.ref }}
39+
outputs:
40+
DAPR_INSTALL_URL: ${{ env.DAPR_INSTALL_URL }}
41+
DAPR_CLI_VER: ${{ steps.outputs.outputs.DAPR_CLI_VER }}
42+
DAPR_RUNTIME_VER: ${{ steps.outputs.outputs.DAPR_RUNTIME_VER }}
43+
CHECKOUT_REPO: ${{ steps.outputs.outputs.CHECKOUT_REPO }}
44+
CHECKOUT_REF: ${{ steps.outputs.outputs.CHECKOUT_REF }}
45+
DAPR_REF: ${{ steps.outputs.outputs.DAPR_REF }}
46+
steps:
47+
- name: Parse repository_dispatch payload
48+
if: github.event_name == 'repository_dispatch'
49+
run: |
50+
if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then
51+
echo "CHECKOUT_REPO=${{ github.event.client_payload.pull_head_repo }}" >> $GITHUB_ENV
52+
echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV
53+
echo "DAPR_REF=master" >> $GITHUB_ENV
54+
fi
55+
56+
- name: Set up Go
57+
uses: actions/setup-go@v5
58+
with:
59+
go-version: "stable"
60+
61+
- name: Determine latest Dapr Runtime version
62+
run: |
63+
RUNTIME_VERSION=$(curl -s "https://api.github.com/repos/dapr/dapr/releases/latest" | grep '"tag_name"' | cut -d ':' -f2 | tr -d '",v')
64+
echo "DAPR_RUNTIME_VER=$RUNTIME_VERSION" >> $GITHUB_ENV
65+
echo "Found $RUNTIME_VERSION"
66+
67+
- name: Determine latest Dapr Cli version
68+
run: |
69+
CLI_VERSION=$(curl -s "https://api.github.com/repos/dapr/cli/releases/latest" | grep '"tag_name"' | cut -d ':' -f2 | tr -d '",v')
70+
echo "DAPR_CLI_VER=$CLI_VERSION" >> $GITHUB_ENV
71+
echo "Found $CLI_VERSION"
72+
73+
- name: Set up Dapr CLI
74+
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
75+
76+
- name: Checkout Dapr CLI repo to override dapr command.
77+
uses: actions/checkout@v4
78+
if: env.DAPR_CLI_REF != ''
79+
with:
80+
repository: dapr/cli
81+
ref: ${{ env.DAPR_CLI_REF }}
82+
path: cli
83+
84+
- name: Checkout Dapr repo to override daprd.
85+
uses: actions/checkout@v4
86+
if: env.DAPR_REF != ''
87+
with:
88+
repository: dapr/dapr
89+
ref: ${{ env.DAPR_REF }}
90+
path: dapr_runtime
91+
92+
- name: Build dapr cli with referenced commit.
93+
if: env.DAPR_CLI_REF != ''
94+
run: |
95+
cd cli
96+
make
97+
mkdir -p $HOME/artifacts/$GITHUB_SHA/
98+
sudo cp dist/linux_amd64/release/dapr $HOME/artifacts/$GITHUB_SHA/dapr
99+
100+
- name: Build daprd and placement with referenced commit.
101+
if: env.DAPR_REF != ''
102+
run: |
103+
cd dapr_runtime
104+
make
105+
mkdir -p $HOME/artifacts/$GITHUB_SHA/
106+
cp dist/linux_amd64/release/daprd $HOME/artifacts/$GITHUB_SHA/daprd
107+
cp dist/linux_amd64/release/placement $HOME/artifacts/$GITHUB_SHA/placement
108+
109+
- name: Upload dapr-artifacts
110+
uses: actions/upload-artifact@v4
111+
if: env.DAPR_REF != '' || env.DAPR_CLI_REF != ''
112+
with:
113+
name: dapr-artifacts
114+
path: $HOME/artifacts/$GITHUB_SHA/
115+
if-no-files-found: error
116+
retention-days: 1
117+
compression-level: 0
118+
119+
- name: Outputs
120+
id: outputs
121+
run: |
122+
echo "DAPR_INSTALL_URL=$DAPR_INSTALL_URL"
123+
echo "DAPR_CLI_VER=$DAPR_CLI_VER" >> "$GITHUB_OUTPUT"
124+
echo "DAPR_RUNTIME_VER=$DAPR_RUNTIME_VER" >> "$GITHUB_OUTPUT"
125+
echo "CHECKOUT_REPO=$CHECKOUT_REPO" >> "$GITHUB_OUTPUT"
126+
echo "CHECKOUT_REF=$CHECKOUT_REF" >> "$GITHUB_OUTPUT"
127+
echo "DAPR_REF=$DAPR_REF" >> "$GITHUB_OUTPUT"
128+
129+
validate-example:
130+
needs: setup
131+
runs-on: ubuntu-latest
132+
env:
133+
PYTHON_VER: 3.12
134+
DAPR_INSTALL_URL: ${{ needs.setup.outputs.DAPR_INSTALL_URL }}
135+
DAPR_CLI_VER: ${{ needs.setup.outputs.DAPR_CLI_VER }}
136+
DAPR_RUNTIME_VER: ${{ needs.setup.outputs.DAPR_RUNTIME_VER }}
137+
DAPR_CLI_REF: ${{ github.event.inputs.daprcli_commit }}
138+
DAPR_REF: ${{ github.event.inputs.daprdapr_commit }}
139+
CHECKOUT_REPO: ${{ needs.setup.outputs.CHECKOUT_REPO }}
140+
CHECKOUT_REF: ${{ needs.setup.outputs.CHECKOUT_REF }}
141+
RUST_BACKTRACE: full
142+
143+
strategy:
144+
fail-fast: false
145+
matrix:
146+
examples:
147+
["actors", "client", "configuration", "invoke/grpc", "invoke/grpc-proxying", "pubsub", "secrets-bulk"]
148+
steps:
149+
- name: Check out code
150+
uses: actions/checkout@v4
151+
with:
152+
repository: ${{ env.CHECKOUT_REPO }}
153+
ref: ${{ env.CHECKOUT_REF }}
154+
155+
- name: Make Artifacts destination folder
156+
if: env.DAPR_CLI_REF != '' || env.DAPR_REF != ''
157+
run: |
158+
mkdir -p $HOME/artifacts/$GITHUB_SHA/
159+
160+
- name: Retrieve dapr-artifacts
161+
if: env.DAPR_CLI_REF != '' || env.DAPR_REF != ''
162+
uses: actions/download-artifact@v4
163+
with:
164+
name: dapr-artifacts
165+
path: $HOME/artifacts/$GITHUB_SHA/
166+
167+
- name: Rust setup
168+
run: rustup toolchain install stable --profile minimal
169+
170+
- name: Install Protoc
171+
uses: arduino/setup-protoc@v3
172+
with:
173+
version: "25.2"
174+
175+
- name: Set up Dapr CLI
176+
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
177+
178+
- name: Override dapr cli with referenced commit.
179+
if: env.DAPR_CLI_REF != ''
180+
run: |
181+
sudo cp $HOME/artifacts/$GITHUB_SHA/dapr /usr/local/bin/dapr
182+
183+
- name: Initialize Dapr runtime ${{ env.DAPR_RUNTIME_VER }}
184+
run: |
185+
dapr uninstall --all
186+
dapr init --runtime-version ${{ env.DAPR_RUNTIME_VER }}
187+
188+
- name: Override daprd and placement service with referenced commit.
189+
if: env.DAPR_REF != ''
190+
run: |
191+
mkdir -p $HOME/.dapr/bin/
192+
cp $HOME/artifacts/$GITHUB_SHA/daprd $HOME/.dapr/bin/daprd
193+
docker stop dapr_placement
194+
$HOME/artifacts/$GITHUB_SHA/placement --healthz-port 9091 &
195+
196+
- name: Set up Python ${{ env.PYTHON_VER }}
197+
uses: actions/setup-python@v5
198+
with:
199+
python-version: ${{ env.PYTHON_VER }}
200+
201+
- name: Install Mechanical Markdown
202+
run: |
203+
python -m pip install --upgrade pip
204+
pip install mechanical-markdown
205+
206+
- name: Cargo Build Examples
207+
run: cargo build --examples
208+
209+
- name: Check Example
210+
run: |
211+
cd examples
212+
./validate.sh ${{ matrix.examples }}

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,10 @@ Cargo.lock
99
# These are backup files generated by rustfmt
1010
**/*.rs.bk
1111
.vscode/settings.json
12+
13+
# Ignore logs from dapr runs
14+
.dapr/
15+
16+
17+
# OSX cruft
18+
.DS_Store

CODEOWNERS

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These owners are the maintainers and approvers of this repo
2+
* @dapr/maintainers-rust-sdk @dapr/approvers-rust-sdk
3+
4+
# IMPORTANT - This should be the last entry in the list.
5+
CODEOWNERS @dapr/maintainers-rust-sdk

CONTRIBUTING.md

-11
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,6 @@ git commit --amend --no-edit --signoff
108108
git push --force-with-lease <remote-name> <branch-name>
109109
```
110110

111-
### Use of Third-party code
112-
113-
- All third-party code must be placed in the `vendor/` folder.
114-
- `vendor/` folder is managed by Go modules and stores the source code of third-party Go dependencies. - The `vendor/` folder should not be modified manually.
115-
- Third-party code must include licenses.
116-
117-
A non-exclusive list of code that must be places in `vendor/`:
118-
119-
- Open source, free software, or commercially-licensed code.
120-
- Tools or libraries or protocols that are open source, free software, or commercially licensed.
121-
122111
**Thank You!** - Your contributions to open source, large or small, make projects like this possible. Thank you for taking the time to contribute.
123112

124113
### Fork and set upstream

0 commit comments

Comments
 (0)