Skip to content

Commit df71875

Browse files
committed
Squashed merge commit of 'main'
commit 9f30a1d Author: Lina Jodoin <[email protected]> Date: Wed Aug 27 16:08:12 2025 -0700 [Scheduled Actions] Use the Execution returned from PollMutableState when calling GetWorkflowExecutionHistory (#8207) ## What changed? - In WatchWorkflow, we'll now use the Execution returned as a result from `PollMutableState`, instead of the Execution we used as part of the `PollMutableState` request. ## Why? - We have a likely race condition if a workflow starts and completes during the `PollMutableState` call, where our originally-requested Execution is no longer the latest. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) commit 8b717ec Author: Roman Dmytrenko <[email protected]> Date: Wed Aug 27 19:34:05 2025 +0000 chore(deps): upgrade go from 1.24.5 to 1.25.0 (#8209) ## What changed? Upgrade go to the 1.25.0 ## How did you test it? - [x] built - [x] run locally and tested manually ~Blocked by #8174~ --------- Signed-off-by: Roman Dmytrenko <[email protected]> Co-authored-by: Stephan Behnke <[email protected]> Co-authored-by: Stephan Behnke <[email protected]> commit 3f18d90 Author: Stephan Behnke <[email protected]> Date: Tue Aug 26 18:28:26 2025 -0700 GetWorkflowExecutionHistory long poll soft timeout (#8238) ## What changed? Added a "soft timeout" (language used by Workflow Update) to `GetWorkflowExecutionHistory` long polls. ## Why? We don't want to terminate the long poll connection but instead keep it alive by sending a response back just before the timeout. The idea is that this will prevent connections from opening/terminating repeatedly (ie connection churn). ## How did you test it? - [ ] built - [x] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks I was only able to verify this manually by forcing a timeout in the server and verifying that instead of a deadline exceeded I saw a result. I'll assume this will work since the existing code already tried doing just exactly that, but it didn't do it well. commit 64884b1 Author: Sean Kane <[email protected]> Date: Tue Aug 26 14:26:02 2025 -0600 fix: handle nil ptr in legacy batch processing (#8244) ## What changed? `BatchWorkflow` is not yet deprecated, fix was not properly applied on previous PR ## Why? nilptr exception ## How did you test it? - [ ] built - [ ] run locally and tested manually - [X] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks na commit 96c3aae Author: Kent Gruber <[email protected]> Date: Tue Aug 26 13:23:40 2025 -0400 Use better string splitting techniques where possible (#8226) ## What changed? This PR aims to avoid usage of [`strings.Split`](https://pkg.go.dev/strings#Split) where possible in favor of better string splitting techniques, speficially: [`strings.SplitN`](https://pkg.go.dev/strings#SplitN) and [`strings.SplitSeq`](https://pkg.go.dev/strings#SplitSeq) where appropriate. There was also a [`strings.Fields`](https://pkg.go.dev/strings#Fields) change I made to use [`strings.FieldsSeq`](https://pkg.go.dev/strings#FieldsSeq) instead, and another for S3 to use the [`path`](https://pkg.go.dev/path) package instead of [`strings.Split`](https://pkg.go.dev/strings#Split). ## Why? [`strings.SplitN`](https://pkg.go.dev/strings#SplitN) and [`strings.SplitSeq`](https://pkg.go.dev/strings#SplitSeq) are often better options in many cases, and can be _partially_ detected using [`modernize`](https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize): > `stringsseq`: replace Split in "for range strings.Split(...)" by go1.24's more efficient `SplitSeq`, or `Fields` with `FieldSeq`. ## How did you test it? - [X] built - [X] run locally and tested manually - [x] covered by existing tests - [x] added new unit test(s) - [ ] added new functional test(s) ## Potential risks There are lots of potentially subtle behaviors from the `strings.Split` (and `strings.Fields`) usage that should be accounted for. If our existing tests don't cover those subtleties, there's risk for introducing an unintended bug. More intricate handling/parsing previously using the `strings` package should get extra attention from reviewers. I've attempted to break up my changes into logical commit chunks to aid in review / help spot potentially concerning changes. commit ebcc3fd Author: Sean Kane <[email protected]> Date: Tue Aug 26 09:15:23 2025 -0600 fix: handle nil ptr in batch processing (#8240) ## What changed? Batch workflows were panicking because executions can be nil, but there is no check to prevent nil pointer exception. ## Why? Prevent nil-ptrs ## How did you test it? - [ ] built - [ ] run locally and tested manually - [X] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks NA commit dfa8b3e Author: Yu Xia <[email protected]> Date: Mon Aug 25 23:40:08 2025 -0700 Adding minimum timeout require in system workflow (#8231) ## What changed? Adding minimum timeout require in system workflow ## Why? The system workflow needs to have sufficient time to execute the defer logic. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) commit 8f1ad7c Author: Yu Xia <[email protected]> Date: Mon Aug 25 15:52:12 2025 -0700 Wire up api health monitor component (#8217) ## What changed? Wire up api health monitor component ## Why? The health monitor component did not wire correctly in fx ## How did you test it? - [x] built - [x] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) commit 45da266 Author: pdoerner <[email protected]> Date: Mon Aug 25 11:40:10 2025 -0700 Remove dynamic config warnings for shared structures (#8236) ## What changed? Removed warning logs for shared dynamic config structures ## Why? Was failing integration tests commit 2d74130 Author: Hai Zhao <[email protected]> Date: Mon Aug 25 09:12:03 2025 -0700 Add replication state to response of DescribeNamespace/ListNamespaces/UpdateNamespace (#8234) ## What changed? Add replication state to response of DescribeNamespace/ListNamespaces/UpdateNamespace. ## Why? We want to check replication state quickly from cli. ## How did you test it? - [x] built - [x] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks commit 54893bc Author: David Reiss <[email protected]> Date: Fri Aug 22 17:04:29 2025 -0700 Only force-load child partitions after successful initialization (#8230) ## What changed? The force-load child partitions mechanism should only happen after successful initialization of the root. ## Why? If the root fails to load, things can get stuck in a loop where the root loads the children and the children cause the root to be loaded again (from userdata polling). ## How did you test it? - [x] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) commit 251e20a Author: sivagirish81 <[email protected]> Date: Thu Aug 21 19:08:02 2025 -0700 TaskQueue Fairness Rate Limit (#8135) ## What changed? - Move the rate limit logic for fairness from priMatcher to taskQueuePartitionManagerLevel - Attach the fairness queue rate limit and the per-key rate limit to the simple rate limiter implementation. ## Why? - Implementation of UpdateTaskQueueConfig api for fairness tasks. ## How did you test it? - [x] built - [x] run locally and tested manually - [x] covered by existing tests - [x] added new unit test(s) - [x] added new functional test(s) ## Potential risks N/A commit 16f7688 Author: Will Duan <[email protected]> Date: Fri Aug 22 07:16:52 2025 +0800 Add log for slow replication tasks (#8225) ## What changed? Log replication task details when processing takes too long ## Why? For operator investigation ## How did you test it? - [x] built - [x] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks no risk. commit 934c58d Author: Will Duan <[email protected]> Date: Fri Aug 22 06:51:57 2025 +0800 Fix VerifyVersionedTransition Task (#8227) ## What changed? Fix VerifyVersionedTransition Task ## Why? Without fix, there is risk of success the task without verifying. ## How did you test it? - [x] built - [x] run locally and tested manually - [x] covered by existing tests - [x] added new unit test(s) - [ ] added new functional test(s) ## Potential risks no risk. commit f454f2f Author: Yichao Yang <[email protected]> Date: Thu Aug 21 14:32:35 2025 -0700 Revert history task processing timeout change (#8228) ## What changed? - Revert history task timeout from 10s to 3s for non-outbound tasks. ## Why? - The original change was made due to a misunderstanding of my comment [here](#7951 (comment)). I was meant to suggest only use 10s as the timeout for outbound chasm tasks. But for other tasks, like transfer/timer, it should still use 3s as the timeout. ## How did you test it? - [x] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) commit 14d52ce Author: Roman Dmytrenko <[email protected]> Date: Thu Aug 21 15:16:29 2025 +0000 ci: bump golangci-lint from v1.64.8 to v2.4.0 (#8174) ## What changed? Upgrade golangci-lint to v2 ## How did you test it? - [x] run locally and tested manually --------- Signed-off-by: Roman Dmytrenko <[email protected]> commit fb863dc Author: Stephan Behnke <[email protected]> Date: Wed Aug 20 18:19:02 2025 -0700 Explain test build tags and env variables (#7991) ## What changed? Added documentation for test-related build tags and env variables. ## Why? So help developers with their test setup. commit 17c4c07 Author: pdoerner <[email protected]> Date: Wed Aug 20 16:05:45 2025 -0700 Add dynamic config for forwarded Nexus request dispatch type (#8224) ## What changed? Added a new dynamic config to control whether forwarded Nexus HTTP requests should use the same dispatch type as the original request or always use dispatch by namespace + task queue. ## Why? Endpoints do not support replication, so forwarding by endpoint will not work out of the box because the two clusters will have a different ID for the endpoint. commit 1d340f5 Author: pdoerner <[email protected]> Date: Wed Aug 20 15:33:30 2025 -0700 Pass through original HTTP headers for forwarded Nexus requests (#8204) ## What changed? When forwarding Nexus Start/Cancel requests, the original HTTP headers will be passed through without sanitization. ## Why? Some headers that are still needed for the forwarded request may be sanitized during original request processing (e.g. authorization information headers). ## How did you test it? existing tests commit 3b1b8d0 Author: Roey Berman <[email protected]> Date: Wed Aug 20 11:07:49 2025 -0600 Upgrade Go SDK to 1.35.0 (#8216) Had to change WorkerDeploymentOptions and VersioningOverride to work with new SDK. Changed the worker setup for the versioning internal workflow replay tests, so I generated a new set of workflow histories to test with. Normally we generate new workflow histories only when we've made a change to the workflow definitions that we want to test (ie. a new patch), but since the operations to generate the workflow histories had to change slightly, I think it makes sense to generate a fresh set of histories to replay-test with next time there is a change. --------- Co-authored-by: Carly de Frondeville <[email protected]> commit 4d1212a Author: Stephan Behnke <[email protected]> Date: Tue Aug 19 11:52:55 2025 -0700 Fix typo in unprocessedUpdateFailure (#8212) WISOTT commit f38c88a Author: David Reiss <[email protected]> Date: Tue Aug 19 06:51:19 2025 -0700 Allow more retries for matching client polls (#8155) ## What changed? Allow frontend->matching poll requests to retry up to their context timeout instead of just once. ## Why? On matching service deployments, a busy new matching node may hit its persistence rps limit trying to acquire new task queues and be unable to accept polls. ## How did you test it? - [x] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) commit fdb7f31 Author: Yu Xia <[email protected]> Date: Mon Aug 18 16:24:42 2025 -0700 Change sys background low to use the correct level (#8208) ## What changed? Change sys background low to use the correct level ## Why? Fix this based on the variable name ## How did you test it? - [x] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) commit e4b378f Author: David Reiss <[email protected]> Date: Mon Aug 18 15:34:34 2025 -0700 Support subscriptions to settings with constrained defaults (#8180) ## What changed? Fill in support for subscriptions to dynamic config values with constrained defaults. ## Why? We'd like to use this combination of functionality. ## How did you test it? - [x] added new unit test(s) commit 8ed0361 Author: David Reiss <[email protected]> Date: Mon Aug 18 15:29:17 2025 -0700 Allow empty data in DataBlob (#8181) ## What changed? Remove check for zero-length data in NewDataBlob. ## Why? Zero-length data is a valid encoding for some encodings, e.g. proto3. NewDataBlob should not have an opinion on the length of data. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks Some code may be making assumptions about this behavior. commit 40ac028 Author: David Reiss <[email protected]> Date: Mon Aug 18 12:41:41 2025 -0700 Warn on dynamic config default values with shared structure (#8176) ## What changed? Log softassert warnings if dynamic config settings are registered with default values with shared structure. ## Why? This is very likely unintended and may lead to unexpected behavior of settings (values will be parsed on top of a copy of the default). ## How did you test it? - [x] run locally and tested manually - [x] added new unit test(s) commit 9c75cd6 Author: pdoerner <[email protected]> Date: Fri Aug 15 12:43:47 2025 -0700 Forward Nexus requests using same dispatch type as original request (#8199) ## What changed? When forwarding Nexus requests that were originally sent to the `DispatchByEndpoint` URL, the forwarding URL will also be constructed to send the request to the `DispatchByEndpoint` URL on the remote cluster. Previously, we were always sending forwarding requests using `DispatchByNamespaceAndTaskQueue` ## Why? bug fix ## How did you test it? existing tests commit 21f556c Author: Roey Berman <[email protected]> Date: Fri Aug 15 13:13:28 2025 -0600 Commit generated scheduler protos (#8200) ## What - Commit generated scheduler protos. - Improve `make ensure-no-changes` to detect untracked files. ## Why? The protos were not generated since the tool was committed in a separate PR from where the protos were added. commit 4c59cd1 Author: Roey Berman <[email protected]> Date: Fri Aug 15 12:09:58 2025 -0600 Add support for protos in chasm libs (#8182) ## What changed? Added support for defining protos in chasm libs. ## Why? Keep everything local to the library. ## How did you test it? - [x] built - [x] run locally and tested manually commit 08e2dfd Author: pdoerner <[email protected]> Date: Thu Aug 14 16:49:44 2025 -0700 Reconstruct failure for forwarded Nexus completion requests (#8198) ## What changed? When forwarding a `CompleteNexusOperation` HTTP request that contains a failure, the completion will be reconstructed instead of reusing the original request body. ## Why? The Nexus SDK reads and closes the HTTP request body when the operation state is `failed` or `canceled` so we cannot reuse it for the forwarded request. For `successful` operations, the SDK just passes on the result content in the form of a `nexus.LazyValue` which we can forward directly since it is not read or closed. ## How did you test it? new functional xdc tests commit 9d82cae Author: Lina Jodoin <[email protected]> Date: Thu Aug 14 16:06:01 2025 -0700 Fix BufferedStart reference in chasm scheduler proto (#8197) ## What changed? _Describe what has changed in this PR._ ## Why? _Tell your future self why have you made these changes._ ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks _Any change is risky. Identify all risks you are aware of. If none, remove this section._ commit 41cce70 Author: Vladyslav Simonenko <[email protected]> Date: Wed Aug 13 15:34:38 2025 -0700 Produce workflow_duration metric on completion (#8185) ## What changed? This PR produces the metric workflow_duration, when the workflow execution completes. ## Why? Currently there is no metric that captures the duration of the workflow execution. It's also valuable to have the duration broken down by task queue, namespace, workflow type, which this PR enables ## How did you test it? - [X] built - [X] run locally and tested manually - [X] covered by existing tests - [X] added new unit test(s) - [ ] added new functional test(s) commit a1df862 Author: Lina Jodoin <[email protected]> Date: Wed Aug 13 15:30:48 2025 -0700 [CHASM Scheduler] Move scheduler protobufs to scheduler/proto package (#8189) ## What changed? - CHASM scheduler protos are moved to live alongside the scheduler implementation code, within the `chasm` package. ## Why? - See #8182. Sending this PR in advance, as that PR asserts protobufs were generated. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) commit 8fe5cee Author: Sean Kane <[email protected]> Date: Thu Aug 14 00:10:06 2025 +0200 improvement: remove waits before fetching activities (#8144) ## What changed? optimize the batch operation processing in `BatchActivity` and `BatchActivityWithProtobuf` by removing the need to wait for entire pages to complete before fetching the next page. - Implemented proactive page fetching once a worker becomes available - common `processWorkflowsWithProactiveFetching` function to reduce code duplication ## Why? The previous implementation had workers wait for entire pages to complete. This optimization improves resource utilization. The refactoring also eliminates duplicated functions in the `BatchParams` struct and `BatchOperation` protobuf. Addresses issue #8098. ## How did you test it? - [x] built - [x] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) The changes maintain backward compatibility. ## Potential risks While this change improves performance, it does modify the concurrency model of batch processing: 1. **Timing changes**: The optimization changes when pages are fetched relative to task completion, which could expose edge cases in error handling or heartbeat timing 2. **Memory usage**: Pages may be fetched earlier, potentially increasing peak memory usage if the next page is large 3. **Rate limiting interaction**: The more aggressive task scheduling could interact differently with rate limiting, though the same per-worker limits are maintained 4. **Heartbeat behavior**: heartbeats track the progress of an entire page and are applied after an entire page finishes The changes preserve all existing error handling, retry logic, and rate limiting behavior, but the different execution timing could surface previously hidden race conditions. --------- Co-authored-by: Roey Berman <[email protected]> commit 469526e Author: pdoerner <[email protected]> Date: Wed Aug 13 09:58:03 2025 -0700 Change default for `component.nexusoperations.recordCancelRequestCompletionEvents` (#8191) ## What changed? Changed default for `component.nexusoperations.recordCancelRequestCompletionEvents` to `true` ## Why? Flag was added to ensure backwards compatibility. Now that 1.28 is released, can change the default. Flag will be removed after 1.29 is released. commit 69e6b6c Author: Rodrigo Zhou <[email protected]> Date: Tue Aug 12 11:31:27 2025 -0700 Bump Temporal API to v1.52.0 (#8187) ## What changed? Bump Temporal API to v1.52.0 ## Why? Bump Temporal API to v1.52.0 ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks commit da90f62 Author: Stephan Behnke <[email protected]> Date: Fri Aug 8 14:43:15 2025 -0700 Decode of nil data (#8179) ## What changed? Don't catch `Data: nil` in test; let it fall through to decoder. The decoder will return an error. An error is the better choice than a `nil` response since that signals to the user that the decoded data is usable/valid. ## Why? Follow-up to #8111; an internal test expects an error instead of `nil`. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [x] added new unit test(s) - [ ] added new functional test(s) ## Potential risks Hard to believe that returning nil and using un-decoded data is a good/valid alternative. commit b8497fa Author: David Reiss <[email protected]> Date: Fri Aug 8 08:32:58 2025 -0700 Dynamic config conversion improvements (#7052) ## What changed? - Split implementation of "constrained default" settings from "plain default" settings. This is more code and the diff looks complex, but the individual paths are both simpler than the mixed version. - Add conversion cache using a weak map. - Remove GlobalCachedTypedValue. - Use "raw" values for subscription dispatch deduping to avoid unnecessary conversions. - Deep copy default values when using mapstructure, to avoid problems with merging over shared default values. ## Why? - Fixes #6756 - Performance improvement for "plain default" settings (almost all of them) - Performance improvement for settings with complex converters - Remove footgun in defaults that aren't scalar values ## How did you test it? existing+new unit tests commit f9bd083 Author: Lina Jodoin <[email protected]> Date: Thu Aug 7 17:11:53 2025 -0700 [Scheduled Actions] Update Scheduler protos for CHASM (#8163) ## What changed? - Added protos for the new Scheduler task types. - Added TODOs for cleanup when the HSM component is removed. ## Why? - A few fields and messages were made obsolete with the CHASM port. commit f8b97e5 Author: Vladyslav Simonenko <[email protected]> Date: Thu Aug 7 16:24:54 2025 -0700 Break out of pagination in scavenger on errors (#8133) ## What changed? Break out of the loop, when iteration through mutable states fails ## Why? Previously, we continued to iterate, leading to the panic: #8037 ## How did you test it? - [X] run locally and tested manually - [X] added new unit test(s)
1 parent 687175b commit df71875

File tree

122 files changed

+2423
-1011
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+2423
-1011
lines changed

.github/.golangci.yml

Lines changed: 159 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,170 @@
1-
# https://golangci-lint.run/usage/configuration/#config-file
1+
version: "2"
2+
3+
formatters:
4+
enable:
5+
- gci
6+
- goimports
7+
28
linters:
3-
disable-all: true
9+
default: none
410
enable:
511
- errcheck
6-
- goimports
712
- importas
8-
# - paralleltest # missing the call to method parallel, but testify does not seem to work well with parallel test: https://github.com/stretchr/testify/issues/187
9-
- revive # revive supersedes golint, which is now archived
13+
- revive
1014
- staticcheck
1115
- govet
1216
- forbidigo
1317
- exhaustive
1418
- godox
15-
issues:
16-
exclude-dirs:
17-
- ^api
18-
- ^proto
19-
- ^.git
20-
exclude-rules:
21-
- path-except: _test\.go|tests/.+\.go
22-
text: "time.Sleep"
23-
linters:
24-
- forbidigo
25-
- path: _test\.go|tests/.+\.go|common/testing/
26-
text: "panic"
27-
linters:
28-
- forbidigo
29-
- path: _test\.go|tests/.+\.go|common/testing/
30-
text: "(cyclomatic|cognitive)" # false positives when using subtests
31-
linters:
32-
- revive
33-
- path: _test\.go|tests/.+\.go|common/testing/
34-
text: "(dot-imports|unchecked-type-assertion)" # helpful in tests
35-
linters:
36-
- revive
37-
- path: ^tools\/.+\.go
38-
linters:
39-
- revive
40-
linters-settings:
41-
godox:
42-
keywords:
43-
- FIXME # marks TODOs that must be fixed before merging
44-
govet:
45-
fieldalignment: 0
46-
forbidigo:
47-
forbid:
48-
- p: time.Sleep
49-
msg: "Please use require.Eventually or assert.Eventually instead unless you've no other option"
50-
- p: panic
51-
msg: "Please avoid using panic in application code"
52-
importas:
53-
# Enforce the aliases below.
54-
no-unaliased: true
55-
# Still allow aliases outside of the rules below.
56-
no-extra-aliases: false
57-
alias:
58-
# no pb services (or their mocks) are aliased - must be at the top!
59-
- pkg: go.temporal.io(/server)?/api/(\w+)service(mock)?/v1
60-
alias: # ie no alias - this can only be specified once!
61-
# public API pbs have a suffix
62-
- pkg: go.temporal.io/api/(\w+)/v1
63-
alias: ${1}pb
64-
# internal server pbs have their own suffix to avoid naming conflicts
65-
- pkg: go.temporal.io/server/api/(\w+)/v1
66-
alias: ${1}spb
67-
exhaustive:
68-
# Presence of "default" case in switch statements satisfies exhaustiveness,
69-
# even if all enum members are not listed.
70-
# Default: false
71-
default-signifies-exhaustive: true
72-
revive:
73-
severity: error
74-
confidence: 0.8
75-
enable-all-rules: true
19+
settings:
20+
staticcheck:
21+
checks:
22+
- "all"
23+
- "-ST1000" # disable: package comment is missing
24+
godox:
25+
keywords:
26+
- FIXME
27+
govet:
28+
disable:
29+
- fieldalignment
30+
forbidigo:
31+
forbid:
32+
- pattern: time.Sleep
33+
msg: "Please use require.Eventually or assert.Eventually instead unless you've no other option"
34+
- pattern: panic
35+
msg: "Please avoid using panic in application code"
36+
importas:
37+
# Enforce the aliases below.
38+
no-unaliased: true
39+
# Still allow aliases outside of the rules below.
40+
no-extra-aliases: false
41+
alias:
42+
# no pb services (or their mocks) are aliased - must be at the top!
43+
- pkg: go.temporal.io(/server)?/api/(\w+)service(mock)?/v1
44+
alias: "" # ie no alias - this can only be specified once! public API pbs have a suffix
45+
- pkg: go.temporal.io/api/(\w+)/v1
46+
alias: ${1}pb
47+
# internal server pbs have their own suffix to avoid naming conflicts
48+
- pkg: go.temporal.io/server/api/(\w+)/v1
49+
alias: ${1}spb
50+
exhaustive:
51+
# Presence of "default" case in switch statements satisfies exhaustiveness,
52+
# even if all enum members are not listed.
53+
# Default: false
54+
default-signifies-exhaustive: true
55+
revive:
56+
severity: error
57+
confidence: 0.8
58+
enable-all-rules: true
59+
rules:
60+
# Disabled rules
61+
- name: add-constant
62+
disabled: true
63+
- name: argument-limit
64+
disabled: true
65+
- name: bare-return
66+
disabled: true
67+
- name: banned-characters
68+
disabled: true
69+
- name: bool-literal-in-expr
70+
disabled: true
71+
- name: confusing-naming
72+
disabled: true
73+
- name: empty-lines
74+
disabled: true
75+
- name: error-naming
76+
disabled: true
77+
- name: errorf
78+
disabled: true
79+
- name: exported
80+
disabled: true
81+
- name: file-header
82+
disabled: true
83+
- name: function-length
84+
disabled: true
85+
- name: imports-blocklist
86+
disabled: true
87+
- name: increment-decrement
88+
disabled: true
89+
- name: line-length-limit
90+
disabled: true
91+
- name: max-public-structs
92+
disabled: true
93+
- name: nested-structs
94+
disabled: true
95+
- name: package-comments
96+
disabled: true
97+
- name: string-format
98+
disabled: true
99+
- name: unexported-naming
100+
disabled: true
101+
- name: unexported-return
102+
disabled: true
103+
- name: unused-parameter
104+
disabled: true
105+
- name: unused-receiver
106+
disabled: true
107+
- name: use-any
108+
disabled: true
109+
- name: var-naming
110+
disabled: true
111+
- name: empty-block
112+
disabled: true
113+
- name: flag-parameter
114+
disabled: true
115+
- name: unnecessary-stmt
116+
disabled: true
117+
- name: range-val-in-closure
118+
disabled: true
119+
120+
# Rule tuning
121+
- name: cognitive-complexity
122+
arguments:
123+
- 25
124+
- name: cyclomatic
125+
arguments:
126+
- 25
127+
- name: function-result-limit
128+
arguments:
129+
- 5
130+
- name: unhandled-error
131+
arguments:
132+
- "fmt.*"
133+
- "bytes.Buffer.*"
134+
- "strings.Builder.*"
135+
exclusions:
136+
paths:
137+
- ^api
138+
- ^proto
139+
- ^.git
76140
rules:
77-
# Disabled rules
78-
- name: add-constant
79-
disabled: true
80-
- name: argument-limit
81-
disabled: true
82-
- name: bare-return
83-
disabled: true
84-
- name: banned-characters
85-
disabled: true
86-
- name: bool-literal-in-expr
87-
disabled: true
88-
- name: confusing-naming
89-
disabled: true
90-
- name: empty-lines
91-
disabled: true
92-
- name: error-naming
93-
disabled: true
94-
- name: errorf
95-
disabled: true
96-
- name: exported
97-
disabled: true
98-
- name: file-header
99-
disabled: true
100-
- name: function-length
101-
disabled: true
102-
- name: imports-blacklist
103-
disabled: true
104-
- name: increment-decrement
105-
disabled: true
106-
- name: line-length-limit
107-
disabled: true
108-
- name: max-public-structs
109-
disabled: true
110-
- name: nested-structs
111-
disabled: true
112-
- name: package-comments
113-
disabled: true
114-
- name: string-format
115-
disabled: true
116-
- name: unexported-naming
117-
disabled: true
118-
- name: unexported-return
119-
disabled: true
120-
- name: unused-parameter
121-
disabled: true
122-
- name: unused-receiver
123-
disabled: true
124-
- name: use-any
125-
disabled: true
126-
- name: var-naming
127-
disabled: true
128-
- name: empty-block
129-
disabled: true
130-
- name: flag-parameter
131-
disabled: true
132-
- name: unnecessary-stmt
133-
disabled: true
134-
- name: range-val-in-closure
135-
disabled: true
141+
- path-except: _test\.go|tests/.+\.go
142+
text: "time.Sleep"
143+
linters:
144+
- forbidigo
145+
- path: _test\.go|tests/.+\.go|common/testing/
146+
text: "panic"
147+
linters:
148+
- forbidigo
149+
- path: _test\.go|tests/.+\.go|common/testing/
150+
text: "(cyclomatic|cognitive)" # false positives when using subtests
151+
linters:
152+
- revive
153+
- path: _test\.go|tests/.+\.go|common/testing/
154+
text: "(dot-imports|unchecked-type-assertion)" # helpful in tests
155+
linters:
156+
- revive
157+
- path: ^tools\/.+\.go
158+
linters:
159+
- revive
160+
issues:
161+
max-issues-per-linter: 0
162+
max-same-issues: 0
163+
164+
run:
165+
timeout: 10m
166+
modules-download-mode: readonly
136167

137-
# Rule tuning
138-
- name: cognitive-complexity
139-
arguments:
140-
- 25
141-
- name: cyclomatic
142-
arguments:
143-
- 25
144-
- name: function-result-limit
145-
arguments:
146-
- 5
147-
- name: unhandled-error
148-
arguments:
149-
- "fmt.*"
150-
- "bytes.Buffer.*"
151-
- "strings.Builder.*"
168+
output:
169+
sort-order:
170+
- file

.github/workflows/run-tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ jobs:
158158
uses: actions/cache/restore@v4
159159
with:
160160
path: ~/go/pkg/mod
161-
key: go-${{ runner.os }}${{ runner.arch }}-deps-${{ hashFiles('go.sum') }}
161+
key: go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
162162

163163
- run: make pre-build-functional-test-coverage
164164
if: ${{ !inputs.run_single_functional_test && !inputs.run_single_unit_test }}
@@ -203,7 +203,7 @@ jobs:
203203
uses: actions/cache/restore@v4
204204
with:
205205
path: ~/go/pkg/mod
206-
key: go-${{ runner.os }}${{ runner.arch }}-deps-${{ hashFiles('go.sum') }}
206+
key: go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
207207

208208
- name: Restore build outputs
209209
if: ${{ !inputs.run_single_functional_test && !inputs.run_single_unit_test }}
@@ -248,7 +248,7 @@ jobs:
248248
uses: actions/cache/restore@v4
249249
with:
250250
path: ~/go/pkg/mod
251-
key: go-${{ runner.os }}${{ runner.arch }}-deps-${{ hashFiles('go.sum') }}
251+
key: go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
252252

253253
- name: Restore build outputs
254254
uses: actions/cache/restore@v4
@@ -343,7 +343,7 @@ jobs:
343343
uses: actions/cache/restore@v4
344344
with:
345345
path: ~/go/pkg/mod
346-
key: go-${{ runner.os }}${{ runner.arch }}-deps-${{ hashFiles('go.sum') }}
346+
key: go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
347347

348348
- name: Restore build outputs
349349
uses: actions/cache/restore@v4
@@ -495,7 +495,7 @@ jobs:
495495
uses: actions/cache/restore@v4
496496
with:
497497
path: ~/go/pkg/mod
498-
key: go-${{ runner.os }}${{ runner.arch }}-deps-${{ hashFiles('go.sum') }}
498+
key: go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
499499

500500
- name: Restore build outputs
501501
uses: actions/cache/restore@v4
@@ -655,7 +655,7 @@ jobs:
655655
uses: actions/cache/restore@v4
656656
with:
657657
path: ~/go/pkg/mod
658-
key: go-${{ runner.os }}${{ runner.arch }}-deps-${{ hashFiles('go.sum') }}
658+
key: go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
659659

660660
- name: Restore build outputs
661661
uses: actions/cache/restore@v4
@@ -815,7 +815,7 @@ jobs:
815815
uses: actions/cache/restore@v4
816816
with:
817817
path: ~/go/pkg/mod
818-
key: go-${{ runner.os }}${{ runner.arch }}-deps-${{ hashFiles('go.sum') }}
818+
key: go-${{ runner.os }}${{ runner.arch }}-${{ hashFiles('go.mod') }}-deps-${{ hashFiles('go.sum') }}
819819

820820
- name: Restore build outputs
821821
uses: actions/cache/restore@v4

0 commit comments

Comments
 (0)