Commit Graph

16 Commits

Author SHA1 Message Date
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
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
Stephan Behnke
530081ccc5 Update protoc-gen-go and protogen (#7528)
WISOTT
2025-03-31 15:16:06 -07:00
Yichao Yang
b8e1eed5dd CHASM: Wire up noop chasm tree with mutable state (#7407)
## What changed?
<!-- Describe what has changed in this PR -->
- Wire up noop chasm tree with mutable state

## Why?
<!-- Tell your future self why have you made these changes -->
- To make sure we have the right methods on chasm tree and can work with
rest of the stack.

## How did you test it?
<!-- How have you verified this change? Tested locally? Added a unit
test? Checked in staging env? -->
- Unit test WIP

## Potential risks
<!-- Assuming the worst case, what can be broken when deploying this
change to production? -->
- N/A, noop tree impl is used.

## Documentation
<!-- Have you made sure this change doesn't falsify anything currently
stated in `docs/`? If significant
new behavior is added, have you described that in `docs/`? -->
- N/A

## Is hotfix candidate?
<!-- Is this PR a hotfix candidate or does it require a notification to
be sent to the broader community? (Yes/No) -->
- No
2025-03-10 13:40:03 -07:00
Tim Deeb-Swihart
049334aa67 Update api-go and sdk-go to allow invalid UTF-8 in protos (#5476)
## What changed?
I've upgraded the version of our Go API in order to allow invalid UTF-8
data in our proto strings.

Please review
5cf979058d
only

## Why?
The version of gogo/protobuf we used allowed invalid UTF-8 in strings
which is a violation of the proto3 spec. We were unaware of this until
our new google/protobuf based structs began failing to deserialize data
we'd used previously

## How did you test it?
I added a new end-to-end test to verify that we can create, describe,
and delete a namespace that contains invalid UTF-8 in multiple
attributes

## Potential risks
This is lower risk than commits prior to this as temporal DBs may
already contain invalid UTF-8 data

## Documentation
I adjusted our docs to mention this behavior and the `protolegacy` tag

## Is hotfix candidate?
Yes: this will be going out as part of our 1.23.0 release. In fact, the
release is blocked on it!

---------

Co-authored-by: David Reiss <david@temporal.io>
2024-03-01 23:21:27 +00:00
Tim Deeb-Swihart
ee3aa2feec Use the new protogen build tool (#5212)
## What changed?
I replaced protoc.sh with
[protogen](https://github.com/temporalio/api-go/pull/139)

## Why?
I've copied some variant of this protoc.sh tool into three repos now.
This is unsustainable, so I've added a little build tool to api-go that
will handle proto generation and post-processing for us.

## How did you test it?
[I ran `make proto` in the PR stacked on this
one](https://github.com/temporalio/temporal/pull/5211)

## Potential risks
None

## Is hotfix candidate?
No
2023-12-11 17:49:10 +00:00
Tim Deeb-Swihart
5ba90bccac Clean up protos (#5157)
**What changed?**
I rebuilt all proto files and bumped the version of our protoc plugin

**Why?**
So as to not pollute the PRs of others

**How did you test it?**
CI

**Potential risks**
None

**Is hotfix candidate?**
No.
2023-11-27 18:11:33 +00:00
Tim Deeb-Swihart
49b933c587 Fix double-license problem (#5147)
**What changed?**
I added the magic MIT License header to all proto files and regenerated
the code

**Why?**
Turns out we didn't include the header our licensegen script checked
for, so when the new protoc plugin prepending the license our licensegen
script would prepend it a second time
2023-11-22 01:43:19 +00:00
Tim Deeb-Swihart
1be76e3583 Replace gogo/protobuf with google/protobuf (#5032)
**What changed?**

gogo/protobuf has been replaced with Google's official go compiler. 

**Why?**

gogo/protobuf has been deprecated for some time and the community is
moving on, building new tools (like vtproto) atop google's v2 compiler.

**How did you test it?**

`make test`

**Potential risks**

1. The change from embedded gogo-generated-structs to
google-generated-pointers-to-structs created a risk of nil pointer
exceptions. I've fixed all the ones our tests found but it's possible
there are more lurking in the new code.
2. This change may cause our performance to decrease. Certainly
encoding/deconding of proto objects will become slower, but the overuse
of pointers by the google compiler may negatively affect our overall
performance. We'll need to keep an eye on the GC stats
3. This breaks the HTTP API. We will not support [shortand payload
encoding](https://github.com/temporalio/proposals/blob/master/api/http-api.md#payload-formatting)
in this first pass; that will come once this initial work is in testing.

**Breaking changes for developers**

- `*time.Time` in proto structs will now be
[timestamppb.Timestamp](https://pkg.go.dev/google.golang.org/protobuf@v1.31.0/types/known/timestamppb#section-documentation)
- `*time.Duration` will now be
[durationpb.Duration](https://pkg.go.dev/google.golang.org/protobuf/types/known/durationpb)
- V2-generated structs embed locks, so you cannot dereference them. `go
vet` will scream at you about this. If you need a copy, use
`proto.Clone`.
- If the performance of this sucks then I will either update our code
generator to add shallow-clone methods or hand-roll the ones we need
- Proto enums will, when formatted to JSON, now be in
`SCREAMING_SNAKE_CASE` rather than `PascalCase`. We decided (in
discussion with the SDK team) that now was as good a time as any to rip
the bandage off.
- Proto objects, or objects embedding protos, cannot be compared using
`reflect.DeepEqual` or _anything_ that uses it. This includes `testify`
and `mock` equality testers!
- You will need to use the `common/testing/protorequire`,
`common/testing/protoassert`, or `common/testing/protomock` packages
instead. I've implemented proto-compatible matchers and assertions there
for all cases I've encountered
- If you need `reflect.DeepEqual` for any reason you can use
`go.temporal.io/api/temporalproto.DeepEqual` instead

Note that history loading will not be impacted by the JSON changes: I
rewrote history loading to dynamically fix incoming history JSON data
(like all our other sdks); you can find this code in [my fork of our go
API](https://github.com/tdeebswihart/temporal-api-go/blob/master/internal/temporalhistoryv1/load.go)
alongside its tests.

**🚨Sharp Edges Introduced🚨**

Beware `*timestamppb.Timestamp.AsTime()`. If you need to extract a time
value from a proto time (timestamppb) **always** make sure to check
whether it's nil first. When the proto object is `nil` `AsTime()` will
return a non-zero time at the proto epoch: UTC midnight on January 1,
1970.

I've made this mistake multiple times during this transition and each
time it's been a pain to debug

**Is hotfix candidate?**

No.
2023-11-21 15:19:37 -08:00
Yichao Yang
66352edefb Track and emit metrics for entities in a single workflow (#4065) 2023-03-22 11:45:19 -07:00
Alex Shtin
49cb949a5e Rename scheduleID to scheduledEventID and startedID to startedEventID (#2992) 2022-06-15 11:48:11 -07:00
Alex Shtin
15c8d047a9 Update proto license header (#617) 2020-08-17 11:23:27 -07:00
Alex Shtin
004c86cb44 Rename Decision to Command (#538) 2020-07-13 22:55:43 -07:00
Alex Shtin
2b23c59bb9 Migrate to new vanity import URLs (#517) 2020-07-08 19:48:20 -07:00
Alex Shtin
ca33ba46a6 Use vanity import package name go.temporal.io/server (#511) 2020-07-08 16:09:12 -07:00
Alex Shtin
f685a88a79 Add proto generated go files (#506) 2020-07-08 09:25:23 -07:00