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

Adding in additional header to determine a more stable isolation-group #1252

Merged
merged 13 commits into from
Jun 30, 2023

Conversation

davidporter-id-au
Copy link
Contributor

@davidporter-id-au davidporter-id-au commented May 31, 2023

What changed?

  • Adds a new header for downstream which is expected to be more stable to determine the origin of the worker
  • Repurposes the auth / identity wrapper a bit to shim this in there

Why?

How did you test it?

Potential risks

@@ -26,6 +26,8 @@ import (
"fmt"
"time"

"go.uber.org/cadence/internal/common/isolationgroup"
Copy link
Contributor

Choose a reason for hiding this comment

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

did you run go imports or go fmt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to, not entirely sure if/if there's still a format issue

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, neither go imports nor go fmt will not join import groups, so if you have them separated by a new line, they will still be in separate groups. Also, Goland's default behavior is to add imports in a new group separating with a new line, which is unfortunate. I think monorepo folks have recently introduced a change that should enforce imports to follow Go Uber style guide. We could adjust later on.

Copy link
Contributor

Choose a reason for hiding this comment

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

goimports might have a way to force that 🤔. if it does, I'd totally be in favor of it - special-case imports can still be commented, and if we have order-dependent imports then I'm happy to say "absolutely not, remove those init funcs and replace them with something sane"

internal/client.go Outdated Show resolved Hide resolved
@davidporter-id-au davidporter-id-au marked this pull request as ready for review June 14, 2023 01:10
internal/client.go Outdated Show resolved Hide resolved
}

func (w *workflowServiceIsolationGroupWrapper) ListDomains(ctx context.Context, request *shared.ListDomainsRequest, opts ...yarpc.CallOption) (*shared.ListDomainsResponse, error) {
opts = append(opts, w.getIsolationGroupIdentifier())
Copy link
Contributor

Choose a reason for hiding this comment

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

given how regular this pattern is, might be worth adopting gowrap to reduce minor mistakes now and in maintenance.

we already have it in the server, it'd be fairly easy to add here: https://github.com/uber/cadence/blob/e2a2a940030ec62a0749a4f4d8c86100305220c2/client/frontend/interface.go#L32

Copy link
Contributor

@Groxx Groxx left a comment

Choose a reason for hiding this comment

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

broadly: might be some stuff to clean up, but structurally sound I think. we already have wrappers, one more for another optional feature seems fine.

I'm not all that sold on these wrappers to begin with, but they're already here ¯\_(ツ)_/¯

davidporter-id-au and others added 2 commits June 28, 2023 18:54
- Rewrites test,
- Changes header to be consistent
@davidporter-id-au
Copy link
Contributor Author

broadly: might be some stuff to clean up, but structurally sound I think. we already have wrappers, one more for another optional feature seems fine.

I'm not all that sold on these wrappers to begin with, but they're already here ¯_(ツ)_/¯

I'm not going to investigate codegen in this PR, though it certainly feel's like it should have it at this point. Cleaned up the test though

Copy link
Contributor

@Groxx Groxx left a comment

Choose a reason for hiding this comment

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

yea, looks good. also 👍 for that name change, -zone is too context-specific and doesn't match the rest of the code.

@davidporter-id-au davidporter-id-au merged commit 58f9746 into master Jun 30, 2023
@davidporter-id-au davidporter-id-au deleted the feature/isolation-group branch June 30, 2023 18:42
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.

4 participants