-
Notifications
You must be signed in to change notification settings - Fork 241
Prepare 2.37.0-alpha.1 release #1450
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
Conversation
c638524 to
94ce60b
Compare
meta/meta.go
Outdated
| // Deprecated: Use Go standard library [runtime/debug] package build information | ||
| // instead. | ||
| var SDKVersion = "2.36.1" | ||
| var SDKVersion = "2.37.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe our CI should do this for us? Not sure about the pre-release portion: 9a1ad1d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, neat, I did not know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it looks like it probably won't update pre-release 😆 , not sure exactly who is using this and where, might not be a big deal ATM
terraform-plugin-sdk/.github/workflows/release.yml
Lines 59 to 81 in 9eb7da0
| meta-version: | |
| needs: changelog-version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| # Default input is the SHA that initially triggered the workflow. As we created a new commit in the previous job, | |
| # to ensure we get the latest commit we use the ref for checkout: 'refs/heads/<branch_name>' | |
| ref: ${{ github.ref }} | |
| # Avoid persisting GITHUB_TOKEN credentials as they take priority over our service account PAT for `git push` operations | |
| # More details: https://github.com/actions/checkout/blob/b4626ce19ce1106186ddf9bb20e706842f11a7c3/adrs/0153-checkout-v2.md#persist-credentials | |
| persist-credentials: false | |
| - name: Update meta package SDKVersion | |
| run: sed -i "s/var SDKVersion =.*/var SDKVersion = \"${{ needs.changelog-version.outputs.version }}\"/" meta/meta.go | |
| - name: Git push meta | |
| run: | | |
| git config --global user.name "${{ vars.TF_DEVEX_CI_COMMIT_AUTHOR }}" | |
| git config --global user.email "${{ vars.TF_DEVEX_CI_COMMIT_EMAIL }}" | |
| git add meta/meta.go | |
| git commit -m "Update meta package SDKVersion" | |
| git push "https://${{ vars.TF_DEVEX_CI_COMMIT_AUTHOR }}:${{ secrets.TF_DEVEX_COMMIT_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the contributing docs then once we know what'll happen with the pre-release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line actually might be a problem:
| run: sed -i "s/var SDKVersion =.*/var SDKVersion = \"${{ needs.changelog-version.outputs.version }}\"/" meta/meta.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not entirely sure what'll end up in changelog-version.outputs.version but I highly suspect the pre-release identifier might be part of it 🤨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh damn, Github didn't show your comment 😂 So it now seems like I ignored what you said..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's one data point -- a search across official provider repos. Two providers use this in a user-agent string, which seems fine.
$ ag meta\.SDKVersion $(ag -l SDKVersion | grep -v vendor)
terraform-provider-azuread/internal/common/client_options.go
109: tfUserAgent := fmt.Sprintf("HashiCorp Terraform/%s (+https://www.terraform.io) Terraform Plugin SDK/%s", o.TerraformVersion, meta.SDKVersionString()) //nolint:staticcheck
terraform-provider-azurestack/internal/common/client_options.go
62: tfUserAgent := fmt.Sprintf("HashiCorp Terraform/%s (+https://www.terraform.io) Terraform Plugin SDK/%s", tfVersion, meta.SDKVersionString())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a commit that fixes the action nevertheless – who knows what else is happening out there 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! I had not seen the existing var SDKPrerelease.
5b27eee to
c9d373c
Compare
| sed -i "s/var SDKVersion =.*/var SDKVersion = \"${{ needs.changelog-version.outputs.version_only }}\"/" meta/meta.go | ||
| sed -i "s/var SDKPrerelease =.*/var SDKPrerelease = \"${{ needs.changelog-version.outputs.prerelease }}\"/" meta/meta.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly.... I'm wondering if we should just include the full version in SDKVersion and then the SDKPrerelease as the separated portion..
Because the SDKVersion shouldn't be v2.37.0 when we release this, it should really be v2.37.0-alpha.1. I don't think SDKPrerelease is super useful given that context, but since it exists, probably best to keep it up to date 😆
So when we release I think it'd make sense to be:
var SDKVersion = "v2.37.0-alpha.1"
var SDKPrerelease = "alpha.1"Rather than:
var SDKVersion = "v2.37.0"
var SDKPrerelease = "alpha.1"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess maybe not because most of @bbasata's examples are using the SDKVersionString() instead, so it'd improperly format it then.... It's annoying these variables are exposed if we don't want people to reference them 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess also, all of this is deprecated anyways, so it doesn't really matter 🤷🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with prioritizing SDKVersionString() correctness. This is consistent with the doc comment for SDKVersion: The main version number that is being run at the moment.
75bd7e3 to
9d44cf6
Compare
|
💭 Future consideration: could we use (OK, someone has been reading about |
I'd love such a PR! |
Updated the file as per theCONTRIBUTING.mdguide (at the very bottom)Adds support for pre-releases to Github Action