Skip to content

Commit 02489a8

Browse files
authored
Merge branch 'main' into crowdstrike
2 parents 7b045dc + 9385a69 commit 02489a8

401 files changed

Lines changed: 5127 additions & 3408 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/styles/Vocab/Base/accept.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,14 @@ arn
145145
ARN
146146
ARNs
147147
SCP
148-
SCPs
148+
SCPs
149+
failover
150+
ENI
151+
ENIs
152+
runtime
153+
runtimes
154+
ELB
155+
ELBs
156+
CMK
157+
CMKs
158+
serverless

.github/workflows/broken_links.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ jobs:
3131
id: preview-deployment
3232
with:
3333
token: ${{ secrets.GITHUB_TOKEN }}
34-
max_timeout: 360
34+
# The action waits half of `max_timeout`. TODO: Change to 600 when https://github.com/patrickedqvist/wait-for-vercel-preview/pull/34 is released
35+
max_timeout: 1200
3536
check_interval: 10
3637
environment: 'Preview'
38+
allow_inactive: true
3739

3840
- name: Set Vercel URL output
3941
id: vercel

.github/workflows/dest_csv.yml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,10 @@ on:
1313
- ".github/workflows/dest_csv.yml"
1414

1515
jobs:
16-
resolve-runner:
17-
timeout-minutes: 5
18-
runs-on: ubuntu-latest
19-
outputs:
20-
runner: ${{ steps.resolve.outputs.runner }}
21-
steps:
22-
- name: Check if should use large runner
23-
id: large-runner
24-
# We want to speed runs on the main branch which prime the cache
25-
# We allow large runners only in this case to prevent forks from abusing them (it's enforced via runner groups access rules)
26-
# IF YOU WANT TO USE A LARGE RUNNER YOU NEED TO ADD THE WORKFLOW TO THE `CloudQuery releases` GROUP IN https://github.com/organizations/cloudquery/settings/actions/runner-groups
27-
if: github.event_name == 'push'
28-
run: |
29-
echo "runner=cloudquery-release-runner" >> $GITHUB_OUTPUT
30-
- name: Resolve runner
31-
id: resolve
32-
run: |
33-
RUNNER=${{ steps.large-runner.outputs.runner }}
34-
echo "runner=${RUNNER:-"ubuntu-latest"}" >> $GITHUB_OUTPUT
3516
plugins-destination-csv:
3617
timeout-minutes: 30
3718
name: "plugins/destination/csv"
38-
needs: [resolve-runner]
39-
runs-on: ${{ needs.resolve-runner.outputs.runner }}
19+
runs-on: ubuntu-latest
4020
defaults:
4121
run:
4222
working-directory: ./plugins/destination/csv
@@ -64,8 +44,7 @@ jobs:
6444
run: make test
6545
validate-release:
6646
timeout-minutes: 30
67-
needs: [resolve-runner]
68-
runs-on: ${{ needs.resolve-runner.outputs.runner }}
47+
runs-on: ubuntu-latest
6948
env:
7049
CGO_ENABLED: 0
7150
steps:

.github/workflows/dest_postgresql.yml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,10 @@ on:
1313
- ".github/workflows/dest_postgresql.yml"
1414

1515
jobs:
16-
resolve-runner:
17-
timeout-minutes: 5
18-
runs-on: ubuntu-latest
19-
outputs:
20-
runner: ${{ steps.resolve.outputs.runner }}
21-
steps:
22-
- name: Check if should use large runner
23-
id: large-runner
24-
# We want to speed runs on the main branch which prime the cache
25-
# We allow large runners only in this case to prevent forks from abusing them (it's enforced via runner groups access rules)
26-
# IF YOU WANT TO USE A LARGE RUNNER YOU NEED TO ADD THE WORKFLOW TO THE `CloudQuery releases` GROUP IN https://github.com/organizations/cloudquery/settings/actions/runner-groups
27-
if: github.event_name == 'push'
28-
run: |
29-
echo "runner=cloudquery-release-runner" >> $GITHUB_OUTPUT
30-
- name: Resolve runner
31-
id: resolve
32-
run: |
33-
RUNNER=${{ steps.large-runner.outputs.runner }}
34-
echo "runner=${RUNNER:-"ubuntu-latest"}" >> $GITHUB_OUTPUT
3516
plugins-destination-postgresql:
3617
timeout-minutes: 30
3718
name: "plugins/destination/postgresql"
38-
needs: [resolve-runner]
39-
runs-on: ${{ needs.resolve-runner.outputs.runner }}
19+
runs-on: ubuntu-latest
4020
defaults:
4121
run:
4222
working-directory: ./plugins/destination/postgresql
@@ -89,8 +69,7 @@ jobs:
8969
run: CQ_DEST_PG_TEST_CONN="postgresql://root@localhost:26257/postgres?sslmode=disable" make test
9070
validate-release:
9171
timeout-minutes: 30
92-
needs: [resolve-runner]
93-
runs-on: ${{ needs.resolve-runner.outputs.runner }}
72+
runs-on: ubuntu-latest
9473
env:
9574
CGO_ENABLED: 0
9675
steps:

.github/workflows/dest_sqlite.yml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,10 @@ on:
1313
- ".github/workflows/dest_sqlite.yml"
1414

1515
jobs:
16-
resolve-runner:
17-
timeout-minutes: 5
18-
runs-on: ubuntu-latest
19-
outputs:
20-
runner: ${{ steps.resolve.outputs.runner }}
21-
steps:
22-
- name: Check if should use large runner
23-
id: large-runner
24-
# We want to speed runs on the main branch which prime the cache
25-
# We allow large runners only in this case to prevent forks from abusing them (it's enforced via runner groups access rules)
26-
# IF YOU WANT TO USE A LARGE RUNNER YOU NEED TO ADD THE WORKFLOW TO THE `CloudQuery releases` GROUP IN https://github.com/organizations/cloudquery/settings/actions/runner-groups
27-
if: github.event_name == 'push'
28-
run: |
29-
echo "runner=cloudquery-release-runner" >> $GITHUB_OUTPUT
30-
- name: Resolve runner
31-
id: resolve
32-
run: |
33-
RUNNER=${{ steps.large-runner.outputs.runner }}
34-
echo "runner=${RUNNER:-"ubuntu-latest"}" >> $GITHUB_OUTPUT
3516
plugins-destination-sqlite:
3617
timeout-minutes: 30
3718
name: "plugins/destination/sqlite"
38-
needs: [resolve-runner]
39-
runs-on: ${{ needs.resolve-runner.outputs.runner }}
19+
runs-on: ubuntu-latest
4020
defaults:
4121
run:
4222
working-directory: ./plugins/destination/sqlite
@@ -64,8 +44,7 @@ jobs:
6444
run: make test
6545
validate-release:
6646
timeout-minutes: 30
67-
needs: [resolve-runner]
68-
runs-on: ${{ needs.resolve-runner.outputs.runner }}
47+
runs-on: ubuntu-latest
6948
container:
7049
image: ghcr.io/cloudquery/golang-cross:v10.0.0
7150
env:

.github/workflows/dest_test.yml

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,10 @@ on:
1313
- ".github/workflows/dest_test.yml"
1414

1515
jobs:
16-
resolve-runner:
17-
timeout-minutes: 5
18-
runs-on: ubuntu-latest
19-
outputs:
20-
runner: ${{ steps.resolve.outputs.runner }}
21-
steps:
22-
- name: Check if should use large runner
23-
id: large-runner
24-
# We want to speed runs on the main branch which prime the cache
25-
# We allow large runners only in this case to prevent forks from abusing them (it's enforced via runner groups access rules)
26-
# IF YOU WANT TO USE A LARGE RUNNER YOU NEED TO ADD THE WORKFLOW TO THE `CloudQuery releases` GROUP IN https://github.com/organizations/cloudquery/settings/actions/runner-groups
27-
if: github.event_name == 'push'
28-
run: |
29-
echo "runner=cloudquery-release-runner" >> $GITHUB_OUTPUT
30-
- name: Resolve runner
31-
id: resolve
32-
run: |
33-
RUNNER=${{ steps.large-runner.outputs.runner }}
34-
echo "runner=${RUNNER:-"ubuntu-latest"}" >> $GITHUB_OUTPUT
3516
plugins-destination-test:
3617
timeout-minutes: 30
3718
name: "plugins/destination/test"
38-
needs: [resolve-runner]
39-
runs-on: ${{ needs.resolve-runner.outputs.runner }}
19+
runs-on: ubuntu-latest
4020
defaults:
4121
run:
4222
working-directory: ./plugins/destination/test
@@ -64,8 +44,7 @@ jobs:
6444
run: go test ./...
6545
validate-release:
6646
timeout-minutes: 30
67-
needs: [resolve-runner]
68-
runs-on: ${{ needs.resolve-runner.outputs.runner }}
47+
runs-on: ubuntu-latest
6948
env:
7049
CGO_ENABLED: 0
7150
steps:
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Summarize changes to source plugins docs
2+
3+
on:
4+
# Using pull_request_target works on forked PRs too. This is safe since we don't checkout the PR code (we only use the diff)
5+
pull_request_target:
6+
branches:
7+
- main
8+
types:
9+
- opened
10+
- edited
11+
- synchronize
12+
- reopened
13+
jobs:
14+
doc-changes:
15+
defaults:
16+
run:
17+
working-directory: scripts/table_diff
18+
timeout-minutes: 15
19+
runs-on: ubuntu-latest
20+
outputs:
21+
breaking: ${{ steps.breaking.outputs.status }}
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
- name: Get PR diff
26+
run: |
27+
curl -L ${{ github.event.pull_request.diff_url }} > pr.diff
28+
- name: Set up Go 1.x
29+
uses: actions/setup-go@v3
30+
with:
31+
go-version-file: scripts/table_diff/go.mod
32+
cache: true
33+
cache-dependency-path: scripts/table_diff/go.sum
34+
- name: Generate docs changes file
35+
run: |
36+
go run main.go pr.diff changes.json
37+
- uses: actions/github-script@v6
38+
name: Get doc changes string
39+
id: get-changes
40+
with:
41+
result-encoding: string
42+
script: |
43+
const { promises: fs } = require('fs')
44+
const changes = JSON.parse(await fs.readFile('scripts/table_diff/changes.json', 'utf8'))
45+
if (changes.length === 0) {
46+
console.log('No changes to docs')
47+
return ""
48+
}
49+
const changesList = changes.map(change => {
50+
const { breaking, text } = change
51+
if (breaking) {
52+
return `- :warning: BREAKING CHANGE: ${text}`
53+
}
54+
return `- ${text}`
55+
}).join('\n')
56+
return changesList
57+
- name: Find Comment
58+
uses: peter-evans/find-comment@f4499a714d59013c74a08789b48abe4b704364a0
59+
if: steps.get-changes.outputs.result != ''
60+
id: find-comment
61+
with:
62+
issue-number: ${{ github.event.pull_request.number }}
63+
comment-author: 'github-actions[bot]'
64+
body-includes: '### This PR has the following changes to source plugin(s) tables:'
65+
- name: Create or update comment
66+
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808
67+
if: steps.get-changes.outputs.result != ''
68+
with:
69+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
70+
issue-number: ${{ github.event.pull_request.number }}
71+
body: |
72+
### This PR has the following changes to source plugin(s) tables:
73+
74+
${{steps.get-changes.outputs.result}}
75+
edit-mode: replace
76+
- name: Mark as breaking
77+
id: breaking
78+
if: contains(steps.get-changes.outputs.result, 'BREAKING CHANGE')
79+
run: echo "status=true" >> $GITHUB_OUTPUT
80+
ensure-breaking-changes-released-as-major-bump:
81+
runs-on: ubuntu-latest
82+
needs: [doc-changes]
83+
steps:
84+
- name: Should enforce check
85+
id: enforce
86+
# Only enforce this check for renovate PRs that update dependencies
87+
if: needs.doc-changes.outputs.breaking == 'true' && github.event.pull_request.user.login == 'cq-bot' && startsWith(github.event.pull_request.title, 'fix(deps)') && startsWith(github.head_ref, 'renovate/')
88+
run: echo "status=true" >> $GITHUB_OUTPUT
89+
- name: Install commit message parser
90+
if: steps.enforce.outputs.status == 'true'
91+
run: npm install @conventional-commits/parser
92+
- uses: actions/github-script@v6
93+
if: steps.enforce.outputs.status == 'true'
94+
with:
95+
script: |
96+
const {
97+
parser,
98+
toConventionalChangelogFormat,
99+
} = require("@conventional-commits/parser");
100+
const { title } = context.payload.pull_request
101+
try {
102+
const ast = parser(title);
103+
const { notes } = toConventionalChangelogFormat(ast);
104+
const isBreaking = notes.some(({ title }) =>
105+
title.includes("BREAKING CHANGE")
106+
);
107+
if (!isBreaking) {
108+
const titleParts = title.split(":");
109+
const expectedTitle = `${titleParts[0]}!:${titleParts[1]}`;
110+
throw new Error(`PR title does not contain a breaking change, please update the title to '${expectedTitle}'`);
111+
}
112+
} catch (e) {
113+
throw new Error(`PR title does not follow conventional commits format. Error: ${e}`);
114+
}

.github/workflows/lint_markdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Vale
1717
uses: errata-ai/vale-action@v2
1818
with:
19-
vale_flags: "--glob=!{website/pages/blog/podcast-software-engineer-daily.md,*CHANGELOG.md,*/docs/tables/*,.github/styles/proselint/README.md,**/v1-migration.md,website/pages/docs/plugins/sources/*/tables.md}"
19+
vale_flags: "--glob=!{website/pages/blog/podcast-software-engineer-daily.md,*CHANGELOG.md,*/docs/tables/*,.github/styles/proselint/README.md,**/v1-migration.md,website/pages/docs/plugins/sources/*/tables.md,website/pages/docs/plugins/sources/*/policies.md}"
2020
filter_mode: nofilter
2121
fail_on_error: true
2222
env:

.github/workflows/release_cli.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878

7979
- name: Update version file
8080
if: steps.semver_parser.outputs.prerelease == ''
81-
run: 'echo "{ \"latest\": \"${{github.ref_name}}\" }" > ./websites/versions/cli.json'
81+
run: 'echo "{ \"latest\": \"${{github.ref_name}}\" }" > ./website/versions/cli.json'
8282

8383
- name: Create Pull Request
8484
if: steps.semver_parser.outputs.prerelease == ''
@@ -92,4 +92,4 @@ jobs:
9292
commit-message: "chore: Update CLI version to ${{steps.split.outputs.version}}"
9393
body: Updates the CLI latest version to ${{steps.split.outputs.version}}
9494
labels: automerge
95-
author: cq-bot <cq-bot@users.noreply.github.com>
95+
author: cq-bot <cq-bot@users.noreply.github.com>

.github/workflows/source_aws.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
timeout-minutes: 45
3737
name: "plugins/source/aws"
3838
needs: [resolve-runner]
39+
permissions:
40+
id-token: write
41+
contents: read
3942
runs-on: ${{ needs.resolve-runner.outputs.runner }}
4043
defaults:
4144
run:
@@ -68,6 +71,21 @@ jobs:
6871
- name: Fail if generation updated files
6972
if: github.event_name == 'pull_request'
7073
run: test "$(git status -s | wc -l)" -eq 0
74+
# Sanity integration test, only for release PRs
75+
- name: Setup CloudQuery
76+
if: startsWith(github.head_ref, 'release-please--branches--main--components')
77+
uses: cloudquery/setup-cloudquery@v3
78+
with:
79+
version: 'v2.0.22'
80+
- name: Configure AWS credentials
81+
if: startsWith(github.head_ref, 'release-please--branches--main--components')
82+
uses: aws-actions/configure-aws-credentials@v1
83+
with:
84+
role-to-assume: arn:aws:iam::615713231484:role/cq-playground-aws-github-action
85+
aws-region: us-east-1
86+
- name: Run sync
87+
if: startsWith(github.head_ref, 'release-please--branches--main--components')
88+
run: cloudquery sync test/sanity.yml --log-console
7189
validate-release:
7290
timeout-minutes: 45
7391
needs: [resolve-runner]
@@ -148,4 +166,6 @@ jobs:
148166
- name: Run all policies
149167
run: cd policies && psql -h localhost -p 5432 -U postgres -d postgres -w -f ./policy.sql
150168
env:
151-
PGPASSWORD: pass
169+
PGPASSWORD: pass
170+
171+

0 commit comments

Comments
 (0)