Skip to content

Fix local builds that use cache or additional command flags - #103

Merged
AndyTitu merged 4 commits into
protocol-v3from
andi_t/fix-local-build-rpc-issues
Dec 13, 2022
Merged

AndyTitu merged 4 commits into
protocol-v3from
andi_t/fix-local-build-rpc-issues

Conversation

@AndyTitu

@AndyTitu AndyTitu commented Dec 12, 2022 •

Copy link
Copy Markdown
Contributor

Related issue: #90

Why

The Cache and CommandLine field were left nil in the provision output response. This caused panics for both plugins using Cache and plugins using additional command flags.

Actually, the desired response of the RPC call should be the ProvisionOutput exactly as it was passed down from OP (as @Marton6 noted), but for a certain reason the fields of the pointer argument (output) of the call were nullified. (were brought to their zero values).

What

this MR:

  • adds a ProvisionOutput field to the ProvisionCredentialRequest., and uses it as response of the RPC call
  • adds functionality for catching a panic from a locally built plugin and outputting it before the OP panic is reached, so that the OP panic doesn't mask the true cause of the problem.
@AndyTitu
AndyTitu requested a review from Marton6 December 12, 2022 16:37
@AndyTitu AndyTitu self-assigned this Dec 12, 2022

@Marton6 Marton6 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have a small suggestion about the messaging around panics. Otherwise this PR looks good to me.

Comment thread sdk/rpc/server/server.go Resolved
Comment thread sdk/rpc/server/server.go Resolved
Comment thread sdk/rpc/server/server.go Resolved
@hculea

hculea commented Dec 13, 2022

Copy link
Copy Markdown
Member

Let's also tackle DeprovisionOutput within this MR, shall we?

@jpcoenen

jpcoenen commented Dec 13, 2022 •

Copy link
Copy Markdown
Member

Let's also tackle DeprovisionOutput within this MR, shall we?

Yes, same for ImportOutput.

@AndyTitu

Copy link
Copy Markdown
Contributor Author

Let's also tackle DeprovisionOutput within this MR, shall we?

Yes, same for ImportOutput.

Done!

@jpcoenen
jpcoenen changed the base branch from main to protocol-v3 December 13, 2022 11:22
@jpcoenen

Copy link
Copy Markdown
Member

Changed the base branch to protocol-v3.

@jpcoenen
jpcoenen force-pushed the protocol-v3 branch 2 times, most recently from 881b61a to 52efef5 Compare December 13, 2022 11:26
@jpcoenen

Copy link
Copy Markdown
Member

I'm also going to rebase this branch onto protocol-v3. The current diff is a mess.

@jpcoenen
jpcoenen force-pushed the andi_t/fix-local-build-rpc-issues branch from 40d69a6 to 5e64d1d Compare December 13, 2022 11:34
Comment thread sdk/rpc/server/server.go Resolved
@SimonBarendse SimonBarendse changed the title Fix RPC error Dec 13, 2022
@AndyTitu
AndyTitu merged commit a921198 into protocol-v3 Dec 13, 2022
@AndyTitu
AndyTitu deleted the andi_t/fix-local-build-rpc-issues branch December 13, 2022 12:07
@AndyTitu

Copy link
Copy Markdown
Contributor Author

For reference, Horia and I functionally tested this for both mysql and aws plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants