Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@gow
Copy link
Contributor

@gow gow commented Jun 12, 2025

What was changed

Added reset subcommands so that we can do reset + update version info atomically in one operation. The server changes were made in temporalio/temporal#7719. This is the CLI counterpart.

To allow subcommands we added a new flag subcommands-optional. When this flag is present a parent command can be run in isolation without any subcommands (i.e subcommands will be optional)

Why?

So that we can reset + update_version at the same time.

Checklist

  1. Closes: N/A

  2. How was this tested:
    Added tests + manually tested

  3. Any docs updates needed?
    N/A

@gow gow requested a review from a team as a code owner June 12, 2025 03:29
@CLAassistant
Copy link

CLAassistant commented Jun 12, 2025

CLA assistant check
All committers have signed the CLA.

@gow gow marked this pull request as draft June 12, 2025 03:29
@gow gow changed the title Reset subcommand to update version [WIP] Reset subcommand to update version Jun 12, 2025
@gow gow changed the title [WIP] Reset subcommand to update version Reset subcommand to update version Jun 17, 2025
@gow gow requested review from Sushisource, carlydf and cretz June 17, 2025 00:30
@gow gow marked this pull request as ready for review June 17, 2025 00:40
@gow gow changed the base branch from main to next-server June 18, 2025 00:52
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a separate PR to backport main into next-server? It is a bit hard to follow this PR on what changes are yours and what changes are in main.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. Looks like next-server is a lot of commits behind main?
I don't fully understand the purpose of next-server branch. I just set it as the base to get the failing tests pass. I've changed the base back to main so that the PR shows just my commits.

Copy link
Member

@cretz cretz Jun 24, 2025

Choose a reason for hiding this comment

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

I don't fully understand the purpose of next-server branch

It's for server features without a stable server tag

@gow gow changed the base branch from next-server to main June 20, 2025 18:46
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

This all looks good to me, though I'm not sure what's the problem with the test.

Regardless, I'll need to update this slightly after my refactor & next-server are merged. So potentially we can just let this sit until after that since everything needs to be together in the next release anyway.

go.mod Outdated
Comment on lines 21 to 24
go.temporal.io/api v1.49.2-0.20250605210325-e57aa581185c
go.temporal.io/sdk v1.34.0
go.temporal.io/sdk/contrib/envconfig v0.1.0
go.temporal.io/server v1.27.1
go.temporal.io/server v1.29.0-135.2
Copy link
Member

Choose a reason for hiding this comment

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

Will have to wait for stable API and OSS server tags since this now targets main

Comment on lines +54 to +55
# Commands with subcommands can't be run on their own unless
# subcommands-optional is set to true.
Copy link
Member

@cretz cretz Jun 23, 2025

Choose a reason for hiding this comment

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

When designing commands, we had intentionally decided that a command either houses children or is a standalone command. We intentionally avoided hybrids in all of our designs so that it's clear when you execute a parent command you don't have a side effect. It's also clearer from a docs/usability standpoint to know that commands cannot serve two purposes.

I'm not completely against the change in our long-held stance, but it is a change and worth confirming the CLI is ok deviating from its existing stance.

Copy link
Member

Choose a reason for hiding this comment

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

We agreed on this decision quite some ways back when this went through design review: https://www.notion.so/temporalio/Multi-commands-with-reset-PRD-1d38fc5677388025a756ca7241453e32

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I wasn't aware the matter was settled, ok

Don't prompt to confirm.
Only allowed when `--query` is present.
- name: temporal workflow reset with-workflow-update-options
Copy link
Member

Choose a reason for hiding this comment

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

I think if this is a separate command, it's reset-and-update-workflow-options but is it really a separate command or is it just a "post reset operation" on top of reset?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not a separate command. It's a "subcommand" of workflow reset in cli. In server rpc it's just a post reset operation param to reset request.

Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

LGTM, but will have to wait until there is a stable tag for API and server before merging in to main

@gow
Copy link
Contributor Author

gow commented Jun 24, 2025

LGTM, but will have to wait until there is a stable tag for API and server before merging in to main

Got it. Will wait for new server release, then rebase on main and check everything before merging.

@gow gow requested a review from a team as a code owner July 1, 2025 03:31
@gow
Copy link
Contributor Author

gow commented Jul 3, 2025

@cretz @Sushisource Please take a final look? I'll merge it on Monday evening.

Comment on lines 4517 to 4519
- name: versioning-override-pinned-version
type: string
description: Override Pinned Version for a Worker Deployment (Only for pinned).
Copy link
Member

Choose a reason for hiding this comment

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

This will need to change to match my PR #811 after it goes in, so you can do that now if you want or I can do it before we cut the release, either way is fine.

@Sushisource
Copy link
Member

Looking good to me. Thanks!

@cretz cretz mentioned this pull request Jul 8, 2025
@Sushisource
Copy link
Member

Now that my PR was merged, I think we'll want to update this to use the explicit deployment name / build ID args rather than the string before merging.

@gow
Copy link
Contributor Author

gow commented Jul 8, 2025

Now that my PR was merged, I think we'll want to update this to use the explicit deployment name / build ID args rather than the string before merging.

I don't see your changes. Did you merge it into main? This PR is against main.

@Sushisource
Copy link
Member

Now that my PR was merged, I think we'll want to update this to use the explicit deployment name / build ID args rather than the string before merging.

I don't see your changes. Did you merge it into main? This PR is against main.

Yes. All my changes to versioning-related commands are in main. For example:

temporal worker deployment set-current-version \

gow added 3 commits July 9, 2025 11:56
- Add validation tests for argument checking

- Add functional tests for all versioning behaviors

- Add integration tests for flag inheritance and different reset types
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for updating.

@gow gow merged commit b9a57ef into main Jul 9, 2025
9 checks passed
@gow gow deleted the cg/reset branch July 9, 2025 22:32
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.

5 participants