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

feat: added underlying terraform provider version to readme #342

Merged
merged 2 commits into from
Oct 31, 2023

Conversation

Maed223
Copy link
Contributor

@Maed223 Maed223 commented Sep 1, 2023

Fixes: hashicorp/terraform-cdk#2680

Includes underlying provider version in README as read from src/version.json.

Side benefit of this is using the actual underlying provider version to build the link to the terraform registry, instead of an approximate version as before.

Found there to be some ambiguity around when/if src/version.json would be present as you can see here:

    // set provider name and version from version.json (if it exists yet)
    const versionFile = path.resolve(project.outdir, "src/version.json");

    let fullyQualifiedProviderName = "<unknown>";
    let actualProviderVersion = "<unknown>";
    if (existsSync(versionFile)) {
      const map = JSON.parse(readFileSync(versionFile, "utf8"));
      if (Object.keys(map).length !== 1) {
        throw new Error(
          "version.json must have exactly one entry. specifying multiple providers is not supported"
        );
      }
      const [fqpn, version] = Object.entries(map)[0];
      fullyQualifiedProviderName = fqpn;
      actualProviderVersion = version as string;
    }

As such I've made sure to default to the current state of the README is the event it isn't present.

@Maed223 Maed223 requested a review from a team as a code owner September 1, 2023 19:52
@Maed223 Maed223 requested review from ansgarm and DanielMSchmidt and removed request for a team September 1, 2023 19:52
@Maed223 Maed223 merged commit 1bed33d into main Oct 31, 2023
6 checks passed
@Maed223 Maed223 deleted the underlying-provider-version-in-readme branch October 31, 2023 12:46
Copy link

github-actions bot commented Nov 8, 2023

I'm going to lock this pull request because it has been closed for at least 7 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue so we can investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it easier to figure out the underlying provider version for pre-built provider packages
2 participants