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

Generalize bridged template for reuse with NoUpstream providers #1278

Merged
merged 8 commits into from
Jan 13, 2025

Conversation

t0yv0
Copy link
Member

@t0yv0 t0yv0 commented Jan 10, 2025

This is #1268 without the sharding. This should be safe as it is not affecting any providers per se yet, just building up a capability.

@t0yv0 t0yv0 force-pushed the t0yv0/generalize-bridged-template branch from e265b9d to 8148800 Compare January 10, 2025 22:26

This comment has been minimized.

This comment has been minimized.

t0yv0 added 4 commits January 10, 2025 17:33
For NoUpstream providers make .make/upstream is a no-op but it still needs to succeed as a real target and touch the
sentinel file.
@t0yv0 t0yv0 force-pushed the t0yv0/generalize-bridged-template branch from 8148800 to 22b93b4 Compare January 10, 2025 22:34

This comment has been minimized.

@t0yv0 t0yv0 mentioned this pull request Jan 10, 2025
@t0yv0 t0yv0 changed the title WIP: generalize bridged template Generalize bridged template for reuse with NoUpstream providers Jan 10, 2025
@t0yv0 t0yv0 requested a review from rquitales January 10, 2025 23:10
@t0yv0 t0yv0 marked this pull request as ready for review January 10, 2025 23:10
@t0yv0 t0yv0 requested a review from corymhall January 13, 2025 17:38
provider-ci/internal/pkg/config.go Outdated Show resolved Hide resolved
@@ -1,3 +1,4 @@
#{{ if not .Config.NoUpstream -}}#
Copy link
Contributor

Choose a reason for hiding this comment

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

What does GitHub do if it encounters an empty yaml file in the workflows directory? Does that work?

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like the empty files just don't get generated (see https://github.com/pulumi/pulumi-awsx/pull/1471/files )

Copy link
Member

Choose a reason for hiding this comment

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

GitHub actions will skip/ignore the empty yaml file

@@ -287,7 +287,11 @@ tfgen_build_only: bin/$(TFGEN)
bin/$(TFGEN): provider/*.go provider/go.* .make/upstream
(cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN))
.PHONY: tfgen schema tfgen_no_deps tfgen_build_only

#{{ if .Config.NoUpstream }}#
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this test for .Config.NoUpstream being set to false?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the code is correct. It's an if-then-else. If NoUpstream, we generate a dummy .make/upstream target. That is still required sadly. If NoUpstream=false, we hit the else branch which generates a bridge-specific upstream target.

Copy link
Member

Choose a reason for hiding this comment

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

No. I believe it should be NoUpsteam == true, as this branch is just creating a dummy upstream folder instead of actually populating the upstream submodule folder.

Copy link
Member Author

Choose a reason for hiding this comment

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

So code is correct yes? here's how it renders for AWS (

upstream: .make/upstream
) - no changes, which is good. The new form renders for eks.

upstream: .make/upstream

Copy link
Member

Choose a reason for hiding this comment

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

@t0yv0 Yes, the code is correct. My message was sent around the same time as your reply 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I got confused by adding an upstream make target in this case. Might be worth adding a comment to explain that this is a dummy make target

@@ -265,6 +265,10 @@ type Config struct {
// MakeTemplate has no effect but is set by 78 providers.
// https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22makeTemplate%3A%22&type=code
MakeTemplate string `yaml:"makeTemplate"`

// NoUpstream is a temporary hack to disable bridge-specific workflow steps
Copy link
Contributor

Choose a reason for hiding this comment

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

What is temporary about it? What do we plan on doing long term?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I'm taking this comment from Bryce's original PR. It might have been a part of a larger plan.

Copy link

pulumi bot commented Jan 13, 2025

🚀 The Update (preview) for pulumi/pulumi-provider-repos/production was successful.

Resource Changes

    Name                            Type                                            Operation
+   pulumi-eks-awaiting/bridge      github:index/issueLabel:IssueLabel              create
+   pulumi-eks-awaiting/core        github:index/issueLabel:IssueLabel              create
+   pulumi-eks-needs-release/minor  github:index/issueLabel:IssueLabel              create
+   pulumi-eks-needs-release/patch  github:index/issueLabel:IssueLabel              create
+   eks-default                     github:index/branchProtection:BranchProtection  create
+   pulumi-eks-needs-release/major  github:index/issueLabel:IssueLabel              create
+   eks                             pkg:provider:Labels                             create
+   pulumi-eks-awaiting/codegen     github:index/issueLabel:IssueLabel              create
... and 55 other changes

@t0yv0 t0yv0 added this pull request to the merge queue Jan 13, 2025
Merged via the queue into master with commit 5cf2bc8 Jan 13, 2025
8 checks passed
@t0yv0 t0yv0 deleted the t0yv0/generalize-bridged-template branch January 13, 2025 18:37
github-merge-queue bot pushed a commit that referenced this pull request Jan 13, 2025
In #1278 we added pulumi-eks as a
test provider which is good but we also added it to providers.json - it
is not quite ready for this since the repo has not been fully onboarded.
One observable failure is that ci-mgmt started applying branch
protections to the repository and failed to override hand-rolled branch
protections. It is better to avoid doing this for now.
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.

4 participants