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

Rebuild on ci-mgmt #135

Merged
merged 7 commits into from
Nov 12, 2024
Merged

Rebuild on ci-mgmt #135

merged 7 commits into from
Nov 12, 2024

Conversation

danielrbradley
Copy link
Member

@danielrbradley danielrbradley commented Nov 6, 2024

Related to: https://github.com/pulumi/home/issues/3644

Leverage pulumi/ci-mgmt/provider-ci for generating the makefile and GitHub workflows so we don't have to maintain a separate set in the boilerplate. We will onboard this repo to the automated ci-mgmt nightly push process to keep this repo up-to-date with changes. This also makes it easier for consumers of the boilerplate to stay up-to-date with CI and build changes we're making internally by running make ci-mgmt rather than having to mainting all parts of the build after forking the repo.

Use our internal "xyz provider" in the boilerplate as a more real test which is a working provider which can be used for testing. The plan is to test the initialization script by regularly re-initializing our internal pulumi-xyz repo from this boilerplace to ensure it still produces a functional provider.

Improve the automated replacement of the provider name by splitting out a new setup.sh script (instead of being a custom make prepare target) which provides inline documentation, interactive prompting, verbose logging and error line numbers for debugging issues. This can also be more easily extended to handle additional aspects such as the location of the provider module and any required internal module shimming.

@danielrbradley danielrbradley self-assigned this Nov 6, 2024
Copy link

github-actions bot commented Nov 6, 2024

Does the PR have any schema changes?

Found 1 breaking change:

Functions

  • 🔴 "xyz:index/dataSource:DataSource" missing

New functions:

  • index/getDataSource.getDataSource

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

@danielrbradley danielrbradley marked this pull request as ready for review November 7, 2024 13:40
Copy link
Member

@mjeffryes mjeffryes left a comment

Choose a reason for hiding this comment

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

I think this is a step in the right direction, but bringing the whole bridged provider boilerplate over is quite a lot. I'm concerned that we leave users enough information to operate all the workflows and I think we need a clear message on whether they should try to keep up to date with out ci-mgmt. I'm worried that if users try to stay up on latest ci-mgmt, we'll end up breaking them regularly. But of course all these workflows tell you not to edit them since they are managed by ci-mgmt.

Also had the idea that maybe we can have a test initialization in pulumiverse as well as testing that we can recreate pulumi-xyz. That would help us validate that we don't break things for non-pulumi orgs.

.github/ISSUE_TEMPLATE/bug.yaml Outdated Show resolved Hide resolved
.github/ISSUE_TEMPLATE/epic.md Outdated Show resolved Hide resolved
.github/workflows/prerelease.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/publish.yml Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
init.sh Outdated Show resolved Hide resolved
provider/resources.go Outdated Show resolved Hide resolved
provider/resources.go Outdated Show resolved Hide resolved
init.sh Outdated Show resolved Hide resolved
init.sh Outdated Show resolved Hide resolved
@danielrbradley
Copy link
Member Author

danielrbradley commented Nov 11, 2024

I've made significant progress on finishing up refining the documentation. This achieves the aim of leveraging ci-mgmt for the boilerplate which means we can focus on making improvements in ci-mgmt and they'll naturally flow into the repo too.

Once this is merged, we'll onboard this repo into the ci-mgmt nightly push process to keep it up to date.

I'd recommend also previewing how the instructions flow from this starting point: https://github.com/pulumi/pulumi-tf-provider-boilerplate/tree/rebuild-on-ci-mgmt?tab=readme-ov-file#terraform-bridge-provider-boilerplate

github-merge-queue bot pushed a commit to pulumi/ci-mgmt that referenced this pull request Nov 11, 2024
@danielrbradley danielrbradley requested review from guineveresaenger and removed request for ringods November 11, 2024 19:54
Copy link
Contributor

@guineveresaenger guineveresaenger left a comment

Choose a reason for hiding this comment

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

I love this!

To reduce noise and delineate these changes, is it possible to break this up into 3-4 separate PRs, or at least three commits that will not be squashed?

  1. Workflow generation
  2. New and improved examples
  3. New setup tooling + schemagen
  4. SDK generation (can be separate commit on xyz setup)

examples/examples_nodejs_test.go Show resolved Hide resolved
setup.sh Outdated Show resolved Hide resolved
sdk/dotnet/logo.png Outdated Show resolved Hide resolved
@danielrbradley
Copy link
Member Author

To reduce noise and delineate these changes, is it possible to break this up into 3-4 separate PRs, or at least three commits that will not be squashed?

Yup, can do a final rebase once the overall change looks good enough for an initial changeover. Will have a play with exactly how it can divide up.

These will be replaced with workflows provided by ci-mgmt in a later commit.
- Copy from the pulumi/pulumi-xyz provider repo.
- Respect schema version. This enables SDKs using the correct version of the provider plugin.
- Use pyproject.
- Add real configuration and types.
- Remove SDK dependencies where possible to let codegen pick its own dependencies.
- Update go module dependencies.
- Use defaults most appropriate for third parties which will still work for internal use too.
- Document the purpose of each option.
- Link to where to find all other options within the ci-mgmt defaults file.
Include usable SDKs in the repo for people exploring the expected structure.
- Add basic TS and Python example programs.
- Include useful default test setups which match our standard provider conventions (using tags etc).
- Add base options for all languages.
- Set `binPath` to avoid the user having to modify their global PATH.
- Skip all tests initially as the upstream provider doesn't have read, update or delete implemented so will fail the test.
Put the main documentation into SETUP.md so the README.md looks more like a normal provider, with just an additional lead paragraph explaining the project's purpose and linking to the SETUP.md

Use a standalone `setup.sh` script instead of a custom makefile target so it doesn't get overwritten by ci-mgmt updates.
- Make the script interactive by default to be more user-friendly.
- Allow the script to be run non-interactively (such as in CI for our own testing) via flags for inputs.
- `-v` enables verbose mode which prints all commands and evaluated conditions.
- On any error, print out a clear notification of failure including the originating line number.
@danielrbradley
Copy link
Member Author

This is now rebased into 7 meaningful chunks which we will preserve in the git history.

Copy link
Contributor

@guineveresaenger guineveresaenger left a comment

Choose a reason for hiding this comment

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

Thank you! Really appreciate the separate commits!

@danielrbradley danielrbradley merged commit 697ee89 into main Nov 12, 2024
20 checks passed
@danielrbradley danielrbradley deleted the rebuild-on-ci-mgmt branch November 12, 2024 20:43
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.

5 participants