Skip to content

Commit 200c4bb

Browse files
Automatic Dependabot PR merge + a bit of cleanup (#4223)
* cleanup * Add Dependabot auto-merge workflow * Add Dependabot auto-merge functionality to linter * lint * restore third_parties.sql
1 parent f37ebba commit 200c4bb

7 files changed

Lines changed: 148 additions & 348 deletions

File tree

.github/workflows/linter.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,37 @@ jobs:
4646
VALIDATE_PYTHON_FLAKE8: true
4747
VALIDATE_SQLFLUFF: true
4848
VALIDATE_YAML: true
49+
50+
dependabot:
51+
name: Dependabot auto-merge
52+
runs-on: ubuntu-latest
53+
needs: lint
54+
if: |
55+
github.event.pull_request.user.login == 'dependabot[bot]' &&
56+
github.repository == 'HTTPArchive/almanac.httparchive.org'
57+
58+
permissions:
59+
contents: write
60+
pull-requests: write
61+
62+
steps:
63+
- name: Dependabot metadata
64+
id: metadata
65+
uses: dependabot/fetch-metadata@v2
66+
with:
67+
github-token: "${{ secrets.GITHUB_TOKEN }}"
68+
69+
- name: Enable auto-merge for Dependabot PRs
70+
if: |
71+
(
72+
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
73+
steps.metadata.outputs.update-type == 'version-update:semver-minor'
74+
) && (
75+
contains(steps.metadata.outputs.dependency-names, 'prettier') ||
76+
contains(steps.metadata.outputs.dependency-names, 'sqlfluff') ||
77+
contains(steps.metadata.outputs.dependency-names, 'super-linter')
78+
)
79+
run: gh pr merge --auto --squash "$PR_URL"
80+
env:
81+
PR_URL: ${{github.event.pull_request.html_url}}
82+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/test_website.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,37 @@ jobs:
6464
run: |
6565
# All results by URL:
6666
echo '${{ steps.LHCIAction.outputs.manifest }}' | jq -r '.[] | (.summary|tostring) + " - " + .url'
67+
68+
dependabot:
69+
name: Dependabot auto-merge
70+
runs-on: ubuntu-latest
71+
needs: build
72+
if: |
73+
github.event.pull_request.user.login == 'dependabot[bot]' &&
74+
github.repository == 'HTTPArchive/almanac.httparchive.org'
75+
76+
permissions:
77+
contents: write
78+
pull-requests: write
79+
80+
steps:
81+
- name: Dependabot metadata
82+
id: metadata
83+
uses: dependabot/fetch-metadata@v2
84+
with:
85+
github-token: "${{ secrets.GITHUB_TOKEN }}"
86+
87+
- name: Enable auto-merge for Dependabot PRs
88+
if: |
89+
(
90+
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
91+
steps.metadata.outputs.update-type == 'version-update:semver-minor'
92+
) && !(
93+
contains(steps.metadata.outputs.dependency-names, 'prettier') ||
94+
contains(steps.metadata.outputs.dependency-names, 'sqlfluff') ||
95+
contains(steps.metadata.outputs.dependency-names, 'super-linter')
96+
)
97+
run: gh pr merge --auto --squash "$PR_URL"
98+
env:
99+
PR_URL: ${{github.event.pull_request.html_url}}
100+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

sql/util/functions.sql

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,3 @@ try {
88
return null;
99
}
1010
""";
11-
12-
# Origin Trials
13-
CREATE OR REPLACE FUNCTION `httparchive.fn.DECODE_ORIGIN_TRIAL`(token STRING) RETURNS STRING DETERMINISTIC AS (
14-
SAFE_CONVERT_BYTES_TO_STRING(SUBSTR(SAFE.FROM_BASE64(token), 70))
15-
);
16-
17-
CREATE OR REPLACE FUNCTION `httparchive.fn.PARSE_ORIGIN_TRIAL`(token STRING)
18-
RETURNS STRUCT<
19-
token STRING,
20-
origin STRING,
21-
feature STRING,
22-
expiry TIMESTAMP,
23-
is_subdomain BOOL,
24-
is_third_party BOOL
25-
> AS (
26-
STRUCT(
27-
DECODE_ORIGIN_TRIAL(token) AS token,
28-
JSON_VALUE(DECODE_ORIGIN_TRIAL(token), '$.origin') AS origin,
29-
JSON_VALUE(DECODE_ORIGIN_TRIAL(token), '$.feature') AS feature,
30-
TIMESTAMP_SECONDS(CAST(JSON_VALUE(DECODE_ORIGIN_TRIAL(token), '$.expiry') AS INT64)) AS expiry,
31-
JSON_VALUE(DECODE_ORIGIN_TRIAL(token), '$.isSubdomain') = 'true' AS is_subdomain,
32-
JSON_VALUE(DECODE_ORIGIN_TRIAL(token), '$.isThirdParty') = 'true' AS is_third_party
33-
)
34-
);

sql/util/parsed_css.sql

Lines changed: 0 additions & 10 deletions
This file was deleted.

sql/util/requests.sql

Lines changed: 0 additions & 209 deletions
This file was deleted.

sql/util/summary_response_bodies.sql

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)