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

chore(ci): skip mapping errors when upgrading the Terraform provider #209

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

ctreatma
Copy link
Contributor

@ctreatma ctreatma commented Oct 3, 2024

Pretty much every time we upgrade the upstream Terraform provider, the upgrade fails due to one of the following:

  • Addition or removal of a resource/data source
  • Changes to examples

As a result we are, in practice, doing a manual upgrade of the Pulumi provider for almost every release of the Terraform provider. Those manual upgrade PRs also end up being overly large and difficult to review because they also include changes to add or remove features in parity with the upstream provider, and possibly-accidental upgrades of surrounding tooling.

This updates the upgrade-provider GitHub Actions workflow to define environment variables that make the provider upgrade process more resilient to upstream changes. The script to generate examples is also updated so that issues with example conversion result in missing examples rather than a failed upgrade.

The intent of these changes is to enable automation to do its job as well as possible, and allow follow-up contributions to focus narrowly on fixing examples or adding/removing resources.

@ctreatma
Copy link
Contributor Author

ctreatma commented Oct 3, 2024

For some reason the changes to the example script are not having the same effect in CI that they do locally. Manually running the upgrade job on this branch fails, but when I run what I think are the equivalent commands locally, it succeeds. I had been running the ./upstream.sh ... commands to update the submodule, followed by make tfgen, and that succeeded. When I instead installed and ran upgrade-provider, it failed but in a slightly different place than it does in CI.

I see some kind of repo checkout happening during upgrade-provider execution; does that command use scripts and/or Makefile from the main branch rather than using the local files?

Copy link

github-actions bot commented Oct 3, 2024

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 ctreatma requested a review from ocobles October 3, 2024 19:13
@ocobles
Copy link
Contributor

ocobles commented Oct 9, 2024

For some reason the changes to the example script are not having the same effect in CI that they do locally. Manually running the upgrade job on this branch fails, but when I run what I think are the equivalent commands locally, it succeeds. I had been running the ./upstream.sh ... commands to update the submodule, followed by make tfgen, and that succeeded. When I instead installed and ran upgrade-provider, it failed but in a slightly different place than it does in CI.

I see some kind of repo checkout happening during upgrade-provider execution; does that command use scripts and/or Makefile from the main branch rather than using the local files?

Yes it checkouts to main branch

pull default branch
✓ /usr/local/bin/git ls-remote --heads origin: done
✓ finding default branch: master
✓ /usr/local/bin/git checkout master: done
✓ /usr/local/bin/git pull origin: done

Copy link
Contributor

@ocobles ocobles left a comment

Choose a reason for hiding this comment

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

nice! while checking PULUMI_SKIP_MISSING_MAPPING_ERROR / PULUMI_SKIP_EXTRA_MAPPING_ERROR documentation I learned about this option https://github.com/pulumi/pulumi-terraform-bridge/blob/master/docs/autofill.md which can be useful for us too

@ocobles
Copy link
Contributor

ocobles commented Oct 9, 2024

It's also worth mentioning that it seems now there is more control over how examples are generated by default, perhaps by making some changes to Terraform, the script to generate examples is not needed at all.

@ctreatma ctreatma merged commit 7525edd into main Oct 9, 2024
17 of 19 checks passed
@ctreatma ctreatma deleted the skip_mapping_errors branch October 9, 2024 18:28
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.

2 participants