Skip to content

feat(enterprise): add ready for handshake support to pgcoord #12935

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

Merged

Conversation

coadler
Copy link
Contributor

@coadler coadler commented Apr 10, 2024

No description provided.

Copy link
Contributor Author

coadler commented Apr 10, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @coadler and the rest of your teammates on Graphite Graphite

@coadler coadler force-pushed the colin/feat_enterprise_add_ready_for_handshake_support_to_pgcoord branch 4 times, most recently from c40f0ab to 2dc196c Compare April 10, 2024 22:13
Base automatically changed from colin/feat_add_agent_acks_to_in-memory_coordinator to main April 10, 2024 22:15
@coadler coadler force-pushed the colin/feat_enterprise_add_ready_for_handshake_support_to_pgcoord branch 3 times, most recently from ce96564 to d7f72a8 Compare April 10, 2024 22:35
@coadler coadler marked this pull request as ready for review April 10, 2024 22:41
@coadler coadler requested a review from spikecurtis April 10, 2024 22:46
@@ -207,6 +207,12 @@ FROM tailnet_tunnels
INNER JOIN tailnet_peers ON tailnet_tunnels.src_id = tailnet_peers.id
WHERE tailnet_tunnels.dst_id = $1;

-- name: PublishReadyForHandshake :exec
SELECT pg_notify(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this a query instead of pubsub.Publish()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It made it easy to mock the call, and in the no-permission test make sure it wasn't being called

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not necessary anymore with your changes tho 👍

"github.com/coder/coder/v2/testutil"
)

func TestPGCoordinatorDual_ReadyForHandshake_OK(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@coadler coadler requested a review from spikecurtis April 11, 2024 23:38
Copy link
Contributor

@spikecurtis spikecurtis left a comment

Choose a reason for hiding this comment

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

LGTM!

I made some inline comments about a few leftovers that can get cleaned up, but I don't need to review again.

require.NoError(t, err)
defer coord1.Close()

agpltest.ReadyForHandshakeTest(ctx, t, coord1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice structure & code reuse

@coadler coadler force-pushed the colin/feat_enterprise_add_ready_for_handshake_support_to_pgcoord branch from ba97700 to 1f0282d Compare April 16, 2024 18:56
@coadler coadler force-pushed the colin/feat_enterprise_add_ready_for_handshake_support_to_pgcoord branch from 1f0282d to b2fc817 Compare April 16, 2024 19:49
@coadler coadler merged commit 777dfbe into main Apr 16, 2024
27 of 43 checks passed
@coadler coadler deleted the colin/feat_enterprise_add_ready_for_handshake_support_to_pgcoord branch April 16, 2024 20:01
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants