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

command/version: Report the current platform #26975

Merged
merged 2 commits into from
Nov 19, 2020
Merged

Conversation

apparentlymart
Copy link
Contributor

Along with all of the other information we previously reported in the terraform version output, we'll now include the name of the current platform as our provider installation mechanisms represent it.

This is addressing a long-standing minor annoyance where we sometimes can't tell from an incomplete bug report which platform Terraform was running on, and incomplete bug reporters do tend to at least include the requested terraform version output even if they don't also include the requested full trace log.

However, what motivated doing this now is that anyone building a provider registry or mirror needs to have some awareness of these platform identifiers which have been, until v0.13, mostly an implementation detail. This additional information is a small thing we can do to help registry builders (or folks publishing providers for more esoteric platforms) find out what the platform identifier ought to be for each of the platforms they aim to support, even if some of them are platforms which the Go compiler allows but which HashiCorp doesn't officially support.

The new information is on a line of its own in the output as a pragmatic way to avoid breaking anyone who might be using something like $(terraform version | head -n1) to print a brief Terraform version identifier into some logs. That's not an interface we officially support for machine consumption, but it's easy to avoid breaking it here and so we won't do so. (If you do want an interface for machine consumption, use terraform version -json instead.)

Terraform v0.15.0-dev
on linux_amd64
+ provider registry.terraform.io/apparentlymart/testing v0.0.2
+ provider registry.terraform.io/hashicorp/azurerm v2.1.0
+ provider registry.terraform.io/hashicorp/null v3.0.0
+ provider registry.terraform.io/newrelic/newrelic v2.1.2
{
  "terraform_version": "0.15.0-dev",
  "terraform_revision": "",
  "platform": "linux_amd64",
  "provider_selections": {
    "registry.terraform.io/apparentlymart/testing": "0.0.2",
    "registry.terraform.io/hashicorp/azurerm": "2.1.0",
    "registry.terraform.io/hashicorp/null": "3.0.0",
    "registry.terraform.io/newrelic/newrelic": "2.1.2"
  },
  "terraform_outdated": false
}

While I was working on this I also noticed that we forgot to update the version package to report the current development as being 0.15.0, so there's another commit in this PR to update that.

Along with all of the other information we previously reported in the
"terraform version" output, we'll now include the name of the current
platform as our provider mechanisms represent it.

This is addressing a long-standing minor annoyance where we often can't
tell from an incomplete bug report which platform Terraform was running
on, and incomplete bug reporters do tend to at least include the
"terraform version" output even if they don't also include the requested
full trace log.

However, what motivated doing it _now_ is that anyone building a provider
registry or mirror needs to have some awareness of these platform
identifiers which have been, until v0.13, mostly an implementation detail.
This additional information is a small thing we can do to help registry
builders find out what the platform identifier ought to be for each of
the platforms they aim to support, even if some of them are platforms
which the Go compiler allows but which HashiCorp doesn't officially
support.

The new information is on a line of its own in the output as a pragmatic
way to avoid breaking anyone who might be using something like
$(terraform version | head -n1) to print a brief Terraform version
identifier into some logs. That's not an interface we officially support
for machine consumption, but it's easy to avoid breaking it here and so we
won't do so.
@codecov
Copy link

codecov bot commented Nov 18, 2020

Codecov Report

Merging #26975 (76cd9eb) into master (b8d448d) will decrease coverage by 0.00%.
The diff coverage is 66.66%.

Impacted Files Coverage Δ
commands.go 0.67% <0.00%> (-0.01%) ⬇️
command/version.go 69.73% <100.00%> (+0.81%) ⬆️
terraform/node_resource_plan.go 95.28% <0.00%> (-1.89%) ⬇️
terraform/evaluate.go 52.89% <0.00%> (-0.42%) ⬇️

@apparentlymart apparentlymart merged commit 0a596d2 into master Nov 19, 2020
@apparentlymart apparentlymart deleted the f-version-platform branch November 19, 2020 22:15
@ghost
Copy link

ghost commented Dec 20, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants