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

Move version out of SDK. #14229

Merged
merged 22 commits into from Dec 7, 2022
Merged

Move version out of SDK. #14229

merged 22 commits into from Dec 7, 2022

Conversation

ncabatoff
Copy link
Collaborator

@ncabatoff ncabatoff commented Feb 23, 2022

The goal of this work is to simplify our release process so that we don't have to update the version in sdk, then update go.mod to pull in the new sdk version. Instead we put the version into the vault package itself.

The reason it was in the sdk was I think to allow plugins to have access to it. But that was wrongheaded: external plugins shouldn't be reporting the vault version they were built with as the vault version of the cluster, and builtin plugins are built with vault and thus don't need to go through the sdk to get the vault version. I've tried to make it so that regardless of the plugin type, they can get the correct vault version of the cluster to put into their user-agent string. This requires that they use the useragent.PluginString method instead of useragent.String. Followup work to modify plugins we own to do that is still needed.

…rt not addressed by this

change is sdk/helper/useragent.String, which we'll want to deprecate in favour of PluginString.
@kalafut
Copy link
Contributor

kalafut commented Mar 2, 2022

Seems about right (aside from needing a run of gofumpt)

@calvn
Copy link
Member

calvn commented Mar 3, 2022

It looks like vault-plugin-auth-azure uses sdk/useragent.

@kalafut kalafut removed their request for review May 6, 2022 00:31
# Conflicts:
#	command/agent.go
#	command/debug.go
#	command/operator_diagnose.go
#	command/server.go
#	sdk/framework/backend.go
#	sdk/framework/openapi_test.go
#	sdk/framework/path.go
…p updating the old sdk version and start updating the new non-sdk equivalent.
@ncabatoff ncabatoff marked this pull request as ready for review November 3, 2022 14:01
@ncabatoff ncabatoff requested a review from a team November 3, 2022 14:01
Copy link
Contributor

@swenson swenson left a comment

Choose a reason for hiding this comment

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

I think this looks good. I also have concerns about useragent, but we should be able to resolve that I think. (Could be in a subsequent PR.)

@@ -31,6 +31,15 @@ var (
// Given comments will be appended to the semicolon-delimited comment section.
//
// e.g. Vault/0.10.4 (+https://www.vaultproject.io/; go1.10.1; comment-0; comment-1)
//
// Deprecated: use PluginString instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

I vote for we rip the band-aid off and delete this function, the variables above, and the reference above to sdk/version, and bump the major version of sdk.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or just replace it with PluginString() below, and then we don't have to bump the sdk version.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to replacing with PluginString

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How do you mean replace it? They have different arguments.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I missed that. It looks like it will be non-trivial to replace some usages (like in agent). When I first looked I thought this function was mostly unused in our code base. Nevermind.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What difficulty do you see with modifying agent?

Copy link
Contributor

Choose a reason for hiding this comment

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

At a glance, I don't see a logical.PluginEnvironment in the agent to pass to PluginString().

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We spoke on slack, Chris's agent comment was re the idea of removing String(). But Since agent lives within the vault package, it now uses the internal useragent helper rather than sdk's, so that's not actually an impediment.

I'm starting to come around to the idea of removing useragent.String from the sdk. I don't think we actually need to bump the major since we're pre-1.0. Or do you mean going from v0.6 to v0.7?

Copy link
Contributor

Choose a reason for hiding this comment

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

Bumping from 0.6 to 0.7 is what I meant.

Copy link
Contributor

@swenson swenson left a comment

Choose a reason for hiding this comment

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

LGTM; minor comments

sdk/logical/testing.go Outdated Show resolved Hide resolved
scripts/build.sh Show resolved Hide resolved
# Conflicts:
#	http/sys_seal_test.go
command/agent/auth/azure/azure.go Outdated Show resolved Hide resolved
physical/gcs/gcs.go Outdated Show resolved Hide resolved
physical/spanner/spanner.go Outdated Show resolved Hide resolved
@ncabatoff ncabatoff merged commit 35df948 into main Dec 7, 2022
@ncabatoff ncabatoff deleted the move-version-out-of-sdk branch December 7, 2022 18:30
AnPucel pushed a commit that referenced this pull request Jan 14, 2023
Move version out of SDK.  For now it's a copy rather than move: the part not addressed by this change is sdk/helper/useragent.String, which we'll want to remove in favour of PluginString.  That will have to wait until we've removed uses of useragent.String from all builtins.
jayant07-yb pushed a commit to jayant07-yb/hashicorp-vault-integrations that referenced this pull request Mar 15, 2023
Move version out of SDK.  For now it's a copy rather than move: the part not addressed by this change is sdk/helper/useragent.String, which we'll want to remove in favour of PluginString.  That will have to wait until we've removed uses of useragent.String from all builtins.
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.

None yet

6 participants