Skip to content

Conversation

@fretz12
Copy link
Contributor

@fretz12 fretz12 commented Dec 17, 2025

What changed?

Added alias to imports in activity.go

Why?

When make lint-code is run locally, it is insistent on aliasing the activity API import to activitypb "go.temporal.io/api/activity/v1". This is because the activity model "go.temporal.io/server/chasm/lib/activity/gen/activitypb/v1" also has the name. I've renamed both so lint-code won't keep modifying it.

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)

@fretz12 fretz12 requested review from a team as code owners December 17, 2025 23:33
@fretz12 fretz12 requested a review from dandavison December 17, 2025 23:33
tokenspb "go.temporal.io/server/api/token/v1"
"go.temporal.io/server/chasm"
"go.temporal.io/server/chasm/lib/activity/gen/activitypb/v1"
statepb "go.temporal.io/server/chasm/lib/activity/gen/activitypb/v1"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

open to a alternative alias

Copy link
Contributor

Choose a reason for hiding this comment

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

Other chasm libhraries use schedulerpb and callbackpb (although we alias that to callbackspb for some reason!).

I vote we alias the api one to apiactivitypb here for consistency with other CHASM libraries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I tried first, but the linter is very insistent on calling the API one activitypb

Copy link
Contributor

@dandavison dandavison left a comment

Choose a reason for hiding this comment

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

LGTM!

Base automatically changed from fredtzeng/saa-info-fields to standalone-activity December 19, 2025 00:37
@fretz12 fretz12 merged commit cd38c44 into standalone-activity Dec 19, 2025
55 of 56 checks passed
@fretz12 fretz12 deleted the fredtzeng/saa-import-alias branch December 19, 2025 00:56
dandavison pushed a commit that referenced this pull request Dec 19, 2025
## What changed?
Added alias to imports in activity.go

## Why?
When `make lint-code` is run locally, it is insistent on aliasing the
activity API import to `activitypb "go.temporal.io/api/activity/v1"`.
This is because the activity model
`"go.temporal.io/server/chasm/lib/activity/gen/activitypb/v1"` also has
the name. I've renamed both so lint-code won't keep modifying it.

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

3 participants