Skip to content

Commit 55aaadb

Browse files
authored
git.io->cloudposse.tools update (cloudposse#134)
1 parent 488ab91 commit 55aaadb

15 files changed

+633
-313
lines changed

.github/.github-update-disabled

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This presence of a .github/.github-update-disabled file
2+
prevents `make github/update` from making any changes.
3+
The contents of the file are ignored.

.github/CODEOWNERS

+3-20
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,6 @@
33
#
44
# Order is important: the last matching pattern has the highest precedence
55

6-
# These owners will be the default owners for everything
7-
* @cloudposse/engineering @cloudposse/contributors
8-
9-
# Cloud Posse must review any changes to Makefiles
10-
**/Makefile @cloudposse/engineering
11-
**/Makefile.* @cloudposse/engineering
12-
13-
# Cloud Posse must review any changes to GitHub actions
14-
.github/* @cloudposse/engineering
15-
16-
# Cloud Posse must review any changes to standard context definition,
17-
# but some changes can be rubber-stamped.
18-
**/*.tf @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
19-
README.yaml @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
20-
README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
21-
docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
22-
23-
# Cloud Posse Admins must review all changes to CODEOWNERS or the mergify configuration
24-
.github/mergify.yml @cloudposse/admins
25-
.github/CODEOWNERS @cloudposse/admins
6+
# This module is used everywhere and changes must be carefully vetted,
7+
# so only allow cloudposse Admins to approve PRs.
8+
* @cloudposse/admins

.github/auto-release.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ version-resolver:
1717
- 'bugfix'
1818
- 'bug'
1919
- 'hotfix'
20+
- 'no-release'
2021
default: 'minor'
2122

2223
categories:
@@ -46,7 +47,7 @@ template: |
4647
4748
replacers:
4849
# Remove irrelevant information from Renovate bot
49-
- search: '/(?<=---\s+)+^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm'
50+
- search: '/(?<=---\s)\s*^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm'
5051
replace: ''
5152
# Remove Renovate bot banner image
5253
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'

.github/renovate.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"enabled": false
3+
}

.github/workflows/auto-format.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
fi
6363
6464
- name: Auto Test
65-
uses: cloudposse/actions/github/repository-dispatch@0.22.0
65+
uses: cloudposse/actions/github/repository-dispatch@0.30.0
6666
# match users by ID because logins (user names) are inconsistent,
6767
# for example in the REST API Renovate Bot is `renovate[bot]` but
6868
# in GraphQL it is just `renovate`, plus there is a non-bot

.github/workflows/auto-readme.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "auto-readme"
2+
on:
3+
workflow_dispatch:
4+
5+
schedule:
6+
# Example of job definition:
7+
# .---------------- minute (0 - 59)
8+
# | .------------- hour (0 - 23)
9+
# | | .---------- day of month (1 - 31)
10+
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
11+
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
12+
# | | | | |
13+
# * * * * * user-name command to be executed
14+
15+
# Update README.md nightly at 4am UTC
16+
- cron: '0 4 * * *'
17+
18+
jobs:
19+
update:
20+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: Find default branch name
26+
id: defaultBranch
27+
shell: bash
28+
env:
29+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
30+
run: |
31+
default_branch=$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name)
32+
printf "::set-output name=defaultBranch::%s\n" "${default_branch}"
33+
printf "defaultBranchRef.name=%s\n" "${default_branch}"
34+
35+
- name: Update readme
36+
shell: bash
37+
id: update
38+
env:
39+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
40+
DEF: "${{ steps.defaultBranch.outputs.defaultBranch }}"
41+
run: |
42+
make init
43+
make readme/build
44+
# Ignore changes if they are only whitespace
45+
if ! git diff --quiet README.md && git diff --ignore-all-space --ignore-blank-lines --quiet README.md; then
46+
git restore README.md
47+
echo Ignoring whitespace-only changes in README
48+
fi
49+
50+
- name: Create Pull Request
51+
# This action will not create or change a pull request if there are no changes to make.
52+
# If a PR of the auto-update/readme branch is open, this action will just update it, not create a new PR.
53+
uses: cloudposse/actions/github/[email protected]
54+
with:
55+
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
56+
commit-message: Update README.md and docs
57+
title: Update README.md and docs
58+
body: |-
59+
## what
60+
This is an auto-generated PR that updates the README.md and docs
61+
62+
## why
63+
To have most recent changes of README.md and doc from origin templates
64+
65+
branch: auto-update/readme
66+
base: ${{ steps.defaultBranch.outputs.defaultBranch }}
67+
delete-branch: true
68+
labels: |
69+
auto-update
70+
no-release
71+
readme

.github/workflows/chatops.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v2
1111
- name: "Handle common commands"
12-
uses: cloudposse/actions/github/slash-command-dispatch@0.22.0
12+
uses: cloudposse/actions/github/slash-command-dispatch@0.30.0
1313
with:
1414
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
1515
reaction-token: ${{ secrets.GITHUB_TOKEN }}
@@ -24,7 +24,7 @@ jobs:
2424
- name: "Checkout commit"
2525
uses: actions/checkout@v2
2626
- name: "Run tests"
27-
uses: cloudposse/actions/github/slash-command-dispatch@0.22.0
27+
uses: cloudposse/actions/github/slash-command-dispatch@0.30.0
2828
with:
2929
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
3030
reaction-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/validate-codeowners.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,20 @@ jobs:
1010
steps:
1111
- name: "Checkout source code at current commit"
1212
uses: actions/checkout@v2
13-
- uses: mszostok/codeowners-validator@v0.5.0
13+
- uses: mszostok/codeowners-validator@v0.7.1
1414
if: github.event.pull_request.head.repo.full_name == github.repository
1515
name: "Full check of CODEOWNERS"
1616
with:
1717
# For now, remove "files" check to allow CODEOWNERS to specify non-existent
1818
# files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos
1919
# checks: "files,syntax,owners,duppatterns"
2020
checks: "syntax,owners,duppatterns"
21+
owner_checker_allow_unowned_patterns: "false"
2122
# GitHub access token is required only if the `owners` check is enabled
2223
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
23-
- uses: mszostok/codeowners-validator@v0.5.0
24+
- uses: mszostok/codeowners-validator@v0.7.1
2425
if: github.event.pull_request.head.repo.full_name != github.repository
2526
name: "Syntax check of CODEOWNERS"
2627
with:
2728
checks: "syntax,duppatterns"
29+
owner_checker_allow_unowned_patterns: "false"

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ SHELL := /bin/bash
33
# List of targets the `readme` target should call before generating the readme
44
export README_DEPS ?= docs/targets.md docs/terraform.md
55

6-
-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness)
6+
-include $(shell curl -sSL -o .build-harness "https://cloudposse.tools/build-harness"; echo .build-harness)
77

88
## Lint terraform code
99
lint:
10-
$(SELF) terraform/install terraform/get-modules terraform/get-plugins terraform/lint terraform/validate
10+
$(SELF) terraform/install terraform/get-modules terraform/lint terraform/validate

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
926926

927927
## Copyright
928928

929-
Copyright © 2017-2021 [Cloud Posse, LLC](https://cpco.io/copyright)
929+
Copyright © 2017-2022 [Cloud Posse, LLC](https://cpco.io/copyright)
930930

931931

932932

test/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ deps::
2828
## Clean up the test harness
2929
clean:
3030
[ "$(TEST_HARNESS_PATH)" == "/" ] || rm -rf $(TEST_HARNESS_PATH)
31-
31+
3232
## Run all tests
3333
all: module examples/complete
3434

3535
## Run basic sanity checks against the module itself
36-
module: export TESTS ?= installed lint get-modules module-pinning get-plugins provider-pinning validate terraform-docs input-descriptions output-descriptions
36+
module: export TESTS ?= installed lint module-pinning provider-pinning validate terraform-docs input-descriptions output-descriptions
3737
module: deps
3838
$(call RUN_TESTS, ../)
3939

4040
## Run tests against example
41-
examples/complete: export TESTS ?= installed lint get-modules get-plugins validate init plan apply
41+
examples/complete: export TESTS ?= installed lint validate
4242
examples/complete: deps
4343
$(call RUN_TESTS, ../$@)

test/src/Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
export TF_CLI_ARGS_init ?= -get-plugins=true
2-
export TERRAFORM_VERSION ?= $(shell curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version' | cut -d. -f1-2)
1+
export TERRAFORM_VERSION ?= $(shell curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version' | cut -d. -f1)
32

43
.DEFAULT_GOAL : all
54
.PHONY: all
@@ -16,7 +15,7 @@ init:
1615
## Run tests
1716
test: init
1817
go mod download
19-
go test -v -timeout 60m -run TestExamplesComplete
18+
go test -v -timeout 10m
2019

2120
## Run tests in docker container
2221
docker/test:

test/src/examples_complete_test.go

+14-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@ package test
22

33
import (
44
"fmt"
5+
"os"
56
"testing"
67

8+
test_structure "github.com/gruntwork-io/terratest/modules/test-structure"
9+
710
"github.com/gruntwork-io/terratest/modules/terraform"
811
"github.com/qdm12/reprint"
912
"github.com/stretchr/testify/assert"
1013
)
1114

15+
func cleanup(t *testing.T, terraformOptions *terraform.Options, tempTestFolder string) {
16+
terraform.Destroy(t, terraformOptions)
17+
os.RemoveAll(tempTestFolder)
18+
}
19+
1220
type NLContext struct {
1321
AdditionalTagMap map[string]string `json:"additional_tag_map"`
1422
Attributes []string `json:"attributes"`
@@ -28,9 +36,14 @@ type NLContext struct {
2836
func TestExamplesComplete(t *testing.T) {
2937
t.Parallel()
3038

39+
rootFolder := "../../"
40+
terraformFolderRelativeToRoot := "examples/complete"
41+
42+
tempTestFolder := test_structure.CopyTerraformFolderToTemp(t, rootFolder, terraformFolderRelativeToRoot)
43+
3144
terraformOptions := &terraform.Options{
3245
// The path to where our Terraform code is located
33-
TerraformDir: "../../examples/complete",
46+
TerraformDir: tempTestFolder,
3447
Upgrade: true,
3548
}
3649

test/src/go.mod

+83-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,89 @@
11
module github.com/cloudposse/terraform-null-label
22

3-
go 1.14
3+
go 1.17
44

55
require (
6-
github.com/gruntwork-io/terratest v0.31.1
6+
github.com/gruntwork-io/terratest v0.39.0
77
github.com/qdm12/reprint v0.0.0-20200326205758-722754a53494
8-
github.com/stretchr/testify v1.6.1
8+
github.com/stretchr/testify v1.7.0
9+
)
10+
11+
require (
12+
cloud.google.com/go v0.83.0 // indirect
13+
cloud.google.com/go/storage v1.10.0 // indirect
14+
github.com/agext/levenshtein v1.2.3 // indirect
15+
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
16+
github.com/aws/aws-sdk-go v1.40.56 // indirect
17+
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
18+
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
19+
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
20+
github.com/davecgh/go-spew v1.1.1 // indirect
21+
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c // indirect
22+
github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0 // indirect
23+
github.com/go-logr/logr v0.2.0 // indirect
24+
github.com/go-sql-driver/mysql v1.4.1 // indirect
25+
github.com/gogo/protobuf v1.3.2 // indirect
26+
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
27+
github.com/golang/protobuf v1.5.2 // indirect
28+
github.com/golang/snappy v0.0.3 // indirect
29+
github.com/google/gofuzz v1.1.0 // indirect
30+
github.com/google/uuid v1.2.0 // indirect
31+
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
32+
github.com/googleapis/gnostic v0.4.1 // indirect
33+
github.com/gruntwork-io/go-commons v0.8.0 // indirect
34+
github.com/hashicorp/errwrap v1.0.0 // indirect
35+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
36+
github.com/hashicorp/go-getter v1.5.9 // indirect
37+
github.com/hashicorp/go-multierror v1.1.0 // indirect
38+
github.com/hashicorp/go-safetemp v1.0.0 // indirect
39+
github.com/hashicorp/go-version v1.3.0 // indirect
40+
github.com/hashicorp/hcl/v2 v2.9.1 // indirect
41+
github.com/hashicorp/terraform-json v0.13.0 // indirect
42+
github.com/imdario/mergo v0.3.11 // indirect
43+
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect
44+
github.com/jmespath/go-jmespath v0.4.0 // indirect
45+
github.com/json-iterator/go v1.1.11 // indirect
46+
github.com/jstemmer/go-junit-report v0.9.1 // indirect
47+
github.com/klauspost/compress v1.13.0 // indirect
48+
github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 // indirect
49+
github.com/mitchellh/go-homedir v1.1.0 // indirect
50+
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
51+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
52+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
53+
github.com/modern-go/reflect2 v1.0.1 // indirect
54+
github.com/pmezard/go-difflib v1.0.0 // indirect
55+
github.com/pquerna/otp v1.2.0 // indirect
56+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
57+
github.com/spf13/pflag v1.0.5 // indirect
58+
github.com/tmccombs/hcl2json v0.3.3 // indirect
59+
github.com/ulikunitz/xz v0.5.8 // indirect
60+
github.com/urfave/cli v1.22.2 // indirect
61+
github.com/zclconf/go-cty v1.9.1 // indirect
62+
go.opencensus.io v0.23.0 // indirect
63+
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
64+
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
65+
golang.org/x/mod v0.4.2 // indirect
66+
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
67+
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
68+
golang.org/x/sys v0.0.0-20210603125802-9665404d3644 // indirect
69+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
70+
golang.org/x/text v0.3.6 // indirect
71+
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
72+
golang.org/x/tools v0.1.2 // indirect
73+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
74+
google.golang.org/api v0.47.0 // indirect
75+
google.golang.org/appengine v1.6.7 // indirect
76+
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
77+
google.golang.org/grpc v1.38.0 // indirect
78+
google.golang.org/protobuf v1.26.0 // indirect
79+
gopkg.in/inf.v0 v0.9.1 // indirect
80+
gopkg.in/yaml.v2 v2.4.0 // indirect
81+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
82+
k8s.io/api v0.20.6 // indirect
83+
k8s.io/apimachinery v0.20.6 // indirect
84+
k8s.io/client-go v0.20.6 // indirect
85+
k8s.io/klog/v2 v2.4.0 // indirect
86+
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect
87+
sigs.k8s.io/structured-merge-diff/v4 v4.0.3 // indirect
88+
sigs.k8s.io/yaml v1.2.0 // indirect
989
)

0 commit comments

Comments
 (0)