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

Ability to select SDK languages #1063

Merged
merged 4 commits into from
Sep 10, 2024
Merged

Ability to select SDK languages #1063

merged 4 commits into from
Sep 10, 2024

Conversation

ringods
Copy link
Member

@ringods ringods commented Aug 28, 2024

Update Sep 9: dropped the enableAutoRelease from this PR. Will redo this as a separate PR.

Round 2 to add support for third-party providers:

  • Fix: Pass the configured organization to 2 more places where it is needed
  • languages (default: all supported languages): third party providers can configure a subset of the supported languages if they don't have the publishing infrastructure ready for all the languages. Changes:
    • changes the build matrix to only the set of configured languages
    • will install only the tools needed for the given value of the language matrix. Changed this because installing the Java tools failed when no Java SDK is available.
Screenshot 2024-08-28 at 15 00 07

The changes in this PR are focussed on the main workflow. Testing this on pulumiverse/pulumi-acme already got me this far:

https://github.com/pulumiverse/pulumi-acme/actions/runs/10596199445

Copy link
Member

@danielrbradley danielrbradley left a comment

Choose a reason for hiding this comment

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

Overall approach looks good. Need clarification on if the comment-dispatch change was accidental or if we need to adjust the settings name somehow.

Out of interest - why can't external providers run the auto-release hooks? Is it possible just to make this work for them too?

@@ -1,3 +1,4 @@
#{{- if .Config.enableAutoRelease -}}#
Copy link
Member

Choose a reason for hiding this comment

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

This seems a little odd - this workflow is about auto-commenting, not auto-releasing.

Copy link
Member

Choose a reason for hiding this comment

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

@ringods what was your thoughts here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this workflow is also pretty pulumi-specific and outside parties may want to enable and disable this, but the naming of the flag makes this confusing.

@ringods
Copy link
Member Author

ringods commented Aug 28, 2024

@danielrbradley AFAICS, the auto release setup depends on the Pulumi bot setup. If I want this to work for third party providers, I want to find a solution based on the standard github permissions: setting within a workflow. Can't solve everything at once unfortunately, so I chose to comment out more.

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 think with the enableAutoRelease flag it might make sense to add an external provider to the test-providers so we can see one in action?

@@ -1,3 +1,4 @@
#{{- if .Config.enableAutoRelease -}}#
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this workflow is also pretty pulumi-specific and outside parties may want to enable and disable this, but the naming of the flag makes this confusing.

@@ -75,6 +75,9 @@ freeDiskSpaceBeforeTest: false
# Set to true to clear disk space before running sdk build jobs.
freeDiskSpaceBeforeSdkBuild: false

# Enables the automatic release of the provider
enableAutoRelease: true
Copy link
Contributor

Choose a reason for hiding this comment

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

I love this flag; I think the terminology is a bit confusing. When I first read it, my thought was, "wait, what is auto release?"
I think your PR comment makes sesne as a code comment here.

enableAutoRelease (default: true): used for Pulumi, but typically not for third party providers. Changes:
- Disables the publish step of the main workflow
- Prevents generating repository dispatch workflows like command-dispatch and release-command

Further thoughts:
Could we call it "enablePublish" or even "skipPublish"? Would it make sense to have a global skipWorkflow flag to allow for maximum configurability?
We could even have a skipPulumiInternals switch since this is explicitly targeted at external users?

Copy link
Member Author

Choose a reason for hiding this comment

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

Earlier today, I had a short review call for this PR with @danielrbradley. To prevent adding a lot more configuration options to the setup, an alternative setup would be to create a separate template folder aimed at thirdparty bridged providers, reshuffle some files between the different folders and update generate.go here:

switch templateName {
case "bridged-provider":
// Render more specific templates last to allow them to override more general templates.
return []string{"provider", "dev-container", "bridged-provider"}, nil
default:
return nil, fmt.Errorf("unknown template: %s", templateName)
}

How does that sound to you?

@ringods ringods force-pushed the disable-autorelease branch from 649b65f to 9f270e3 Compare September 9, 2024 11:14
@ringods ringods changed the title Disable autorelease & ability to select SDK languages Ability to select SDK languages Sep 9, 2024
Changing `node` to `nodejs` in tool installation task
This brings consistency with the name of the language used in the GHA `language` build matrix
@ringods ringods force-pushed the disable-autorelease branch from 9f270e3 to 02bf75d Compare September 9, 2024 11:20
Copy link
Member

@danielrbradley danielrbradley left a comment

Choose a reason for hiding this comment

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

Happy with all these changes 👍

@ringods ringods added this pull request to the merge queue Sep 10, 2024
Merged via the queue into master with commit b7adcae Sep 10, 2024
6 checks passed
@ringods ringods deleted the disable-autorelease branch September 10, 2024 09:23
danielrbradley added a commit that referenced this pull request Sep 11, 2024
Follow-up to #1063

The nuget command fails if dotnet wasn't installed.
github-merge-queue bot pushed a commit that referenced this pull request Sep 12, 2024
Follow-up to #1063

The nuget command fails if dotnet wasn't installed.

Example failure:
https://github.com/pulumi/pulumi-azure/actions/runs/10815039270/job/30003728480?pr=2387

This only affects providers which have enabled `freeDiskSpaceBeforeTest`
because they will have a default version of dotnet available, and
therefore also wasn't caught by the downstream tests.

For the sake of consistency, we'll also only configure the pip
virtualenv if we're atually running python tests.
flostadler added a commit to pulumi/pulumi-aws that referenced this pull request Nov 18, 2024
This change pulls the latest ci-mgmt changes in order to reduce the size
of provider binaries. In detail, we're now setting the `-s -w` linker
flags to strip debug symbols. This cuts the provider binary size by
roughly 300MB, resulting in a 32% smaller provider binary.

Note: I also had to change `toolVersions.node` to `toolVersions.nodejs`
because the configuration is now type checked. The `toolVersions.node`
configuration option was renamed to `nodejs` in this PR:
pulumi/ci-mgmt#1063
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