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

CLI rewrite branch to main #539

Merged
merged 55 commits into from
Apr 29, 2024
Merged

CLI rewrite branch to main #539

merged 55 commits into from
Apr 29, 2024

Conversation

cretz
Copy link
Member

@cretz cretz commented Apr 24, 2024

What was changed

There is a long history of changes to the cli-rewrite branch. Look at the past several months. The very first commit is to remove everything. Unlike other PRs, this PR merge will not be squashed so we can keep proper commit history. The branch protections will be fixed too.

Once merged, we will create a 0.12.0 release (non-RC)

cretz and others added 30 commits November 28, 2023 10:25
# What was changed

I implemented `temporal workflow terminate`, which should behave the
same as in the existing CLI except for the same caveats/improvements as
in #432.
# What was changed

I implemented `temporal workflow cancel`, which should behave the same
as in the existing CLI except for the same caveats/improvements as in
#432
Implement `temporal activity fail` and `temporal activity complete`
## What was changed

I've implemented the `workflow reset` command and tests for all its
major functionality.

Batch reset functionality will come in a second PR after this one
## What was changed

CI will now run tests without `-v`.

## Why?

When you run in verbose mode you need to dig through _all_ test outputs
and logging to find even a single test failure. In
https://github.com/temporalio/cli/actions/runs/7877883209/job/21494958729?pr=443
we have 1000 lines of output and only 20 lines were relevant to the
actual failing test.
<!--- Note to EXTERNAL Contributors -->
<!-- Thanks for opening a PR! 
If it is a significant code change, please **make sure there is an open
issue** for this.
We work best with you when we have accepted the idea first before you
code. -->

<!--- For ALL Contributors 👇 -->

## What was changed
<!-- Describe what has changed in this PR -->
Add support for `workflow update` command. The functionality should be
unchanged but the output may be different.
Add operator cluster commands
Add `operator cluster list`, `operator cluster upsert` and `operator
cluster remove`.

To write the tests I had to expose a bunch of cluster configs in the
Test server and make sure the test could actually read them to use and
verify the information.
## What was changed
Add operator search-attribute commands

## Why?
Add commands to operate search attributes

## Checklist
<!--- add/delete as needed --->

1. Closes <!-- add issue number here -->

2. How was this tested:
<!--- Please describe how you tested your changes/how we can test them
-->

3. Any docs updates needed?
<!--- update README if applicable
      or point out where to update docs.temporal.io -->
## What was changed
<!-- Describe what has changed in this PR -->

Add support for `batch` commands.

Notable differences to current `main`:

- captures "not found" errors from Server and presents a better message
- prints `batch describe` as card instead of table
- prints empty JSON array for empty result set from `batch list`

---------

Co-authored-by: Chad Retz <[email protected]>
## What was changed
Adding support for batch reset commands.
Please note, batch_reset command was removed. Instead, `-query` option
was added to the reset command for performing batch operations.

## Why?
Supported by older tools.

## Checklist
How was this tested:
implemented automated feature test.
Sushisource and others added 24 commits February 28, 2024 12:41
<!--- Note to EXTERNAL Contributors -->
<!-- Thanks for opening a PR! 
If it is a significant code change, please **make sure there is an open
issue** for this.
We work best with you when we have accepted the idea first before you
code. -->

<!--- For ALL Contributors 👇 -->

## What was changed

Wrapped tests for `batch terminate` with `Eventually`.

## Why?

Ensure the tests for `batch terminate` are not flaky.

## Checklist
## What was changed
Adding operator namespace commands to cli. These are the commands that
are added
* operator namespace create
* operator namespace delete
* operator namespace describe
* operator namespace list
* operator nemspace update

## Breaking changes
* Removed --verbose option from `namespace update` command. This option
is used to print update request payload.
* Previous cli was printing historyArchivalUri and visibilityArchivalUri
fields only if the option `--fields` is set to `long` when executing
`namespace describe` command. Here we are always printing those fields
since we dont have `--fields` option.

## Why?

## Checklist

2. How was this tested:
Unit tests.

3. Any docs updates needed?
## What was changed
Adding task-queue list-partition command

## Breaking changes
* This command had --output option which can take values table, card and
json. We will not have card and table options. Option text will print a
table view.
* --output json was printing some text line in current cli. Here we will
print response object without that.

## Why?
cli rewrite

## Checklist

---------

Co-authored-by: Chad Retz <[email protected]>
<!--- Note to EXTERNAL Contributors -->
<!-- Thanks for opening a PR! 
If it is a significant code change, please **make sure there is an open
issue** for this.
We work best with you when we have accepted the idea first before you
code. -->

<!--- For ALL Contributors 👇 -->

## What was changed
Add support for workflow delete command. The functionality is mostly
unchanged from current CLI, but the output may be different.

## Why?
For the CLI refresh

## Checklist
<!--- add/delete as needed --->

1. How was this tested:
Tested in commands.workflow_test.go and via CLI with local dev
environment.

---------

Co-authored-by: Chad Retz <[email protected]>
Add ARM targets for CI
## What was changed
* New command: `temporal workflow fix-history-json`

## Why?
This command reads an event history JSON object using the
`client.HistoryFromJSON` API, then serializes it back out using the
`protojson` API. `HistoryFromJSON` is backward compatible with both the
standard protobuf JSON format and with GoGoProto's format, which differ
in their handling of enum values.

## Checklist
1. Closes internal JIRA tickets SDK-1570 and OSS-1658, which do not seem
to have equivalent issues in the public GitHub.

2. How was this tested:
I downloaded a sample event history JSON from my dev server, then ran it
through a few conversions.

3. Any docs updates needed?
If there's a manual step in publishing changes to `commands.md`, then it
will need to be run.
## What was changed
Implement schedule commands for new CLI.

## Why?
Feature parity.

## Checklist

1. Closes:

2. How was this tested:

new tests

3. Any docs updates needed?

- The format of `temporal schedule describe -o json` changed to the
`--raw` format of the previous cli.
Closes #343. See the issue for the full discussion and rationale behind
the specific changes made.

---------

Co-authored-by: Chad Retz <[email protected]>
This forward-ports #408 to the cli-rewrite branch.
Add update-id option
This test occasionally fails because the batch job completes before the
test has a chance to check its status. Allow for this case in the test.
We want a non-zero exit when the user invokes `temporal` with an unknown
command/subcommand, or when invoked with no arguments. But if the user
explicitly asks for help or version information, we should print it and
return success.

Closes #495.
## What was changed

Updated server and ui-server to latest stable for CLI rewrite
@cretz cretz requested a review from a team April 24, 2024 19:07
@CLAassistant
Copy link

CLAassistant commented Apr 24, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
10 out of 13 committers have signed the CLA.

✅ tdeebswihart
✅ dandavison
✅ antlai-temporal
✅ Quinn-With-Two-Ns
✅ stephanos
✅ fairlydurable
✅ josh-berry
✅ prathyushpv
✅ chronos-tachyon
✅ carlydf
❌ ast2023
❌ pdoerner
❌ Sebastian Neira


Sebastian Neira seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@cretz cretz merged commit 1a24106 into main Apr 29, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.