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

Implement update/get worker build id commands #166

Merged
merged 14 commits into from
Jun 22, 2023
Merged

Conversation

Sushisource
Copy link
Member

Draft until temporalio/temporal#4086 is merged and I can get rid of my go.mod replace

What was changed

Added commands for updating and fetching worker-build-id compatibility sets on task queues.

Why?

New API!

Checklist

  1. Closes Implement CLI command for updating version sets #165

  2. How was this tested:
    Manually verified against new server

  3. Any docs updates needed?
    Yes. I'll be doing a docs PR as well.

@Sushisource Sushisource force-pushed the update-build-id-sets branch from 2334871 to ae08584 Compare March 22, 2023 23:51
headers/headers.go Outdated Show resolved Hide resolved
Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

@Sushisource can you please add tests?
We can use the built-in dev server for that.

Other than than the command structure LGTM.
I mostly focused on that, not on the implementation.

@feedmeapples feedmeapples self-requested a review March 28, 2023 02:34
@Sushisource Sushisource force-pushed the update-build-id-sets branch 2 times, most recently from 8509498 to 8ff72e6 Compare March 28, 2023 21:51
Comment on lines 29 to 43
portProvider := sconfig.NewPortProvider()
port := portProvider.MustGetFreePort()
portProvider.Close()
ctx, cancel := context.WithCancel(context.Background())
s.stopServerCancel = cancel

args, clientOpts := newServerAndClientOpts(port)

go func() {
if err := s.app.RunContext(ctx, args); err != nil {
fmt.Println("Server closed with error:", err)
}
}()

s.client = assertServerHealth(s.T(), ctx, clientOpts)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

It would require a compiled binary though.

Copy link
Contributor

Choose a reason for hiding this comment

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


// Update build id subcommand definitions
AddNewDefaultBuildIDDefinition = "Add a new default (incompatible) build ID to the Task Queue version sets."
AddNewDefaultBuildIDDefinitionUsage = "Creates a new build id set which will become the new overall default for the queue with the provided build id as its only member. This new set is incompatible with all previous sets/versions."
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
AddNewDefaultBuildIDDefinitionUsage = "Creates a new build id set which will become the new overall default for the queue with the provided build id as its only member. This new set is incompatible with all previous sets/versions."
AddNewDefaultBuildIDDefinitionUsage = "Creates a new build ID set which will become the new overall default for the queue with the provided build ID as its only member. This new set is incompatible with all previous sets/versions."

I would also see how this renders and consider adding line breaks.

Copy link
Member Author

Choose a reason for hiding this comment

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

Any semi-competent CLI flags library should be able to do this automatically (which this one maybe barely qualifies as lol). It looks like the one we're using has some kind of support for that: https://github.com/urfave/cli/pull/1119/files#diff-4d3f36d62cad94424544bb84fc93b33b73ffe3491a4ddca81a7f825539afc19cR1161-R1169

So we might consider doing that in another PR rather than manually inserting line breaks in a few places.

Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

Some usage examples would be great too @Sushisource but it already LGTM

@bergundy
Copy link
Member

We should avoid merging it though until the functionality exists on the server.

@Sushisource Sushisource force-pushed the update-build-id-sets branch 2 times, most recently from 10b034b to 264a56d Compare June 6, 2023 00:09
@Sushisource Sushisource force-pushed the update-build-id-sets branch 3 times, most recently from d1eb403 to ee019ab Compare June 16, 2023 22:49
@@ -105,3 +105,11 @@ func (s *buildIdCompatSuite) TestPromoteBuildIdInSet() {
"--build-id", "foo"))
s.Nil(err)
}

func (s *buildIdCompatSuite) TestReachability() {
Copy link
Member

Choose a reason for hiding this comment

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

Can we test the effect of this and not just that it doesn't return an error?

@Sushisource Sushisource force-pushed the update-build-id-sets branch from da2c64f to 6fb70d3 Compare June 22, 2023 16:53
@Sushisource Sushisource force-pushed the update-build-id-sets branch from 8c6f518 to 8e2e5f0 Compare June 22, 2023 19:00
@Sushisource Sushisource merged commit 20854b8 into main Jun 22, 2023
@Sushisource Sushisource deleted the update-build-id-sets branch June 22, 2023 19:27
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.

Implement CLI command for updating version sets
3 participants