-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Alias imports in activity.go #8859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
chasm/lib/activity/activity.go
Outdated
| 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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
dandavison
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
## 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)
What changed?
Added alias to imports in activity.go
Why?
When
make lint-codeis run locally, it is insistent on aliasing the activity API import toactivitypb "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?