[pull] main from temporalio:main - #49
Merged
Merged
Conversation
## Related issues
None.
## What changed?
- Reject `operator namespace update --active-cluster` when it is
combined with another namespace mutation flag.
- Validate before dialing the server so invalid commands cannot issue an
RPC.
- Preserve the existing `--promote-global`/`--active-cluster` error and
remove the misleading "other flag will be omitted" message from
active-cluster updates.
- Document that namespace configuration and active-cluster changes must
be separate commands.
## 💥 Breaking change
Commands that combine `--active-cluster` with another namespace mutation
flag previously exited successfully after silently discarding the other
requested updates. They now fail before issuing an RPC in both text and
JSON output modes.
Apply namespace configuration first, then change the active cluster in a
separate command. Active-cluster-only updates are unchanged.
## Checklist
**Stability**
- [x] Breaking changes are marked with 💥 in the PR title and release
notes
- [x] Changes to JSON output (`-o json` / `-o jsonl`) are treated as
breaking changes
**Design**
- [x] This feature does not depend on Cloud-only APIs or behavior (it
works against an OSS server)
**Help text**
- [x] All flags shown in help text and examples are implemented and
functional
- [x] Long descriptions end with a period and include at least one
example invocation
- [x] Examples use long flags, one flag per line
- [x] Placeholder values use `YourXxx` form
**Behavior**
- [x] Results go to stdout; errors and warnings go to stderr
- [x] Error messages are lowercase with no trailing punctuation
**Tests**
- [x] Added functional test(s) (`SharedServerSuite`)
- [x] Added unit test(s) (`func TestXxx`) where applicable
## Manual tests
**Setup**
Used two OSS clusters at `127.0.0.1:7233` and `127.0.0.1:8233` with a
global namespace initially active in `cluster-a` and replicated only to
`cluster-a`.
**Happy path**
```console
$ temporal operator namespace update \
--address 127.0.0.1:7233 \
--namespace YourNamespace \
--active-cluster cluster-b
Namespace YourNamespace update succeeded.
```
**Error case**
```console
$ temporal operator namespace update \
--address 127.0.0.1:7233 \
--namespace YourNamespace \
--active-cluster cluster-a \
--cluster cluster-a \
--cluster cluster-b
Error: --active-cluster cannot be combined with --cluster; update namespace configuration before changing the active cluster
$ echo $?
1
```
The same command with `--output json` returns the same error and exit
status. Namespace state remains unchanged.
**Composition**
```console
$ temporal operator namespace update \
--address 127.0.0.1:7233 \
--namespace YourNamespace \
--cluster cluster-a \
--cluster cluster-b
Namespace YourNamespace update succeeded.
$ temporal operator namespace update \
--address 127.0.0.1:7233 \
--namespace YourNamespace \
--active-cluster cluster-b
Namespace YourNamespace update succeeded.
```
Both clusters subsequently reported `cluster-b` as active.
## Automated tests
- `go test -tags test_dep ./internal/temporalcli -run
"TestNamespaceUpdate_ActiveCluster|TestSharedServerSuite/TestNamespaceUpdate_ActiveClusterAlone"
-count=1`
- `go test -tags test_dep ./...` (namespace tests passed; unrelated
`TestDeployment_List` propagation assertion flaked once and passed on
isolated retry)
- `go vet -tags test_dep ./...` (reports existing warnings in task queue
and command context code)
- `make gen`
- `git diff --check`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )