Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy decision requirements and decisions via the Go client and zbctl #8979

Merged
merged 5 commits into from
Mar 25, 2022

Conversation

npepinpe
Copy link
Member

@npepinpe npepinpe commented Mar 24, 2022

Description

This change enables the Go client and zbctl to deploy decisions and decision requirements. This is a breaking change, as it will replace client's DeployProcessCommand method with DeployCommand method, and the DeployProcessResponse returned from the DeployCommand to DeployResourceResponse. On the zbctl side, however, everything remains the same.

The upgrade path is that instead of accessing the process directly via pb.DeployProcessResponse.GetProcesses(), you will now do:

deployment, err := client.DeployCommand().Send()
deployedResource := deployment.GetDeployments()[0]
process := deployedResource.GetProcess()

Related issues

closes #8076

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • New content is added to the release announcement
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Updates the generated stubs for the protocol in Go, as well as the mock
implementations of the gRPC code.
@npepinpe
Copy link
Member Author

NOTE: it looks like a lot of changes, but most of these are just generated code. You can mostly skip these, assuming we trust our tooling 😄

@npepinpe npepinpe requested a review from korthout March 24, 2022 15:49
Removes usage of old `DeployProcessRequest`/`DeployProcessResponse`
types, and instead use the new `DeployResourceRequest` and
`DeployResourceResponse`.

BREAKING CHANGE: this is a breaking change in the Go world, as
there was interface abstracting these types.
Copy link
Member

@korthout korthout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ The changes look good, but I think there are some parts missing in zbctl.

clients/go/cmd/zbctl/testdata/deploy.golden Outdated Show resolved Hide resolved
clients/go/cmd/zbctl/testdata/help.golden Show resolved Hide resolved
clients/go/cmd/zbctl/internal/commands/deployProcess.go Outdated Show resolved Hide resolved
@npepinpe
Copy link
Member Author

Ah, yes, I renamed a file which caused it to add/remove, and I forgot to git add the missing file 🙈

Copy link
Member

@korthout korthout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @npepinpe and thanks for taking over this one 🙇

LGTM :godmode:

@@ -243,6 +243,7 @@ func (s *integrationTestSuite) TestCommonCommands() {
goldenOut = fmtGolden
}

fmt.Println(string(cmdOut))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Is this a development leftover? If so, 🔧 please remove it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, my bad, that's what I get for doing too many things at once

@korthout
Copy link
Member

@npepinpe Please update the PR description to highlight the decision and decision requirements usage.

@npepinpe npepinpe changed the title Use new DeployResource* request and responses in Go Deploy decision requirements and decisions via the Go client and zbctl Mar 25, 2022
@npepinpe npepinpe added the BREAKING CHANGE A change which is not backwards compatible. label Mar 25, 2022
@npepinpe
Copy link
Member Author

bors merge

@zeebe-bors-camunda
Copy link
Contributor

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 48e59a8 into main Mar 25, 2022
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the 8076-go-deploy-resources branch March 25, 2022 10:45
zeebe-bors-camunda bot added a commit that referenced this pull request Mar 25, 2022
8945: Introduce new immutable protocol r=npepinpe a=npepinpe

## Description

Introduces a new immutable protocol directly under `protocol`, which annotates the types directly. This has several advantages:

- We can now easily recursively copy the types (except for `Record`, which is a special case due to its generic typing)
- It's less error prone thanks to an ArchUnit test guaranteeing we don't forget to annotate the types
- It's less overhead for developers when adding new types
- It allows us to easily collect metadata about the types via reflection using annotations

This is the first step for #8837 - the next step will remove the immutable variants in `protocol-jackson` and replace them with this.

## Related issues

related to #8837 



8995: Introduce new commands to deploy resources in the Go client r=npepinpe a=npepinpe

## Description

This PR reverts the previous breaking changes and instead introduces new commands to deploy decisions and decision requirements. The client must now use `client.NewDeployResourceCommand()`, and the old `client.NewDeployProcessCommand()` has been restored. Similarly, `zbctl` now supports its old `zbctl deploy <path> <path>` behavior, but also supports `zbctl deploy resource mySuper.dmn` as well, which behaves the same as the old deploy command but can deploy DMN files.

## Related issues

<!-- Which issues are closed by this PR or are related -->

related to #8979 



Co-authored-by: Nicolas Pepin-Perreault <nicolas.pepin-perreault@camunda.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE A change which is not backwards compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In the Go client, I can deploy DMN resources
3 participants