401 Commits

Author SHA1 Message Date
Stephan Behnke
109a38e8ca Add make lint-code-fast (#11786)
When using `git worktree` for agentic workflows during development, the
golangci-lint cache is always cold.

That means the first invocation scans the entire codebase (consuming all
CPU cores) unnecessarily, since almost all lints can be found by just
scanning the changed packages. The exceptions are type-based checks, but
they are rare.

This PR speeds up the agentic development cycle greatly for local
development; and anything that slips through is still caught in CI where
the full codebase is checked.

Example benchmark for cold cache with 1 changed file with 1 finding:
- `lint-code-fast`: 8s
- `lint-code`: 14min

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dan Davison <dan.davison@temporal.io>
2026-08-26 10:00:40 -07:00
Stephan Behnke
e327c061b8 Update Go lint tooling (#11673)
Go 1.27 prerequisite that upgrades golangci-lint, goimports, and
stringer to versions compatible with the new toolchain.
2026-08-20 09:47:39 -07:00
David Porter
b004b7c520 feat: Introduce NilAway, scoped to chasm/lib/scheduler (#11126)
Add uber-go/nilaway as a nil-safety static analyzer, scoped initially to
chasm/lib/scheduler so it can be rolled out incrementally.

- Fix the 6 findings nilaway reports in the package: add nil-guards
after the ReadComponent reads in invoker_tasks.go and
scheduler_tasks.go, and restructure the completed-retention trim in
invoker.go to only reslice when there is excess (resolving a nil-slice
reslice warning).
- Add a pinned nilaway install target and a `lint-nilaway` make target,
scoped via NILAWAY_PKGS (overridable to widen coverage later).
- Add a `nilaway` CI job to linters.yml and to the linters-succeed gate.
nilaway exits non-zero on any finding, so this gates at zero.
- Add unit tests for applyCompletedRetention covering the trim boundary.

## Why?

- We want to use Nilaway, but adding it in a widespread manner is going
to be tricky, so just starting here incrementally

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [X] covered by existing tests
- [X] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
Should be low, one minor guard added, but otherwise mostly just test
infra

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 20:40:50 +00:00
Stephan Behnke
43379f9d42 Delegate mixedbrain devserver lifecycle to Omes (#10413)
## What changed?

Delegate mixedbrain devserver lifecycle to Omes. Related:
https://github.com/temporalio/omes/pull/348

## Why?

Remove duplicated code.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-07-15 14:51:37 -07:00
Long Tran
5b8fd41dfc [testcore] Run testcore unit tests in CI and fix unit test (#10994)
## What changed?

Testcore contains functional testing's common utils, for example cluster
pools, metric captures, etc... Right now these are under
`test/testcore/...`. At the moment, their unit tests don't run because
we filter out the entire `./test` dir which contains functional tests.

I considered moving these to a different location, but that seems like a
slightly more painful codemod, and the current location seems to make
sense (these are used for functional tests).

A side effect of running these in CI is figuring out that the
`tests/testcore/test_cluster_pool_test.go` would be failing, because we
were trying to stand up a onebox temporal cluster without any services,
causing Nexus callback URL set call to fail (it needs frontend address).
Also fixed that unit test in this PR.

## Why?

Run all tests in CI/CD.

## 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)
2026-07-09 11:42:30 -04:00
Stephan Behnke
5e5b6adc03 Run all gofix analyzers by default (#10828)
## What changed?

Set `GOFIX_FLAGS` to empty so `make fmt` runs all `go fix` analyzers.
2026-06-24 16:11:20 -07:00
Stephan Behnke
fdee4dadd4 Add cluster GC leak check (#10767)
## What changed?

Extending the goroutine leak testing to include checking for memory
leaks.

## Why?

We've observed OOM kills on CI jobs that indicate resource leaks. This
is one more way to identify specific leaks, in this case memory, and
ensure no regressions occur.

## How did you test it?

<details><summary>pass example</summary>
<p>

```
object leak report

tracked root objects: 3
retained objects: 65227 total, 65227 expected, 0 unexpected
stale exclusions: 0

unexpected retained objects:
  none

expected retained objects:
  8002x cluster.testBase.ShardInfo.state.atomicMessageInfo.Desc.Base.L0.ParentFile.fileRaw.builder.TypeResolver.typesByName[*] (*impl.MessageInfo)
  3643x cluster.testBase.ShardInfo.state.atomicMessageInfo.Desc.Base.L0.ParentFile.fileRaw.builder.TypeResolver.typesByName[*].Desc.Base.L0.ParentFile.fileRaw.builder.FileRegistry.fileRegistry.descsByName[*]

[...]
```

</p>
</details> 

<details><summary>fail example
</summary>
<p>

```
object leak report

tracked root objects: 3
retained objects: 65256 total, 40014 expected, 25242 unexpected
stale exclusions: 0

unexpected retained objects:
  2046x cluster.host.fxApps[*].container.scope.gh.nodes[*] (*dig.graphNode)
  2046x cluster.host.fxApps[*].container.scope.providers[*][*].orders[key*].gh.nodes[*] (*dig.graphNode)
  2046x cluster.host.fxApps[*].container.scope.providers[*][*].orders[key*].gh.nodes[*].Wrapped.orders[key*].gh.nodes[*] (*dig.graphNode)
  1701x cluster.host.fxApps[*].container.scope.providers[*][*].orders[key*].gh.nodes[*].Wrapped.orders[key*].gh.nodes[*].Wrapped.orders[key*].gh.nodes[*] (*dig.graphNode)
[...]
```

</p>
</details>
2026-06-19 18:22:32 +00:00
Stephan Behnke
9eb7e6b76e Add goroutine-leak regression test (#10762)
## What Changed?

Adds a goroutine-leak regression test

## Why?

First step in goroutine leak regression testing effort; establishing
baseline.

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-18 10:30:32 -07:00
Stephan Behnke
ff5557b90b Prepare Go GitHub action (#10709)
## What changed?

Added an explicit `go download` step with retry.

Extracted a new GitHub action for the "setup Go" steps across test jobs;
to reduce duplication.

## Why?

Sometimes the `go download` fails and could be retried:
https://github.com/temporalio/temporal/actions/runs/27560870829/job/81473394249?pr=9160

```
go: go.opentelemetry.io/otel@v1.43.0: read "https://proxy.golang.org/go.opentelemetry.io/otel/@v/v1.43.0.zip": stream error: stream ID 1335; INTERNAL_ERROR; received from peer
Error: Process completed with exit code 1.
```

Also; pre-build is now faster.

<img width="1264" height="306" alt="image"
src="https://github.com/user-attachments/assets/c90a5683-889c-48e6-a1bb-9bca695e23ae"
/>

It is usually
[1-2min](https://github.com/temporalio/temporal/actions/runs/27565277131/job/81487709681#step:5:14).
2026-06-16 09:29:59 -07:00
Stephan Behnke
4f8de868c4 Improve testrunner timeout behavior (#10713)
## What changed?

Old behavior was
```
 10m    GitHub step timeout
  5m    --total-timeout (derived from -timeout)
  5m    go test -timeout
```

New behavior is 

```
 10m  GitHub step timeout
  9m  TEST_RUNNER_TIMEOUT / --total-timeout
  5m  go test -timeout
```

ie attach the testrunner timeout to the ceiling not the floor.

Example now with logs:
https://github.com/temporalio/temporal/actions/runs/27570791993/job/81507067577?pr=10713#step:9:46

## Why?

(1) We don't see any logs when the testrunner out.
(2) testrunner has no time anymore to do a retry when `go test` times
out.
2026-06-15 15:42:53 -07:00
Stephan Behnke
9a33ab1b5a Generate JSON test summary (#10381)
## What changed?

(1) Generate JSON test summary, too
(2) Tweak summary detail capture esp for `Await`

## Why?

Allow AI agents to easily/quickly/cheaply inspect CI results.

<img width="1582" height="707" alt="Screenshot 2026-05-25 at 6 46 13 PM"
src="https://github.com/user-attachments/assets/ca232f52-4f6f-45cb-9b52-450d32999d0c"
/>

<img width="2158" height="254" alt="Screenshot 2026-05-25 at 6 47 03 PM"
src="https://github.com/user-attachments/assets/447ccf28-bec7-424b-a961-630c44a02cb0"
/>
2026-05-27 02:14:19 +00:00
Yichao Yang
d277ac1779 Codegen for routingKey extractor (#9836)
## What changed?
- Codegen to automatically generate code for extracting businessID for
workflowservice methods based on "temporal-resouce-id" proto option

## Why?
- With codegen, any new API will automatically have the logic for
businessID extraction and avoids the case where businessID extractor
logic forget to be updated.

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [x] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)
2026-05-01 17:56:10 -07:00
Stephan Behnke
c534e8cc7c fix COVERPKG_FLAG (#10131)
## What changed?

Changed `-coverpkg` to list all packages with wildcard expression
instead of listing them individually.

## Why?

Previously a lot of [warnings were
printed](https://github.com/temporalio/temporal/actions/runs/25144303588/job/73700946660?pr=10130#step:11:28).

<img width="1010" height="955" alt="Screenshot 2026-04-29 at 7 37 41 PM"
src="https://github.com/user-attachments/assets/c6e88362-745e-4d7c-a9ed-50f740108129"
/>

## How did you test it?

Code coverage is still about the same (not sure where the minor diff
comes from tbh but I see it for individual files, too, not just
packages):

<img width="3284" height="333" alt="Screenshot 2026-04-29 at 7 57 11 PM"
src="https://github.com/user-attachments/assets/c5f59090-e439-4d6b-9b46-994972e43379"
/>
2026-04-30 09:19:50 -07:00
Stephan Behnke
e4294817dc JUnit summary with failures (#9912)
## What changed?

Add failure details per test to GitHub summary view.

## Why?

Avoid digging through logs.

## 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)

**Example**:

<img width="1193" height="644" alt="Screenshot 2026-04-13 at 1 58 43 PM"
src="https://github.com/user-attachments/assets/9743dba8-7e66-42c9-a877-240e36d7b9b9"
/>

https://github.com/temporalio/temporal/actions/runs/24366106128?pr=9912
2026-04-16 16:16:57 +00:00
Vladyslav Simonenko
d12d4a4bac Add local JWT development server with key generation scripts (#9647)
## What changed?
- Added `development-jwt.yaml` config that runs Temporal with JWT
authorization enabled using a JWKS file loaded from local disk. Loading
from local disk is added in
https://github.com/temporalio/temporal/pull/9590.
- Added `config/jwt/setup-keys.sh` to generate an RSA key pair and JWKS
file in `/tmp/temporal-jwt-test/`.
- Added `config/jwt/generate-token.sh` to create signed JWTs for
testing.
  - Added `make start-jwt` target.
 
## Why?
Testing JWT authentication currently requires an external identity
provider or manual key/token setup. This provides a self-contained local
workflow: `make start-jwt` generates keys automatically and starts the
server with auth enforced, and `generate-token.sh` produces tokens on
demand.

## 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)

Tested this in conjunction with
https://github.com/temporalio/temporal/pull/9582. Was able to list the
workflows by passing the token and dumping their history. When the token
is not used, the auth fails with "Request denied".

## Potential risks
Keys are stored in /tmp/temporal-jwt-test/ which is world-readable. This
is acceptable for local development but the scripts should not be used
in shared or production environments.
2026-04-15 16:26:53 -07:00
Stephan Behnke
1d58ed21cc buf format (#9663)
## What changed?

Adds `buf format` as a Makefile target; and integrates it into `make
fmt`.

All `.proto` changes are from running `make fmt`.

## Why?

Consistent protobuf file style.

## 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)
2026-03-30 15:30:50 -07:00
long-nt-tran
48508ff060 Export OTEL_EXPORTER_OTLP_ENDPOINT=json in OTEL=true path in Makefile (#9668) 2026-03-25 20:13:08 -04:00
Tom Dyas
559038c82a use tagged API v1.62.3 (#9518)
Use tagged API 1.62.3 for cloud release purposes. This tag includes the
api-go psuedo-version already in the go.mod.

---------

Co-authored-by: Chris St. Pierre <chris.st-pierre@temporal.io>
2026-03-16 08:36:18 -07:00
David Reiss
96dba8e7dd Add fairsim to gitignore and remove binary (#9439)
## What changed?
Add `fairsim` binary (from #8158) to `.gitignore` and `make clean` and
remove it from the repo. (Don't add it to `make bins` since it's not
generally useful.)

## Why
It accidentally got checked in.
2026-03-06 09:59:03 -08:00
Ulrich Romahn
45617a882c Fixing bug in retrieving archived workflows from Google Cloud Store (#9329)
## What changed?
Fixed a bug in the gcloud visibility_archiver.go file and added a new
unit test in visibility_archiver_test.go.

## Why?
There is a bug in the visibility-archiver implementation of the Google
Cloud archiver. All archived workflows are being retrieved and displayed
twice. This change fixes that bug.

## How did you test it?
- [X] built
- [X] run locally and tested manually
- [ ] covered by existing tests
- [X] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
No risk since the archiver is completely decoupled from the core
functionality.
2026-03-04 23:50:13 -05:00
David Reiss
f9529d0481 Add matching fairness simulator (#8158)
## What changed?
Add a new cli tool to run the matching fairness simulator, and some
tests for basic fairness behavior.

## Why?
So users can tell how it will behave for their workloads.
2026-03-02 11:45:32 -08:00
Stephan Behnke
9da9fb77e8 Mixed brain test (#9364)
## What changed?

Add new PR check mixed brain that runs
[Omes](https://github.com/temporalio/omes) against PR's server and
latest released server.

## Why?

It's easy to make an incompatible change accidentally. And while we do
have tests to catch these, they don't run on PRs. This causes a
significant delay (and context loss).

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [x] added new functional test(s)

Verified last backwards incompatible change would have been caught:
https://github.com/temporalio/temporal/actions/runs/22204203793/job/64224556383#step:10:38

## Potential risks

I'd like to make this a _non-blocking_ check until we think it's stable
enough. (requires admin AFAIK)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 17:16:40 -08:00
Stephan Behnke
73119cd3ef go fix workflow (#9353)
## What changed?

1. Tweak on the loop in Makefile target `fmt-gofix` to retry based on
output log.
2. Include `fmt-gofix` in CI.

## 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)
2026-02-23 15:44:30 -08:00
Stephan Behnke
4a2e88a173 Parallelize integration tests (#9292)
## What changed?

Made integration tests run in parallel.

## Why?

Before: ~8min
[[run](https://github.com/temporalio/temporal/actions/runs/21930252400/job/63333789136#step:7:1)]
🐢
After: ~3m
[[run](https://github.com/temporalio/temporal/actions/runs/22114061618/job/63917852614?pr=9292)]
🐰

## 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

They are not known to be flaky; and anecdotally all passed on the first
run.
2026-02-18 09:13:26 -08:00
Stephan Behnke
5b49acfaf9 go fix (#9337)
## What changed?

Integrate Go 1.26's new `go fix` into workflow.

NOTE that the changes caused our linter to fire; a [separate
commit](1b23f787ae)
addresses those.

## Why?

Ensure Go code is standardized/modernized.

## 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)
2026-02-18 09:12:19 -08:00
Stephan Behnke
1998252880 Bump golangci-lint to v2.9.0 (#9302)
WISOTT
2026-02-12 08:28:36 -08:00
Stephan Behnke
f085da8057 Standardize YAML formatting (#9142)
## What changed?

Adds and integrates `yamlfmt` (Go-based, by Google).

Anything not annotated was changed by `yamlfmt`.

## Why?

Consistent YAML formatting. Reduce unrelated diffs caused by formatting
in PRs.

## 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)
2026-02-04 23:57:24 +00:00
Alex Stanfield
70c2b81dca Update Configuration Loading (#8477)
## What Changed

This PR introduces a new `--config-file` flag (and the
`TEMPORAL_SERVER_CONFIG_FILE_PATH ` environment variable) to remove the
dependency on `dockerize` in the Temporal server Docker image.

When a configuration file is specified using either the CLI flag or the
environment variable, the server will load configuration **only** from
that file.
Users who want templating behavior similar to `dockerize` can enable it
by adding the comment `# enable-template` at the top of the
configuration file.

---

### Key Changes

1. **New `--config-file` flag:**

* Adds a global `--config-file` flag that accepts a path to a single
configuration file (absolute or relative to the project root).
* Can also be set via the `TEMPORAL_SERVER_CONFIG_FILE_PATH `
environment variable.

2. **Deprecated legacy flags:**

* The `--config`, `--env`, and `--zone` flags are now marked as
**deprecated** in CLI help text.
   * These flags still work for backward compatibility.

3. **Embedded config template:**

* The `config_template.yaml` file is now embedded in the binary to
support loading configuration from environment variables.
* Templating is supported if the file includes the `# enable-template`
comment at the top.

4. **Templating support:**

* Configuration files can use templating by including `#
enable-template` at the beginning of the YAML file.

---

### Configuration Loading Priority (Highest to Lowest)

1. **`--config-file` specified** → Load that specific file
2. **`--config`, `--env`, or `--zone` specified** → Load from
configuration directory (**deprecated**)
3. **No configuration specified** → Load from embedded template using
environment variables (default)

---

### Expected Behavior

The following examples illustrate how the new configuration loading
logic behaves:

* **Default behavior:**
Running `temporal start` without flags loads configuration from
environment variables only using the embedded template.

* **Using `--config-file`:**
`temporal --config-file=/path/to/config.yaml start` loads configuration
from the specified file path.

* **Using `TEMPORAL_SERVER_CONFIG_FILE_PATH`:**
Setting `TEMPORAL_SERVER_CONFIG_FILE_PATH=/path/to/config.yaml temporal
start` has the same effect as using the flag.

* **Validation and error handling:**
The CLI returns clear error messages when conflicting flags or
environment variables are used, or when a specified file does not exist.
---

## Breaking Change

The default behavior of `temporal start` has changed.
It now loads configuration **from environment variables** instead of
using a default template path.

---------

Co-authored-by: Alex Stanfield <chaptersix@users.noreply.github.com>
Co-authored-by: michaely520 <michaely520@users.noreply.github.com>
Co-authored-by: Yichao Yang <yichao@temporal.io>
Co-authored-by: David Reiss <david@temporal.io>
2025-11-18 16:23:25 +00:00
David Reiss
ef83e3ebe3 Add errortype linter and fix two bugs (#8517)
## What changed?
- Add [errortype](https://github.com/fillmore-labs/errortype) linter to
`lint-code` target.
- Fix two bugs that it found.

## Why?
Checking error types with errors.As can be tricky.

## How did you test it?
- [x] built
- [x] run locally and tested manually
- [x] covered by existing tests
2025-10-21 19:05:41 +01:00
Prathyush PV
f3aee543a1 Remove pinned dependency for modernc.org/sqlite (#8489)
## What changed?
Remove pinned dependency on modernc.org/sqlite.

## Why?
We added this version override when we experienced some table not found
errors. This happens when sqlite db connections are closed when
transactions fail.
We have TestSQLiteTransactionContextCancellation which passes
consistently for this new version. So we believe this issue should not
happen again.

## 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)
2025-10-16 02:51:22 +00:00
Rob Holland
389d1ab7d1 Fix command line flag argument parsing for elasticsearch-tool. (#8445)
## What changed?
Reverts to urlfav/cli v1 as per other tools and uses shared flag aliases
where appropriate for more consistency with the other tools.

Works around Go embed's lack of support for symlinks by hard coding the
path to the index template to use. Adds a test to ensure this doesn't
get out of sync with the latest.

## Why?
Better consistency with other tools and being able to actually find the
index template :)

## How did you test it?
- [x] built
- [x] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)
2025-10-08 07:49:42 +01:00
Roey Berman
ee45e7b2fe CHASM client codegen (#8398)
## What changed?

Added a protoc plugin to generate client for internal CHASM requests to
the history service.
A CHASM library can now define its own set of gRPC services and register
a handler for those.

I had to modify the history client files to be generic, which broke the
mock generation, so I had to hand code the tests there, which IMHO is
actually nicer than the way they were with mocks.

Also opted out of mock generation for CHASM services, there's just not
enough value there.

**NOTE**: Instead of creating three separate clients, I generated a
single layered client, with a constructor that is DI friendly. There
doesn't seem to be a good enough reason to break this out into separate
clients or make client construction configurable (for now).

**NOTE**: We can also get rid of the genrpcwrappers script eventually
and use the protoc plugin approach for all services, I decided not to do
that here though to reduce scope.

For a preview of the generated file see:
-
3a89614a90/chasm/lib/activity/proto/v1/service.proto
-
3a89614a90/chasm/lib/activity/gen/activitypb/v1/service_client.pb.go
 
## Why?

Keep all CHASM library functionality contained.

## How did you test it?
- [ ] built
2025-10-02 16:13:39 +00:00
Rob Holland
1dc6264f4f Add Elasticsearch CLI tool (#8296)
## What changed?

- Revive and update original PR #2977 for Elasticsearch CLI tool

Replaces manual curl invocations with a proper CLI tool that leverages
Temporal's built-in Elasticsearch auth providers and provides better
error handling and logging.

## 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

None, net new.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Introduces `temporal-elasticsearch-tool` for ES schema/index
management and ping, extends ES client APIs, embeds ES schema, and
updates Makefile to use the tool.
> 
> - **Tools**:
> - New `temporal-elasticsearch-tool` CLI with commands: `setup-schema`,
`update-schema`, `create-index`, `drop-index`, `ping`; supports AWS auth
and uses embedded schema files.
> - Adds entrypoint `cmd/tools/elasticsearch`, README, and basic tests.
> - **Elasticsearch Client**:
> - Extends `CLIClient` with `ClusterPutSettings`, `IndexPutTemplate`,
`IndexPutMapping`, `Ping` and implements them (v7) using raw requests
where needed; allows custom HTTP client from config (e.g., AWS-signed).
> - **Schema**:
> - Embeds ES v7 cluster settings and index template
(`schema.Embedded...` accessors).
> - **Build/Makefile**:
> - Adds build target and binary cleanup for
`temporal-elasticsearch-tool`; updates `install-schema-es` and
`install-schema-xdc` to use the CLI instead of curl.
> - Includes binary in `.goreleaser.yml`; excludes it in
`.dockerignore`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b37864809a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-02 10:52:21 +01:00
Stephan Behnke
e991dcce34 Use local gomock (#8404)
## What changed?

Ensure that when running `go-generate`, the local gomock is used.

## Why?

Stop wasting people's time chasing errors due to the wrong binary being
used.

## 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)
2025-10-01 08:50:27 -07:00
Stephan Behnke
33676bd6b9 enable iotamixing linter (#8358)
## What changed?

Added iotamixing linter.

> Checks if iotas are being used in const blocks with other non-iota
declarations.

## Why?

We had a near-incident that was traced back to using iota incorrectly.

## How did you test it?

Ran

```
.bin/golangci-lint-v2.5.0 run --verbose --enable-only=iotamixing --config=.github/.golangci.yml
```
and it passes (after addressing the one issue it found).
2025-09-22 13:34:23 -07:00
Stephan Behnke
71a56f88c1 Use locally installed protoc plugins (#8325)
## What changed?

~Enforce `temporal/cmd/tools/protogen` to set the PATH to point to the
locally installed tools in `.bin`.~

Enforce `temporal/cmd/tools/protogen` to use locally installed protoc
plugins.

## Why?

Without this, it will use whatever is on the PATH; which might not be
the same as in `.bin`.

## How did you test it?
- [ ] built
- [x] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)

Without this change, I get different `.pb.go` files emitted as my global
proto-gen-go is used.
2025-09-15 20:15:00 +00:00
Stephan Behnke
4bc36b20c4 Report test crash (#8221)
## What changed?

Added a CI step that writes a crash JUnit XML file if the testrunner
doesn't complete.

## Why?

(1) Make the "Summary" helpful again by quickly seeing what went wrong.
(2) Make CodeCov show these crashes.
(3) Make our internal test report show these crashes.

## 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)

Example run:
https://github.com/temporalio/temporal/actions/runs/17107215158?pr=8221

<img width="1184" height="1167" alt="image"
src="https://github.com/user-attachments/assets/a1c5445e-4359-450d-83ec-8b7a169c47cd"
/>
2025-09-04 18:10:12 -07:00
Roman Dmytrenko
8b717ec4a5 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 <rdmytrenko@gmail.com>
Co-authored-by: Stephan Behnke <stephanos@users.noreply.github.com>
Co-authored-by: Stephan Behnke <stephan.behnke@temporal.io>
2025-08-27 19:34:05 +00:00
Roman Dmytrenko
14d52cedf1 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 <rdmytrenko@gmail.com>
2025-08-21 15:16:29 +00:00
Roey Berman
21f556cd8e 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.
2025-08-15 19:13:28 +00:00
Roey Berman
4c59cd15d7 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
2025-08-15 18:09:58 +00:00
Stephan Behnke
c762ad2ee2 Exclude Google Cloud Storage gRPC packages (#7988)
## What changed?

Stripped Google Cloud Storage's gRPC dependencies out for builds via the
Makefile.

## Why?

Reduce binary size by 16MB; and reduces build times a little (ie
linking).

**Before**

```
-rwxr-xr-x@ 1 stephan  staff   119M Jun 30 11:23 temporal-server
```

**After**

```
-rwxr-xr-x@ 1 stephan  staff   103M Jun 30 11:24 temporal-server
```

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks

Yes, since there are no end-to-end tests, if anyone started using
`storage.NewGRPCClient` that would fail silently. I added a (crude) test
to catch that.
2025-06-30 15:19:17 -07:00
Stephan Behnke
a980487cc2 Specify CGO_ENABLED for tests as well (#7937)
## What changed?

Explicitly set `CGO_ENABLED` for test-related make targets.

## Why?

Missing `CGO_ENABLED` can negatively affect build times on some systems
(e.g. adds +10s on OSX).

Also, consistency. Build targets already have it set.

## 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)
2025-06-18 13:53:24 -07:00
Prathyush PV
aaeb9ddf28 Enable buf-breaking check (#7892) 2025-06-11 09:47:40 -07:00
Tim Deeb-Swihart
101091a6b4 testlogger: actually fail tests when we're supposed to (#7874)
## What changed?

This changes all methods that fail tests on the test logger to
**forcibly** fail it by calling `t.Fatalf`.

It adds the stack trace to the failure message as we'd otherwise have no
information on the _path_ to the failure, which is why we initially used
`panic`

## Why?

While testing a separate project I determined that panics from OSS' test
logger (and the internal one it is based on!) were being caught by our
application code, obscuring issues that should cause tests to fail.

## 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

This may fail more tests than we currently do. This is a Good Thing.
2025-06-10 15:54:58 -04:00
Prathyush PV
f16ed1f3d2 Revert "Include transient and speculative WFT events in GetWorkflowExecutionHistory response (#7732)" (#7878)
This reverts commit 5fc3fb21c4.

## What changed?
Reverts the change to return transient and speculative WFT events.

## Why?
Started seeing new error like this
"history_events: premature end of stream, expectedLastEventID=4424 but
no more events after eventID=4422" in pipelines which was not there
before.

## 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)
2025-06-09 20:24:00 -07:00
Rodrigo Zhou
f103ff4508 Support add search attribute in dual visibility (#7781) 2025-05-23 21:54:59 +00:00
Shahab Tajik
30977d2006 Fix unversioned to versioned transition bug (#7796)
## What changed?
The effective behavior did not consider an ongoing transition (unlike
effective version) and this caused some tasks getting wrong Directive
and be unwontedly dropped.

Plus some other improvements.

## Why?
above

## 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

---------

Co-authored-by: Carly de Frondeville <carly.defrondeville@temporal.io>
2025-05-23 03:01:56 +03:00
Alex Shtin
25b7b5c47d Refactor: remove yaml config files from functional tests (#7775)
## What changed?
Refactor: remove yaml config files from functional tests. ndc and xdc
configs are still there and I will do it in following PRs.

## Why?
It is much more convenient to have test configuration in code than in
yaml files.

## 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)
2025-05-16 00:29:38 -07:00
Alex Shtin
91893f1064 Remove license header from every file (#7689)
## What changed?
<!-- Describe what has changed in this PR -->
Remove license header from every file. Because it is really hard to
follow in this PR here is the summary:
1. License header is removed from all `.go` and `.proto` files
:fireworks::fireworks:🎆.
2. `LICENSE` file in the root directory has only Temporal and Uber
copyrights.
3. 5 other `LICENSE` files added to the packages which have copyrights
different from Temporal and Uber: Datadog, Xargin, "Mat Ryer, Tyler
Bunnell and contributors".
4. `license_file` flag is removed from all code generation tools.
5. `copyright_file` flag is removed from `go:generate mockgen`
directive.
6. All copyright related targets are removed from `Makefile`.
7. Updated Temporal copyright year to 2025 everywhere.

## Why?
<!-- Tell your future self why have you made these changes -->
I double checked with legal department that it is not needed to have
license header in every file. One file per repo is enough. I put all
copyrights to the root `LICENSE` file and removed header from all other
files. Also updated tools and `Makefile`.
2025-05-01 18:50:21 -07:00