Skip to content

Conversation

@yevgenypats
Copy link
Contributor

@yevgenypats yevgenypats commented Jun 18, 2023

blocked by: https://github.com/cloudquery/plugin-pb-go/pull/16/files

Adds the following changes as pre-requirements that we can roll now and before migrating plugins to SDK V3:

  • merge managedplugin code (from managedsourceplugin and manageddestinationplugin - now located at plugin-pb-go)
  • decouple CLI config/spec from the one that is being sent over the wire to the SDK in protocol V1/V2. This is crucial requirement to be able to support multiple SDK versions. Also, this is a requirement for us to be able to introduce deprecation to config options and being able to print necessary warnings in the CLI.

BEGIN_COMMIT_OVERRIDE
fix(deps): Update github.com/cloudquery/plugin-pb-go to v1.1.0

END_COMMIT_OVERRIDE

@cq-bot cq-bot added the cli label Jun 18, 2023
@yevgenypats yevgenypats requested a review from hermanschaaf June 19, 2023 10:59
return fmt.Errorf("failed to get source versions: %w", err)
}
maxVersion := findMaxVersion(versions)
if maxVersion >= 3 {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be if maxVersion <= 3? Or am I missing something 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Oh no sorry, I get it now; it makes sense. This is when the source is using a newer protocol than the CLI supports.

Copy link
Member

Choose a reason for hiding this comment

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

But in that case, if the source supported older versions, why don't we use them rather than only using the max?

Copy link
Member

@erezrokah erezrokah Jun 19, 2023

Choose a reason for hiding this comment

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

I'm also not sure how this works as the switch below only handles versions 2 and 1 (errors on 0 and default)

Copy link
Member

Choose a reason for hiding this comment

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

@erezrokah Yeah I think this PR is not intended to handle SDK v3 yet; is that right @yevgenypats ? We may just want to update the title and description of this PR to make it clear this is mostly a refactor. Or are there any user-facing changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I updated the title to refactor and removed v4. The only user facing change is that this CLI doesn't support an old version for sources which I dropped (source_v0). Once we move to single plugin protocol we can also have a schedule of how long we support a given protocol so we have a phase where we introduce a new protocol, add deprecation notice and then remove an old protocol support from the CLI. In any case users still can use an old version of the CLI.

Co-authored-by: Herman Schaaf <[email protected]>
@yevgenypats yevgenypats changed the title feat: CLI V4 refactor(cli): Update to managedplugin and decouple CLI config from proto Jun 19, 2023
@yevgenypats yevgenypats added the automerge Automatically merge once required checks pass label Jun 19, 2023
return fmt.Errorf("destination %s is used by multiple sources %s with different versions", destination, source.Path)
}
}
}
Copy link
Member

@hermanschaaf hermanschaaf Jun 20, 2023

Choose a reason for hiding this comment

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

Is this validation step a new addition? I don't quite understand what it's doing / why we can't allow different source versions to use the same destination

Copy link
Member

Choose a reason for hiding this comment

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

Looks like it's not new in any case; but I'm still curious why it exists 😄

@kodiakhq kodiakhq bot merged commit 333e122 into main Jun 20, 2023
@kodiakhq kodiakhq bot deleted the feat/cli_v4 branch June 20, 2023 08:30
yevgenypats added a commit that referenced this pull request Jun 27, 2023
we were exiting instead of continuing on migrating for multiple sources.
Introduced here #11655
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants