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: Upgrade terraform-provider-equinix to v2.3.3 #161

Conversation

github-actions[bot]
Copy link

This PR was generated via $ upgrade-provider equinix/pulumi-equinix --kind=provider --target-bridge-version=latest --pr-assign=ctreatma --pr-title-prefix=feat: --java-version=0.14.0.


  • Updating Java Gen version to 0.14.0.
  • Upgrading terraform-provider-equinix from 2.3.2 to 2.3.3.

Copy link
Contributor

@ctreatma ctreatma left a comment

Choose a reason for hiding this comment

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

Checked this out locally, ran make only_tfgen and I ended up with uncommitted changes to schema.json, so it looks like the change to the generate_examples task dependencies didn't to the trick.

@ctreatma
Copy link
Contributor

This PR was created by the following GitHub Actions workflow run: https://github.com/equinix/pulumi-equinix/actions/runs/10477317351

Unfortunately, everything interesting happens under the hood of the upgrade-provider command, and I don't see any useful info in that workflow run output.

@ctreatma
Copy link
Contributor

I suspect that Make is deduplicating dependencies for the tfgen task and only running build_schema once, in which case we need to be more explicit/forceful in running build_schema after examples are generated. One option is:

generate_examples: examples
    make build_schema

Since this is really needed for the tfgen task, though, we should also be able to do this, which is maybe clearer:

tfgen: only_tfgen generate_examples
    make build_schema

@ocobles
Copy link
Contributor

ocobles commented Aug 21, 2024

Indeed it was only running build_schema once. Below code fixes the issue:

only_tfgen: install_plugins upstream build_schema
tfgen: only_tfgen generate_examples

# Generate examples after the schema is generated
generate_examples: examples build_schema_post_examples

# Build the tfgen binary and generate the schema
build_schema build_schema_post_examples: $(PULUMICTL_BIN)
build_schema build_schema_post_examples:
	(cd provider && go build -o $(WORKING_DIR)/bin/${TFGEN} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${TFGEN})
	$(WORKING_DIR)/bin/${TFGEN} schema --out provider/cmd/${PROVIDER}
	(cd provider && VERSION=$(VERSION) go generate cmd/${PROVIDER}/main.go)

@ocobles
Copy link
Contributor

ocobles commented Aug 21, 2024

Changes introduced in a2c1875

  • duplicate build_schema target (build and build_schema_post_examples) to be able to execute it twice (it didn't work even adding build_schema in PHONY). I was debugging leaving some traces to check that now it is executed twice, as expected.
  • Check that the pulumi cli installed version is the same as the one defined in provider/go.mod
  • Add export PATH := $(BIN_DIR):$(PATH). The pulumi converter command uses several plugins, on the one hand the source converter (yaml and terraform plugins in our case) and on the other hand the sdk of the language to which it is being converted, pulumi-language-python / pulumi-language-go / etc. Although the correct Pulumi CLI binary was being used with .pulumi/bin/pulumi convert ... it was taking the language binary from $PATH, so in my case /opt/homebrew/bin/ which corresponded to the Pulumi v3.122.0 version instead of the new installed v3.128.0

Copy link
Author

Does the PR have any schema changes?

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

Maintainer note: consult the runbook for dealing with any breaking changes.

@ctreatma
Copy link
Contributor

Let's not modify this PR. This is our opportunity to ensure that the updates we're making to the workflows work, so we should make adjustments in separate PRs and then re-run the upgrade provider workflow to validate those changes. (Validation will require checking out the automated PR locally and running make only_tfgen to confirm that no uncommitted changes are produced by that task after the ugprade.

ocobles added a commit that referenced this pull request Aug 21, 2024
Changes:
- duplicate build_schema target (build and build_schema_post_examples)
to be able to execute it twice (it didn't work even adding build_schema
in PHONY). I was debugging leaving some traces to check that now it is
executed twice, as expected.
- Check that the pulumi cli installed version is the same as the one
defined in provider/go.mod
- Add `export PATH := $(BIN_DIR):$(PATH)`. The pulumi converter command
uses several plugins, on the one hand the source converter (yaml and
terraform plugins in our case) and on the other hand the sdk of the
language to which it is being converted, pulumi-language-python /
pulumi-language-go / etc. Although the correct Pulumi CLI binary was
being used with `.pulumi/bin/pulumi convert ...` it was taking the
language binary from $PATH, so in my case `/opt/homebrew/bin/` which
corresponded to the Pulumi v3.122.0 version instead of the new installed
v3.128.0

_Originally added to #161
and opening a new PR as per
#161 (comment)
suggestion_
@ctreatma
Copy link
Contributor

Workflow changes were made in #164 and the upgrade provider workflow will produce a new PR the next time it runs. Closing this one.

@ctreatma ctreatma closed this Aug 21, 2024
@ctreatma ctreatma deleted the upgrade-terraform-provider-equinix-to-v2.3.3-47808339 branch August 21, 2024 14:52
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.

3 participants