Skip to content
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

Allow disabling of function name aliasing during registration #672

Closed
cretz opened this issue Dec 15, 2021 · 3 comments · Fixed by #850
Closed

Allow disabling of function name aliasing during registration #672

cretz opened this issue Dec 15, 2021 · 3 comments · Fixed by #850
Labels
enhancement New feature or request

Comments

@cretz
Copy link
Member

cretz commented Dec 15, 2021

Is your feature request related to a problem? Please describe.

Today when given a name to register workflows (and activities?) with, we also effectively register the function name and we don't check for uniqueness like we do with the explicit name. So when the workflow is called by function reference, it could still suffer ambiguity.

Describe the solution you'd like

Add workflow.RegisterOptions.DisableFunctionNameAlias to disable this default aliasing (and activity too?). We can't make the disable default due to backwards-compatibility reasons.

Describe alternatives you've considered

We could just live with it and tell people that are registering with a string name that they have to call by string name too or we won't protect them. But this is a trivial change.

@laniehei
Copy link
Member

maybe related? 🙃 #425

@cretz
Copy link
Member Author

cretz commented Dec 20, 2021

After discussion, the better handling of this issue is to qualify the alias. Will probably close this and do that when this issue is tackled.

@cretz
Copy link
Member Author

cretz commented Jan 6, 2022

This is also happening during test suites in surprising ways. Take this example:

env.RegisterWorkflowWithOptions(somepkg.MyWorkflow, workflow.RegisterOptions{ Name: "MyCustomName" })
env.ExecuteWorkflow(someotherpkg.MyWorkflow, "foo", "bar")

Even though ExecuteWorkflow attempts implicit register, it silently ignores as expected if already registered. The ExecuteWorkflow actually tries to execute the registered one due to the alias which is very confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants