Skip to content

Commit 83fe968

Browse files
authored
Merge branch 'v1.16' into perf-benchmarks-v1.16
2 parents 205e11e + 8623168 commit 83fe968

File tree

14 files changed

+439
-213
lines changed

14 files changed

+439
-213
lines changed

.github/workflows/website-root.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- v1.15
7+
- v1.16
88
pull_request:
99
types: [opened, synchronize, reopened, closed]
1010
branches:
11-
- v1.15
11+
- v1.16
1212

1313
concurrency:
1414
# Cancel the previously triggered build for only PR build.
@@ -50,23 +50,17 @@ jobs:
5050
if [ $GITHUB_EVENT_NAME == 'pull_request' ]; then
5151
STAGING_URL="https://${SWA_BASE}-${{github.event.number}}.westus2.azurestaticapps.net/"
5252
fi
53-
hugo ${STAGING_URL+-b "$STAGING_URL"}
53+
hugo ${STAGING_URL+-b "$STAGING_URL"} --minify
5454
- name: Deploy docs site
5555
uses: Azure/static-web-apps-deploy@v1
5656
with:
5757
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_BAY_0E9E0E81E }}
5858
repo_token: ${{ secrets.GITHUB_TOKEN }}
5959
action: "upload"
60-
app_location: "/daprdocs/public/"
60+
app_location: "/daprdocs/public"
6161
output_location: "/"
6262
skip_app_build: true
6363
skip_deploy_on_missing_secrets: true
64-
- name: Upload Hugo artifacts
65-
uses: actions/upload-artifact@v4
66-
with:
67-
name: hugo_build
68-
path: ./daprdocs/public/
69-
if-no-files-found: error
7064

7165
close_staging_site:
7266
if: github.event_name == 'pull_request' && github.event.action == 'closed'
@@ -96,7 +90,7 @@ jobs:
9690
with:
9791
submodules: false
9892
- name: Download Hugo artifacts
99-
uses: actions/download-artifact@v3
93+
uses: actions/download-artifact@v4
10094
with:
10195
name: hugo_build
10296
path: site/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The following branches are currently maintained:
1616

1717
| Branch | Website | Description |
1818
| ------------------------------------------------------------ | -------------------------- | ------------------------------------------------------------------------------------------------ |
19-
| [v1.15](https://github.com/dapr/docs) (primary) | https://docs.dapr.io | Latest Dapr release documentation. Typo fixes, clarifications, and most documentation goes here. |
20-
| [v1.16](https://github.com/dapr/docs/tree/v1.16) (pre-release) | https://v1-16.docs.dapr.io/ | Pre-release documentation. Doc updates that are only applicable to v1.15+ go here. |
19+
| [v1.16](https://github.com/dapr/docs) (primary) | https://docs.dapr.io | Latest Dapr release documentation. Typo fixes, clarifications, and most documentation goes here. |
20+
| [v1.17](https://github.com/dapr/docs/tree/v1.16) (pre-release) | https://v1-17.docs.dapr.io/ | Pre-release documentation. Doc updates that are only applicable to v1.16+ go here. |
2121

2222
For more information visit the [Dapr branch structure](https://docs.dapr.io/contributing/docs-contrib/contributing-docs/#branch-guidance) document.
2323

daprdocs/content/en/contributing/docs-contrib/maintainer-guide.md

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,22 @@ These steps will prepare the latest release branch for archival.
103103
git checkout -b release_v1.0
104104
```
105105

106-
1. In VS Code, navigate to `/daprdocs/config.toml`.
107-
1. Add the following TOML to the `# Versioning` section (around line 154):
108-
109-
```toml
110-
version_menu = "v1.0"
111-
version = "v1.0"
112-
archived_version = true
113-
url_latest_version = "https://docs.dapr.io"
114-
115-
[[params.versions]]
116-
version = "v1.2 (preview)"
117-
url = "v1-2.docs.dapr.io"
118-
[[params.versions]]
119-
version = "v1.1 (latest)"
120-
url = "#"
121-
[[params.versions]]
122-
version = "v1.0"
123-
url = "https://v1-0.docs.dapr.io"
106+
1. In VS Code, navigate to `hugo.yaml` located in the root.
107+
1. Add the following configuration to the `# Versioning` section (around line 121 and onwards):
108+
109+
```yaml
110+
version_menu: "v1.0"
111+
version: "v1.0"
112+
archived_version: true
113+
url_latest_version: "https://docs.dapr.io"
114+
115+
versions:
116+
- version: v1.2 (preview)
117+
url: https://v1-2.docs.dapr.io
118+
- version: v1.1 (latest)
119+
url: "#"
120+
- version: v1.0
121+
url: https://v1-0.docs.dapr.io
124122
```
125123
126124
1. Delete `.github/workflows/website-root.yml`.
@@ -146,26 +144,25 @@ These steps will prepare the upcoming release branch for promotion to latest rel
146144
git checkout -b release_v1.1
147145
```
148146

149-
1. In VS Code, navigate to `/daprdocs/config.toml`.
150-
1. Update line 1 to `baseURL - https://docs.dapr.io/`.
151-
1. Update the `# Versioning` section (around line 154) to display the correct versions and tags:
147+
1. In VS Code, navigate to `hugo.yaml` located in the root.
148+
1. Update line 1 to `baseURL: https://docs.dapr.io/`.
149+
1. Update the `# Versioning` section (around line 121 and onwards) to display the correct versions and tags:
152150

153-
```toml
151+
```yaml
154152
# Versioning
155-
version_menu = "v1.1 (latest)"
156-
version = "v1.1"
157-
archived_version = false
158-
url_latest_version = "https://docs.dapr.io"
159-
160-
[[params.versions]]
161-
version = "v1.2 (preview)"
162-
url = "v1-2.docs.dapr.io"
163-
[[params.versions]]
164-
version = "v1.1 (latest)"
165-
url = "#"
166-
[[params.versions]]
167-
version = "v1.0"
168-
url = "https://v1-0.docs.dapr.io"
153+
version_menu: "v1.1 (latest)"
154+
version: "v1.1"
155+
archived_version: false
156+
url_latest_version: https://docs.dapr.io
157+
github_branch: v1.1
158+
159+
versions:
160+
- version: v1.2 (preview)
161+
url: https://v1-2.docs.dapr.io
162+
- version: v1.1 (latest)
163+
url: "#"
164+
- version: v1.0
165+
url: https://v1-0.docs.dapr.io
169166
```
170167

171168
1. Navigate to `.github/workflows/website-root.yml`.
@@ -194,6 +191,7 @@ These steps will prepare the upcoming release branch for promotion to latest rel
194191
| [v1.2](https://github.com/dapr/docs/tree/v1.2) (pre-release) | https://v1-2.docs.dapr.io/ | Pre-release documentation. Doc updates that are only applicable to v1.2+ go here. |
195192
```
196193

194+
1. Update the _Supported versions_ table in `support-release-policy.md`; add a new line at the top of the table with the new version of the runtime and SDKs. Change the releases which are older than n-2 to be `Unsupported`.
197195
1. Update the `dapr-latest-version.html` shortcode partial to the new minor/patch version (in this example, `1.1.0` and `1.1`).
198196
1. Commit the staged changes and push to your branch (`release_v1.1`).
199197
1. Open a PR from `release/v1.1` to `v1.1`.

daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ In addition to enabling critical performance and security functionality (like [p
2020
- **OpenAI-compatible interface** for seamless integration with existing AI workflows and tools
2121

2222
You can also pair the conversation API with Dapr functionalities, like:
23-
- Resiliency circuit breakers and retries to circumvent limit and token errors, or
24-
- Middleware to authenticate requests coming to and from the LLM
2523

26-
Dapr provides observability by issuing metrics for your LLM interactions.
24+
- Resiliency policies including circuit breakers to handle repeated errors, timeouts to safeguards from slow responses, and retries for temporary network failures
25+
- Observability with metrics and distributed tracing using OpenTelemetry and Zipkin
26+
- Middleware to authenticate requests to and from the LLM
2727

2828
## Features
2929

@@ -67,7 +67,7 @@ Watch the demo presented during [Diagrid's Dapr v1.15 celebration](https://www.d
6767

6868
{{< youtube id=NTnwoDhHIcQ start=5444 >}}
6969

70-
## Try out conversation
70+
## Try out conversation API
7171

7272
### Quickstarts and tutorials
7373

daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md

Lines changed: 101 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,12 @@ public class DemoWorkflowActivity implements WorkflowActivity {
197197

198198
<!--go-->
199199

200+
### Define workflow activities
201+
200202
Define each workflow activity you'd like your workflow to perform. The Activity input can be unmarshalled from the context with `ctx.GetInput`. Activities should be defined as taking a `ctx workflow.ActivityContext` parameter and returning an interface and error.
201203

202204
```go
203-
func TestActivity(ctx workflow.ActivityContext) (any, error) {
205+
func BusinessActivity(ctx workflow.ActivityContext) (any, error) {
204206
var input int
205207
if err := ctx.GetInput(&input); err != nil {
206208
return "", err
@@ -211,6 +213,87 @@ func TestActivity(ctx workflow.ActivityContext) (any, error) {
211213
}
212214
```
213215

216+
### Define the workflow
217+
218+
Define your workflow function with the parameter `ctx *workflow.WorkflowContext` and return any and error. Invoke your defined activities from within your workflow.
219+
220+
```go
221+
func BusinessWorkflow(ctx *workflow.WorkflowContext) (any, error) {
222+
var input int
223+
if err := ctx.GetInput(&input); err != nil {
224+
return nil, err
225+
}
226+
var output string
227+
if err := ctx.CallActivity(BusinessActivity, workflow.ActivityInput(input)).Await(&output); err != nil {
228+
return nil, err
229+
}
230+
if err := ctx.WaitForExternalEvent("businessEvent", time.Second*60).Await(&output); err != nil {
231+
return nil, err
232+
}
233+
234+
if err := ctx.CreateTimer(time.Second).Await(nil); err != nil {
235+
return nil, nil
236+
}
237+
return output, nil
238+
}
239+
```
240+
241+
### Register workflows and activities
242+
243+
Before your application can execute workflows, you must register both the workflow orchestrator and its activities with a workflow registry. This ensures Dapr knows which functions to call when executing your workflow.
244+
245+
```go
246+
func main() {
247+
// Create a workflow registry
248+
r := workflow.NewRegistry()
249+
250+
// Register the workflow orchestrator
251+
if err := r.AddWorkflow(BusinessWorkflow); err != nil {
252+
log.Fatal(err)
253+
}
254+
fmt.Println("BusinessWorkflow registered")
255+
256+
// Register the workflow activities
257+
if err := r.AddActivity(BusinessActivity); err != nil {
258+
log.Fatal(err)
259+
}
260+
fmt.Println("BusinessActivity registered")
261+
262+
// Create workflow client and start worker
263+
wclient, err := client.NewWorkflowClient()
264+
if err != nil {
265+
log.Fatal(err)
266+
}
267+
fmt.Println("Worker initialized")
268+
269+
ctx, cancel := context.WithCancel(context.Background())
270+
if err = wclient.StartWorker(ctx, r); err != nil {
271+
log.Fatal(err)
272+
}
273+
fmt.Println("runner started")
274+
275+
// Your application logic continues here...
276+
// Example: Start a workflow
277+
instanceID, err := wclient.ScheduleWorkflow(ctx, "BusinessWorkflow", workflow.WithInput(1))
278+
if err != nil {
279+
log.Fatalf("failed to start workflow: %v", err)
280+
}
281+
fmt.Printf("workflow started with id: %v\n", instanceID)
282+
283+
// Stop workflow worker when done
284+
cancel()
285+
fmt.Println("workflow worker successfully shutdown")
286+
}
287+
```
288+
289+
**Key points about registration:**
290+
- Use `workflow.NewRegistry()` to create a workflow registry
291+
- Use `r.AddWorkflow()` to register workflow functions
292+
- Use `r.AddActivity()` to register activity functions
293+
- Use `client.NewWorkflowClient()` to create a workflow client
294+
- Call `wclient.StartWorker()` to begin processing workflows
295+
- Use `wclient.ScheduleWorkflow` to schedule a named instance of a workflow
296+
214297
[See the Go SDK workflow activity example in context.](https://github.com/dapr/go-sdk/tree/main/examples/workflow/README.md)
215298

216299
{{% /tab %}}
@@ -383,16 +466,16 @@ public class DemoWorkflowWorker {
383466
Define your workflow function with the parameter `ctx *workflow.WorkflowContext` and return any and error. Invoke your defined activities from within your workflow.
384467

385468
```go
386-
func TestWorkflow(ctx *workflow.WorkflowContext) (any, error) {
469+
func BusinessWorkflow(ctx *workflow.WorkflowContext) (any, error) {
387470
var input int
388471
if err := ctx.GetInput(&input); err != nil {
389472
return nil, err
390473
}
391474
var output string
392-
if err := ctx.CallActivity(TestActivity, workflow.ActivityInput(input)).Await(&output); err != nil {
475+
if err := ctx.CallActivity(BusinessActivity, workflow.ActivityInput(input)).Await(&output); err != nil {
393476
return nil, err
394477
}
395-
if err := ctx.WaitForExternalEvent("testEvent", time.Second*60).Await(&output); err != nil {
478+
if err := ctx.WaitForExternalEvent("businessEvent", time.Second*60).Await(&output); err != nil {
396479
return nil, err
397480
}
398481

@@ -864,7 +947,7 @@ public class DemoWorkflow extends Workflow {
864947
[As in the following example](https://github.com/dapr/go-sdk/tree/main/examples/workflow/README.md), a hello-world application using the Go SDK and Dapr Workflow would include:
865948
866949
- A Go package called `client` to receive the Go SDK client capabilities.
867-
- The `TestWorkflow` method
950+
- The `BusinessWorkflow` method
868951
- Creating the workflow with input and output.
869952
- API calls. In the example below, these calls start and call the workflow activities.
870953
@@ -889,15 +972,15 @@ var failActivityTries = 0
889972
func main() {
890973
r := workflow.NewRegistry()
891974

892-
if err := r.AddWorkflow(TestWorkflow); err != nil {
975+
if err := r.AddWorkflow(BusinessWorkflow); err != nil {
893976
log.Fatal(err)
894977
}
895-
fmt.Println("TestWorkflow registered")
978+
fmt.Println("BusinessWorkflow registered")
896979

897-
if err := r.AddActivity(TestActivity); err != nil {
980+
if err := r.AddActivity(BusinessActivity); err != nil {
898981
log.Fatal(err)
899982
}
900-
fmt.Println("TestActivity registered")
983+
fmt.Println("BusinessActivity registered")
901984

902985
if err := r.AddActivity(FailActivity); err != nil {
903986
log.Fatal(err)
@@ -921,7 +1004,7 @@ func main() {
9211004
// "start". This is useful for increasing the throughput of creating
9221005
// workflows.
9231006
// workflow.WithStartTime(time.Now())
924-
instanceID, err := wclient.ScheduleWorkflow(ctx, "TestWorkflow", workflow.WithInstanceID("a7a4168d-3a1c-41da-8a4f-e7f6d9c718d9"), workflow.WithInput(1))
1007+
instanceID, err := wclient.ScheduleWorkflow(ctx, "BusinessWorkflow", workflow.WithInstanceID("a7a4168d-3a1c-41da-8a4f-e7f6d9c718d9"), workflow.WithInput(1))
9251008
if err != nil {
9261009
log.Fatalf("failed to start workflow: %v", err)
9271010
}
@@ -963,9 +1046,8 @@ func main() {
9631046

9641047
fmt.Printf("stage: %d\n", stage)
9651048

966-
// Raise Event Test
967-
968-
err = wclient.RaiseEvent(ctx, instanceID, "testEvent", workflow.WithEventPayload("testData"))
1049+
// Raise Event
1050+
err = wclient.RaiseEvent(ctx, instanceID, "businessEvent", workflow.WithEventPayload("testData"))
9691051
if err != nil {
9701052
fmt.Printf("failed to raise event: %v", err)
9711053
}
@@ -1008,7 +1090,7 @@ func main() {
10081090
fmt.Printf("stage: %d\n", stage)
10091091

10101092
// Terminate workflow test
1011-
id, err := wclient.ScheduleWorkflow(ctx, "TestWorkflow", workflow.WithInstanceID("a7a4168d-3a1c-41da-8a4f-e7f6d9c718d9"), workflow.WithInput(1))
1093+
id, err := wclient.ScheduleWorkflow(ctx, "BusinessWorkflow", workflow.WithInstanceID("a7a4168d-3a1c-41da-8a4f-e7f6d9c718d9"), workflow.WithInput(1))
10121094
if err != nil {
10131095
log.Fatalf("failed to start workflow: %v", err)
10141096
}
@@ -1037,22 +1119,22 @@ func main() {
10371119
fmt.Println("workflow worker successfully shutdown")
10381120
}
10391121

1040-
func TestWorkflow(ctx *workflow.WorkflowContext) (any, error) {
1122+
func BusinessWorkflow(ctx *workflow.WorkflowContext) (any, error) {
10411123
var input int
10421124
if err := ctx.GetInput(&input); err != nil {
10431125
return nil, err
10441126
}
10451127
var output string
1046-
if err := ctx.CallActivity(TestActivity, workflow.WithActivityInput(input)).Await(&output); err != nil {
1128+
if err := ctx.CallActivity(BusinessActivity, task.WithActivityInput(input)).Await(&output); err != nil {
10471129
return nil, err
10481130
}
10491131

1050-
err := ctx.WaitForExternalEvent("testEvent", time.Second*60).Await(&output)
1132+
err := ctx.WaitForSingleEvent("businessEvent", time.Second*60).Await(&output)
10511133
if err != nil {
10521134
return nil, err
10531135
}
10541136

1055-
if err := ctx.CallActivity(TestActivity, workflow.WithActivityInput(input)).Await(&output); err != nil {
1137+
if err := ctx.CallActivity(BusinessActivity, task.WithActivityInput(input)).Await(&output); err != nil {
10561138
return nil, err
10571139
}
10581140

@@ -1068,7 +1150,7 @@ func TestWorkflow(ctx *workflow.WorkflowContext) (any, error) {
10681150
return output, nil
10691151
}
10701152

1071-
func TestActivity(ctx workflow.ActivityContext) (any, error) {
1153+
func BusinessActivity(ctx task.ActivityContext) (any, error) {
10721154
var input int
10731155
if err := ctx.GetInput(&input); err != nil {
10741156
return "", err

0 commit comments

Comments
 (0)