Skip to content

Commit

Permalink
Merge branch 'main' into 13175-concat
Browse files Browse the repository at this point in the history
  • Loading branch information
jiachengxu authored Jun 20, 2024
2 parents bcbfef5 + 6201d75 commit fc96e48
Show file tree
Hide file tree
Showing 21 changed files with 407 additions and 206 deletions.
24 changes: 12 additions & 12 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
# https://golangci-lint.run/usage/quick-start/
run:
timeout: 12m
skip-dirs:
- dist
- docs
- examples
- hack
- manifests
- pkg/client
- sdks
- ui
- vendor
skip-files:
- server/static/files.go
build-tags:
- api
- cli
Expand Down Expand Up @@ -66,3 +54,15 @@ issues:
exclude-rules:
- path: server/artifacts/artifact_server_test.go
text: "response body must be closed"
exclude-dirs:
- dist
- docs
- examples
- hack
- manifests
- pkg/client
- sdks
- ui
- vendor
exclude-files:
- server/static/files.go
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## v3.5.8 (2024-06-17)

* [d13891154](https://github.com/argoproj/argo-workflows/commit/d1389115484f52d22d1cdcae29139518cbf2fc03) fix(deps): bump `github.com/Azure/azure-sdk-for-go/sdk/azidentity` from 1.5.1 to 1.6.0 to fix CVE (#13197)
* [10488d655](https://github.com/argoproj/argo-workflows/commit/10488d655a78c28bb6e3e6bca490a5496addd605) fix: don't necessarily include all artifacts from templates in node outputs (#13066)
* [c2204ae03](https://github.com/argoproj/argo-workflows/commit/c2204ae03de97acf1c589c898180bdb9942f1524) fix(server): don't use cluster scope list + watch in namespaced mode. Fixes #13177 (#13189)
* [9481bb04c](https://github.com/argoproj/argo-workflows/commit/9481bb04c3e48a85da5ba05ef47c2f0a2ba500f4) fix(server): mutex calls to sqlitex (#13166)
* [ee150afdf](https://github.com/argoproj/argo-workflows/commit/ee150afdf3561f8250c5212e1b6a38628a847b39) fix: only evaluate retry expression for fail/error node. Fixes #13058 (#13165)
* [028f9ec41](https://github.com/argoproj/argo-workflows/commit/028f9ec41cf07056bfcf823a109964b00621797c) fix: Merge templateDefaults into dag task tmpl. Fixes #12821 (#12833)
* [e8f0cae39](https://github.com/argoproj/argo-workflows/commit/e8f0cae398e8f135a6957cd74919368e0b692b6b) fix: Apply podSpecPatch in `woc.execWf.Spec` and template to pod sequentially (#12476)
* [c1a5f3073](https://github.com/argoproj/argo-workflows/commit/c1a5f3073c58033dcfba5d14fe3dff9092ab258d) fix: don't fail workflow if PDB creation fails (#13102)
* [5c56a161c](https://github.com/argoproj/argo-workflows/commit/5c56a161cb66b1c83fc31e5238bb812bc35f9754) fix: Allow termination of workflow to update on exit handler nodes. fixes #13052 (#13120)
* [e5dfe5d73](https://github.com/argoproj/argo-workflows/commit/e5dfe5d7393c04efc0e4067a02a37aae79231a64) fix: load missing fields for archived workflows (#13136)
* [7dc7fc246](https://github.com/argoproj/argo-workflows/commit/7dc7fc246393295a53308df1b77c585d5b24fe07) fix(ui): `package.json#license` should be Apache (#13040)
* [3622a896d](https://github.com/argoproj/argo-workflows/commit/3622a896d08599e0d325e739c9f389c399419f7d) fix(docs): Fix `gcloud` typo (#13101)
* [207e0713a](https://github.com/argoproj/argo-workflows/commit/207e0713a6eae52fc7bd1e9dcb43206d55f1a754) docs(server): full copy-edit of auth mode page (#13137)

### Contributors

* Alan Clucas
* Anton Gilgur
* Janghun Lee(James)
* Jiacheng Xu
* Julie Vogelman
* Miltiadis Alexis
* Tianchu Zhao
* Yulin Li
* jswxstw

## v3.5.7 (2024-05-27)

* [b2b1ecd7d](https://github.com/argoproj/argo-workflows/commit/b2b1ecd7de378cec31ab0ebb1e8b9665c4b05867) chore(deps): bump tj-actions/changed-files from 40 to 41 (#12433)
Expand Down
5 changes: 3 additions & 2 deletions cmd/argoexec/commands/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,17 @@ func waitContainer(ctx context.Context) error {
}

// Saving output artifacts
err = wfExecutor.SaveArtifacts(bgCtx)
artifacts, err := wfExecutor.SaveArtifacts(bgCtx)
if err != nil {
wfExecutor.AddError(err)
}

// Save log artifacts
logArtifacts := wfExecutor.SaveLogs(bgCtx)
artifacts = append(artifacts, logArtifacts...)

// Try to upsert TaskResult. If it fails, we will try to update the Pod's Annotations
err = wfExecutor.ReportOutputs(bgCtx, logArtifacts)
err = wfExecutor.ReportOutputs(bgCtx, artifacts)
if err != nil {
wfExecutor.AddError(err)
}
Expand Down
51 changes: 20 additions & 31 deletions docs/enhanced-depends-logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,26 @@

> v2.9 and after
## Introduction

Previous to version 2.8, the only way to specify dependencies in DAG templates was to use the `dependencies` field and
specify a list of other tasks the current task depends on. This syntax was limiting because it does not allow the user to
specify which _result_ of the task to depend on. For example, a task may only be relevant to run if the dependent task
succeeded (or failed, etc.).
Enhanced `depends` improves on [the `dependencies` field](walk-through/dag.md) by specifying which _result_ of a task to depend on.
For example, to only run a task if its dependent task succeeded.

## Depends

To remedy this, there exists a new field called `depends`, which allows users to specify dependent tasks, their statuses,
as well as any complex boolean logic. The field is a `string` field and the syntax is expression-like with operands having
form `<task-name>.<task-result>`. Examples include `task-1.Succeeded`, `task-2.Failed`, `task-3.Daemoned`. The full list of
available task results is as follows:

| Task Result | Description | Meaning |
|:------------:|----------------|---------|
| `.Succeeded` | Task Succeeded | Task finished with no error |
| `.Failed` | Task Failed | Task exited with a non-0 exit code |
| `.Errored` | Task Errored | Task had an error other than a non-0 exit code |
| `.Skipped` | Task Skipped | Task was skipped |
| `.Omitted` | Task Omitted | Task was omitted |
| `.Daemoned` | Task is Daemoned and is not Pending | |
You can use the `depends` field to specify dependent tasks, their results, and boolean logic between them.

A tasks is considered `Skipped` if its `when` condition evaluates to false. On the other hand, if a task doesn't run
because its `depends` evaluated to false it is `Omitted`.
You use operands of the form `<task-name>.<task-result>`, such as `task-1.Succeeded`, `task-2.Failed`, `task-3.Daemoned`.
Available task results are:

For convenience, an omitted task result is equivalent to `(task.Succeeded || task.Skipped || task.Daemoned)`.
| Task Result | Description |
|:------------:|-------------|
| `.Succeeded` | Task finished with no error |
| `.Failed` | Task exited with a non-0 exit code |
| `.Errored` | Task had an error other than a non-0 exit code |
| `.Skipped` | Task's [`when`](walk-through/conditionals.md) condition evaluated to `false` |
| `.Omitted` | Task's `depends` condition evaluated to `false` |
| `.Daemoned` | Task is [daemoned](walk-through/daemon-containers.md) and is not `Pending` |

For example:
For compatibility with `dependencies`, an unspecified result is equivalent to `(task.Succeeded || task.Skipped || task.Daemoned)`. For example:

```yaml
depends: "task || task-2.Failed"
Expand All @@ -42,30 +33,29 @@ is equivalent to:
depends: (task.Succeeded || task.Skipped || task.Daemoned) || task-2.Failed
```
Full boolean logic is also available. Operators include:
You can use boolean logic with the operators:
* `&&`
* `||`
* `!`

Example:
Example:

```yaml
depends: "(task-2.Succeeded || task-2.Skipped) && !task-3.Failed"
```

In the case that you're depending on a task that uses `withItems`, you can depend on
whether any of the item tasks are successful or all have failed using `.AnySucceeded` and `.AllFailed`, for example:
If you depend on a task that uses `withItems`, you can use `.AnySucceeded` and `.AllFailed`. For example:

```yaml
depends: "task-1.AnySucceeded || task-2.AllFailed"
```

## Compatibility with `dependencies` and `dag.task.continueOn`

This feature is fully compatible with `dependencies` and conversion is easy.
You cannot use both `dependencies` and `depends` in the same task group.

To convert simply join your `dependencies` with `&&`:
To convert from `dependencies` to `depends`, join your array into a string with `&&`. For example:

```yaml
dependencies: ["A", "B", "C"]
Expand All @@ -77,5 +67,4 @@ is equivalent to:
depends: "A && B && C"
```

Because of the added control found in `depends`, the `dag.task.continueOn` is not available when using it. Furthermore,
it is not possible to use both `dependencies` and `depends` in the same task group.
`dag.task.continueOn` is not available when using `depends`; instead you can specify `.Failed`.
28 changes: 14 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21

require (
cloud.google.com/go/storage v1.36.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.6.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.2
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible
github.com/Masterminds/sprig/v3 v3.2.3
Expand Down Expand Up @@ -50,15 +50,15 @@ require (
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
github.com/tidwall/gjson v1.17.0
github.com/upper/db/v4 v4.7.0
github.com/valyala/fasttemplate v1.2.2
github.com/xeipuuv/gojsonschema v1.2.0
golang.org/x/crypto v0.22.0
golang.org/x/crypto v0.24.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/oauth2 v0.16.0
golang.org/x/sync v0.6.0
golang.org/x/sync v0.7.0
golang.org/x/time v0.5.0
google.golang.org/api v0.163.0
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe
Expand Down Expand Up @@ -90,7 +90,7 @@ require (
github.com/fatih/color v1.15.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gobwas/glob v0.2.4-0.20181002190808-e7a84e9525fe // indirect
github.com/golang-jwt/jwt/v5 v5.2.0 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.3 // indirect
Expand Down Expand Up @@ -121,8 +121,8 @@ require (
go.opentelemetry.io/otel/metric v1.22.0 // indirect
go.opentelemetry.io/otel/trace v1.22.0 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/tools v0.17.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect
modernc.org/libc v1.41.0 // indirect
Expand All @@ -138,7 +138,7 @@ require (
cloud.google.com/go/iam v1.1.5 // indirect
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.28 // indirect
Expand All @@ -148,7 +148,7 @@ require (
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
Expand Down Expand Up @@ -264,7 +264,7 @@ require (
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
Expand All @@ -279,10 +279,10 @@ require (
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
go.opencensus.io v0.24.0 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0
golang.org/x/text v0.14.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0
golang.org/x/text v0.16.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
Loading

0 comments on commit fc96e48

Please sign in to comment.