Skip to content

Commit 1c70c48

Browse files
authored
Merge branch 'main' into sql_cookies_2025
2 parents 0f4b3fe + 9e7e228 commit 1c70c48

502 files changed

Lines changed: 16049 additions & 871 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/workflows/check-translations-lengths.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ jobs:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- name: Checkout Code
34-
uses: actions/checkout@v5
34+
uses: actions/checkout@v6
3535
with:
3636
path: this_run
3737
# Full git history is needed to get a proper list of changed files
3838
fetch-depth: 0
3939
- name: Checkout Code
4040
if: github.event_name == 'pull_request'
41-
uses: actions/checkout@v5
41+
uses: actions/checkout@v6
4242
with:
4343
path: original
4444
ref: main

.github/workflows/code-static-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
language: ['javascript', 'python']
3333
steps:
3434
- name: Checkout repository
35-
uses: actions/checkout@v5
35+
uses: actions/checkout@v6
3636
- name: Set up Python 3.12
3737
if: ${{ matrix.language == 'python' }}
3838
uses: actions/setup-python@v6
@@ -47,11 +47,11 @@ jobs:
4747
# that includes the dependencies
4848
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
4949
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@v3
50+
uses: github/codeql-action/init@v4
5151
with:
5252
config-file: ./.github/codeql/codeql-config.yml
5353
queries: +security-and-quality
5454
setup-python-dependencies: false
5555
languages: '${{ matrix.language }}'
5656
- name: Perform CodeQL Analysis
57-
uses: github/codeql-action/analyze@v3
57+
uses: github/codeql-action/analyze@v4

.github/workflows/compress-images.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,22 @@ jobs:
4545
github.event.pull_request.head.repo.full_name == github.repository)
4646
steps:
4747
- name: Checkout Branch
48-
uses: actions/checkout@v5
48+
uses: actions/checkout@v6
4949
- name: Run Image Compression
5050
id: calibre
5151
uses: calibreapp/image-actions@main
5252
with:
5353
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5454
compressOnly: ${{ github.event_name != 'pull_request' }}
5555
jpegProgressive: true
56+
minPctChange: '10.0'
5657
- name: Create Pull Request
5758
# If it's not a pull request then commit any changes as a new PR
5859
if: |
5960
github.event_name != 'pull_request' &&
6061
steps.calibre.outputs.markdown != ''
6162
id: cpr
62-
uses: peter-evans/create-pull-request@v7
63+
uses: peter-evans/create-pull-request@v8
6364
with:
6465
title: Auto Compress Images
6566
branch-suffix: timestamp

.github/workflows/linter.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout Code
22-
uses: actions/checkout@v5
22+
uses: actions/checkout@v6
2323
with:
2424
# Full git history is needed to get a proper list of changed files within `super-linter`
2525
fetch-depth: 0
@@ -44,7 +44,6 @@ jobs:
4444
VALIDATE_MARKDOWN: true
4545
VALIDATE_PYTHON_PYLINT: true
4646
VALIDATE_PYTHON_FLAKE8: true
47-
VALIDATE_SQLFLUFF: true
4847
VALIDATE_YAML: true
4948

5049
dependabot:
@@ -73,7 +72,6 @@ jobs:
7372
steps.metadata.outputs.update-type == 'version-update:semver-minor'
7473
) && (
7574
contains(steps.metadata.outputs.dependency-names, 'prettier') ||
76-
contains(steps.metadata.outputs.dependency-names, 'sqlfluff') ||
7775
contains(steps.metadata.outputs.dependency-names, 'super-linter')
7876
)
7977
run: gh pr merge --admin --squash "$PR_URL"

.github/workflows/lintsql.yml

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ on:
77
workflow_dispatch:
88
pull_request:
99
paths:
10-
src/requirements.txt
10+
- src/requirements.txt
11+
- 'sql/**.sql'
1112
jobs:
1213
lint:
1314
name: Lint SQL
1415
runs-on: ubuntu-latest
1516
steps:
1617
- name: Checkout Code
17-
uses: actions/checkout@v5
18+
uses: actions/checkout@v6
1819
with:
1920
# Full git history is needed to get a proper list of changed files within `super-linter`
2021
fetch-depth: 0
@@ -23,9 +24,46 @@ jobs:
2324
with:
2425
python-version: '3.12'
2526
- name: Lint SQL code
26-
if: |
27-
github.event_name == 'workflow_dispatch' ||
28-
startsWith(github.event.pull_request.title,'Bump sqlfluff') == true
2927
run: |
30-
pip install -r src/requirements.txt
31-
sqlfluff lint sql -p 4
28+
pip install -r src/requirements.txt -q
29+
if [ "${{ github.event_name }}" == "workflow_dispatch" ] || \
30+
[[ "${{ github.event.pull_request.title }}" == Bump\ sqlfluff* ]]; then
31+
# Lint all SQL files for workflow_dispatch or sqlfluff bumps
32+
sqlfluff lint sql -p 4
33+
else
34+
# Lint only changed SQL files
35+
git diff --name-only --diff-filter=ACMRT origin/${{ github.base_ref }}...HEAD \
36+
| grep '\.sql$' \
37+
| xargs -r sqlfluff lint
38+
fi
39+
40+
41+
dependabot:
42+
name: Dependabot auto-merge
43+
runs-on: ubuntu-latest
44+
needs: lint
45+
if: |
46+
github.event.pull_request.user.login == 'dependabot[bot]' &&
47+
github.repository == 'HTTPArchive/almanac.httparchive.org'
48+
49+
permissions:
50+
contents: write
51+
pull-requests: write
52+
53+
steps:
54+
- name: Dependabot metadata
55+
id: metadata
56+
uses: dependabot/fetch-metadata@v2
57+
with:
58+
github-token: "${{ secrets.GITHUB_TOKEN }}"
59+
60+
- name: Enable auto-merge for Dependabot PRs
61+
if: |
62+
(
63+
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
64+
steps.metadata.outputs.update-type == 'version-update:semver-minor'
65+
) && contains(steps.metadata.outputs.dependency-names, 'sqlfluff')
66+
run: gh pr merge --admin --squash "$PR_URL"
67+
env:
68+
PR_URL: ${{github.event.pull_request.html_url}}
69+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/predeploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- name: Checkout branch
34-
uses: actions/checkout@v5
34+
uses: actions/checkout@v6
3535
- name: Setup Node.js for use with actions
36-
uses: actions/setup-node@v5
36+
uses: actions/setup-node@v6
3737
with:
3838
node-version: '20'
3939
- name: Set up Python 3.12
@@ -67,7 +67,7 @@ jobs:
6767
npm run ebooks
6868
- name: Upload PDF artifact
6969
if: ${{ github.event.inputs.ebooks == 'true' }}
70-
uses: actions/upload-artifact@v4
70+
uses: actions/upload-artifact@v6
7171
with:
7272
name: pdfs
7373
path: ./src/static/pdfs/*.pdf
@@ -79,7 +79,7 @@ jobs:
7979
npm run timestamps
8080
- name: Create Pull Request
8181
id: cpr
82-
uses: peter-evans/create-pull-request@v7
82+
uses: peter-evans/create-pull-request@v8
8383
with:
8484
title: Pre-deploy Updates
8585
branch-suffix: timestamp

.github/workflows/production-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
if: github.repository == 'HTTPArchive/almanac.httparchive.org'
2525
steps:
2626
- name: Checkout branch
27-
uses: actions/checkout@v5
27+
uses: actions/checkout@v6
2828
- name: Set the list of URLs for Lighthouse to check
2929
run: ./src/tools/scripts/set_lighthouse_urls.sh -p
3030
- name: Audit URLs using Lighthouse

.github/workflows/test-template-changes.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929
if: github.repository == 'HTTPArchive/almanac.httparchive.org'
3030
steps:
3131
- name: Checkout Code
32-
uses: actions/checkout@v5
32+
uses: actions/checkout@v6
3333
with:
3434
fetch-depth: 0
3535
- name: Setup Node.js for use with actions
36-
uses: actions/setup-node@v5
36+
uses: actions/setup-node@v6
3737
with:
3838
node-version: '20'
3939
- name: Test Template Changes

.github/workflows/test_website.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
if: github.repository == 'HTTPArchive/almanac.httparchive.org'
2222
steps:
2323
- name: Checkout branch
24-
uses: actions/checkout@v5
24+
uses: actions/checkout@v6
2525
with:
2626
# Full git history is needed to get a proper list of changed files within `super-linter`
2727
fetch-depth: 0
2828
- name: Setup Node.js for use with actions
29-
uses: actions/setup-node@v5
29+
uses: actions/setup-node@v6
3030
with:
3131
node-version: '20'
3232
- name: Set up Python 3.12
@@ -42,9 +42,9 @@ jobs:
4242
- name: Lint Generated HTML
4343
uses: super-linter/super-linter/slim@v8
4444
env:
45-
DEFAULT_BRANCH: main
4645
FILTER_REGEX_INCLUDE: src/static/html/.*
4746
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
LOG_LEVEL: DEBUG
4848
VALIDATE_HTML: true
4949
USE_FIND_ALGORITHM: true
5050
- name: Set the list of URLs for Lighthouse to check

sql/.sqlfluff

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ exclude_rules = AL01,AL04,AL07,AL09,AM03,AM05,AM08,CP02,CP03,CV02,CV12,LT05,LT09
2828
# ST08 - Sometimes clearer to include brackets for complex COUNT(DISTINCT) cases
2929
# ST11 - Doesn't consider wildcards in SELECT. Issue: https://github.com/sqlfluff/sqlfluff/issues/6511
3030

31-
large_file_skip_byte_limit = 40000
31+
large_file_skip_byte_limit = 1120000
3232
# CPU processes to use while linting.
3333
# If positive, just implies number of processes.
3434
# If negative or zero, implies number_of_cpus - specifed_number.
@@ -52,14 +52,13 @@ extended_capitalisation_policy = upper
5252

5353
[sqlfluff:rules:convention.blocked_words]
5454
# Regex of blocked SQL that should not be used.
55-
# Can be overridden with `-- noqa: CV09` for those chapters using secondary pages
55+
# Can be overridden with `-- noqa: CV09` for those chapters using other dates
5656
# TABLESAMPLE - sometimes used for testing. Shouldn't be used in production as not random.
5757
# sample_data - sometimes used for testing. Shouldn't be used in production.
58-
# Block 2022_05_12 (contains secondary pages)
59-
# Block 2022_06_09 (contains secondary pages)
60-
# Block 2022_07_01 (probably forgot to update month to June for 2022)
61-
# Block 2021_06_01 (probably forgot to update month to July for 2021)
62-
blocked_regex = (TABLESAMPLE|sample_data|2022_?05_?12|2022_?06_?09|2022_?07_?01|2021_?06_?01)
58+
# The Web Almanac has run in different months due to timing or delays. This
59+
# means it's easy to use the wrong month by copying a previous query and only
60+
# updating the year and not the month. Block those months to warn about this.
61+
blocked_regex = (TABLESAMPLE|sample_data|2025-?08-?01|2025-?06-?01|2024-?08-?01|2024-?07-?01|2022-?08-?01|2022-?07-?01|2021-?06-?01|2021-?08-?01|2020-?07-?01)
6362

6463
[sqlfluff:rules:convention.count_rows]
6564
prefer_count_0 = True

0 commit comments

Comments
 (0)