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

Make the provider valid #1

Merged
merged 8 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .ci-mgmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
provider: xyz
env:
PULUMI_MISSING_DOCS_ERROR: true
XYZ_REGION: "us-west-2"
makeTemplate: bridged
pulumiConvert: 1
goBuildParallelism: 2
major-version: 1
plugins:
- name: random
version: "4.8.2"
- name: std
version: "1.6.2"
- name: terraform
version: "1.0.15"
kind: converter
71 changes: 8 additions & 63 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,67 +1,12 @@
ARG UBUNTU_VERSION=latest
FROM ubuntu:${UBUNTU_VERSION}
FROM jetpackio/devbox:latest

# Update apt-get and install various needed utilities
RUN apt-get update && \
apt-get install -y curl && \
apt-get install -y wget && \
apt-get install -y xz-utils && \
apt-get install -y make && \
apt-get install -y gcc && \
apt-get install -y git
# Installing your devbox project
WORKDIR /code
COPY devbox.json devbox.json
COPY devbox.lock devbox.lock
RUN sudo chown -R "${DEVBOX_USER}:${DEVBOX_USER}" /code

# Install bridged provider prerequisites
# See README.md

# Install go
ARG GO_VERSION=1.18.3
RUN rm -rf /usr/local/go && \
wget -O ${GO_VERSION}.tar.gz https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \
tar -C /usr/local -xzf ${GO_VERSION}.tar.gz && \
rm ${GO_VERSION}.tar.gz
RUN devbox run -- echo "Installed Packages."

ENV GOPATH=/root/go
ENV PATH=$PATH:/usr/local/go/bin

# Install go linter
RUN mkdir -p $GOPATH/bin && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.46.2

ENV PATH=$PATH:$GOPATH/bin

# Install pulumictl
ARG PULUMICTL_VERSION=v0.0.32
RUN rm -rf /usr/local/bin/pulumictl && \
wget -O pulumictl.${PULUMICTL_VERSION}.tar.gz https://github.com/pulumi/pulumictl/releases/download/${PULUMICTL_VERSION}/pulumictl-${PULUMICTL_VERSION}-linux-amd64.tar.gz && \
tar -C /usr/local/bin -xzf pulumictl.${PULUMICTL_VERSION}.tar.gz

# Install nodejs
ARG NODEJS_VERSION=v16.16.0
ARG NODEJS_PKG=node-${NODEJS_VERSION}-linux-x64
ARG NODEJS_TARBALL=${NODEJS_PKG}.tar.xz
RUN rm -rf /usr/local/node && \
wget -O ${NODEJS_TARBALL} https://nodejs.org/dist/${NODEJS_VERSION}/${NODEJS_TARBALL} && \
tar -C /usr/local -xf ${NODEJS_TARBALL} && \
mv /usr/local/${NODEJS_PKG} /usr/local/node

ENV PATH=$PATH:/usr/local/node/bin

# Install yarn
RUN npm install --global yarn

# Install python and related items
RUN apt-get install -y python3 && \
apt-get install -y python3-setuptools

# Install .NET
# https://stackoverflow.com/questions/73753672/a-fatal-error-occurred-the-folder-usr-share-dotnet-host-fxr-does-not-exist
RUN apt-get remove dotnet* && \
apt-get remove aspnetcore* && \
apt-get remove netstandard&

RUN apt-get update && \
apt-get install dotnet-sdk-6.0 -y

# Install Pulumi
RUN curl -fsSL https://get.pulumi.com | sh
ENV PATH=$PATH:/root/.pulumi/bin
RUN devbox shellenv --init-hook >> ~/.profile
18 changes: 13 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.3/containers/hugo
{
"name": "TFProvider",
"name": "Devbox Remote Container",
"build": {
"dockerfile": "Dockerfile"
}
"dockerfile": "./Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"jetpack-io.devbox"
]
}
},
"remoteUser": "devbox"
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk/**/* linguist-generated=true
54 changes: 54 additions & 0 deletions .github/workflows/check-upstream-upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

#WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt

env:
GH_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
jobs:
check_upgrade_provider:
name: Check for upstream provider upgrades
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
cache-dependency-path: |
sdk/go.sum
go-version: 1.21.x
- name: Checkout Repo
uses: actions/checkout@v4
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
shell: bash
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
- name: "Set up git identity: name"
run: git config --global user.name pulumi-bot
shell: bash
- name: "Set up git identity: email"
run: git config --global user.email bot@pulumi.com
shell: bash
- name: Run upgrade-provider upstream check
id: upstream_version
run: |
upgrade-provider "$REPO" --kind=check-upstream-version
env:
REPO: ${{ github.repository }}
shell: bash
- name: Send Check Version Failure To Slack
if: failure()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: provider-upgrade-publish-status
SLACK_COLOR: "#FF0000"
SLACK_ICON_EMOJI: ":owl:"
SLACK_MESSAGE: " Failed to check upstream for a new version "
SLACK_TITLE: ${{ github.event.repository.name }} upstream version check
SLACK_USERNAME: provider-bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
name: Check upstream upgrade
on:
workflow_dispatch: {} #so we can run this manually if necessary.
schedule:
# 3 AM UTC ~ 8 PM PDT / 7 PM PST daily. Time chosen to run during off hours.
- cron: 0 3 * * *
55 changes: 55 additions & 0 deletions .github/workflows/command-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt

env:
PROVIDER: xyz
DOTNETVERSION: |
6.0.x
3.1.301
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOVERSION: 1.21.x
GRADLEVERSION: "7.6"
JAVAVERSION: "11"
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODEVERSION: 20.x
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
PULUMI_API: https://api.pulumi-staging.io
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
PULUMI_MISSING_DOCS_ERROR: true
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
PYPI_USERNAME: __token__
PYTHONVERSION: "3.11"
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }}
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TF_APPEND_USER_AGENT: pulumi
TRAVIS_OS_NAME: linux
XYZ_REGION: us-west-2
jobs:
command-dispatch-for-testing:
name: command-dispatch-for-testing
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: peter-evans/slash-command-dispatch@v2
with:
commands: |
run-acceptance-tests
release
issue-type: pull-request
permission: write
reaction-token: ${{ secrets.GITHUB_TOKEN }}
repository: pulumi/pulumi-xyz
token: ${{ secrets.PULUMI_BOT_TOKEN }}
name: command-dispatch
on:
issue_comment:
types:
- created
- edited
43 changes: 43 additions & 0 deletions .github/workflows/community-moderation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
warn_codegen:
name: warn_codegen
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- id: schema_changed
name: Check for diff in schema
uses: dorny/paths-filter@v2
with:
filters: "changed: 'provider/cmd/**/schema.json'"
- id: sdk_changed
if: steps.schema_changed.outputs.changed == 'false'
name: Check for diff in sdk/**
uses: dorny/paths-filter@v2
with:
filters: "changed: 'sdk/**'"
- if: steps.sdk_changed.outputs.changed == 'true' &&
github.event.pull_request.head.repo.full_name != github.repository
name: Send codegen warning as comment on PR
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: >
Hello and thank you for your pull request! :heart: :sparkles:
It looks like you're directly modifying files in the language SDKs, many of which are autogenerated.
Be sure any files you're editing do not begin with a code generation warning.
For generated files, you will need to make changes in `resources.go` instead, and [generate the code](https://github.com/pulumi/${{ github.event.repository.name }}/blob/master/CONTRIBUTING.md#committing-generated-code).
name: warn-codegen
on:
pull_request_target:
branches:
- master
types:
- opened
78 changes: 78 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt

name: license_check

on:
workflow_call:
inputs: {}


env:
DOTNETVERSION: |
6.0.x
3.1.301
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOVERSION: 1.21.x
GRADLEVERSION: "7.6"
JAVAVERSION: "11"
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODEVERSION: 20.x
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
PULUMI_API: https://api.pulumi-staging.io
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
PULUMI_MISSING_DOCS_ERROR: true
PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
PYPI_USERNAME: __token__
PYTHONVERSION: "3.11"
SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }}
SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TF_APPEND_USER_AGENT: pulumi
TRAVIS_OS_NAME: linux
XYZ_REGION: us-west-2

jobs:
license_check:
name: License Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ env.PR_COMMIT_SHA }}
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v5
with:
cache-dependency-path: |
sdk/go.sum
go-version: 1.21.x
- run: make upstream
- uses: pulumi/license-check-action@main
with:
module-path: provider
ignore-modules: >-
github.com/aead/chacha20,
github.com/apache/arrow/go/v12,
github.com/apache/thrift/lib/go/thrift,
github.com/cloudflare/circl,
github.com/golang,
github.com/gorhill/cronexpr,
github.com/in-toto/in-toto-golang,
github.com/jmespath/go-jmespath,
github.com/keybase/go-crypto,
github.com/klauspost/compress,
github.com/mattn/go-localereader,
github.com/modern-go/reflect2,
github.com/pierrec/lz4,
github.com/pjbgf/sha1cd,
github.com/pulumi,
github.com/segmentio/asm,
golang.org
Loading
Loading