Skip to content

Commit 8f4cf9f

Browse files
Merge branch 'main' into busy-lobster
2 parents 318021a + 82c90b1 commit 8f4cf9f

20 files changed

Lines changed: 359 additions & 521 deletions

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
persist-credentials: false
2828

2929
- name: Lint Code Base
30-
uses: super-linter/super-linter/slim@v8.3.2
30+
uses: super-linter/super-linter/slim@v8.5.0
3131
env:
3232
DEFAULT_BRANCH: main
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/infra.yaml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
paths:
8-
- "infra/**"
97

108
concurrency:
119
group: ${{ github.workflow }}-${{ github.ref }}
@@ -23,34 +21,22 @@ jobs:
2321
- name: Checkout code
2422
uses: actions/checkout@v6
2523
with:
24+
fetch-depth: 0
2625
persist-credentials: false
2726

2827
- name: Authenticate with Google Cloud
2928
uses: google-github-actions/auth@v3
3029
with:
3130
project_id: "httparchive"
32-
credentials_json: "${{ secrets.GCP_SA_KEY }}"
31+
credentials_json: ${{ secrets.GCP_SA_KEY }}
3332

3433
- name: Set up Terraform
35-
uses: hashicorp/setup-terraform@v3.1.2
36-
37-
- name: Terraform Format Check
38-
working-directory: ./infra
39-
run: terraform fmt -check
34+
uses: hashicorp/setup-terraform@v3
4035

4136
- name: Initialize Terraform
42-
working-directory: ./infra
43-
run: terraform init
44-
45-
- name: Validate Terraform
46-
working-directory: ./infra
47-
run: terraform validate
48-
49-
- name: Plan Terraform
50-
working-directory: ./infra
51-
run: terraform plan -out=tfplan
37+
run: |
38+
make tf_init
39+
make tf_lint
5240
5341
- name: Apply Terraform
54-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
55-
working-directory: ./infra
56-
run: terraform apply -auto-approve tfplan
42+
run: make tf_apply

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ clean:
22
rm -rf ./infra/bigquery-export/node_modules
33
rm -rf ./infra/dataform-service/node_modules
44

5+
tf_init:
6+
cd infra && terraform init -upgrade
7+
8+
tf_lint:
9+
cd infra && terraform fmt -check && terraform validate
10+
511
tf_plan:
6-
cd infra && terraform init -upgrade && terraform plan
12+
cd infra && terraform plan
713

814
tf_apply:
9-
cd infra && terraform init && terraform apply -auto-approve
15+
cd infra && terraform apply -auto-approve

definitions/output/reports/tech_report_audits.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,17 @@ GROUP BY
8787
technology,
8888
version
8989
`).postOps(ctx => `
90-
SELECT
91-
reports.run_export_job(
92-
JSON '''{
93-
"destination": "firestore",
94-
"config": {
95-
"database": "tech-report-api-${constants.environment}",
96-
"collection": "audits",
97-
"type": "report",
98-
"date": "${pastMonth}"
99-
},
100-
"query": "SELECT STRING(date) AS date, * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${pastMonth}'"
101-
}'''
102-
);
103-
`)
90+
SELECT
91+
reports.run_export_job(
92+
JSON '''{
93+
"destination": "firestore",
94+
"config": {
95+
"database": "tech-report-api-${constants.environment}",
96+
"collection": "audits",
97+
"type": "report",
98+
"date": "${pastMonth}"
99+
},
100+
"query": "SELECT STRING(date) AS date, * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${pastMonth}'"
101+
}'''
102+
);
103+
`)

definitions/output/reports/tech_report_categories.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ FROM (
108108
GROUP BY client
109109
)
110110
`).postOps(ctx => `
111-
SELECT
112-
reports.run_export_job(
113-
JSON '''{
114-
"destination": "firestore",
115-
"config": {
116-
"database": "tech-report-api-${constants.environment}",
117-
"collection": "categories",
118-
"type": "dict"
119-
},
120-
"query": "SELECT * FROM ${ctx.self()}"
121-
}'''
122-
);
123-
`)
111+
SELECT
112+
reports.run_export_job(
113+
JSON '''{
114+
"destination": "firestore",
115+
"config": {
116+
"database": "tech-report-api-${constants.environment}",
117+
"collection": "categories",
118+
"type": "dict"
119+
},
120+
"query": "SELECT * FROM ${ctx.self()}"
121+
}'''
122+
);
123+
`)

definitions/output/reports/tech_report_core_web_vitals.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -100,32 +100,32 @@ GROUP BY
100100
technology,
101101
version
102102
`).postOps(ctx => `
103-
SELECT
104-
reports.run_export_job(
105-
JSON '''{
106-
"destination": "firestore",
107-
"config": {
108-
"database": "tech-report-api-${constants.environment}",
109-
"collection": "core_web_vitals",
110-
"type": "report",
111-
"date": "${pastMonth}"
112-
},
113-
"query": "SELECT STRING(date) AS date, * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${pastMonth}'"
114-
}'''
115-
);
103+
SELECT
104+
reports.run_export_job(
105+
JSON '''{
106+
"destination": "firestore",
107+
"config": {
108+
"database": "tech-report-api-${constants.environment}",
109+
"collection": "core_web_vitals",
110+
"type": "report",
111+
"date": "${pastMonth}"
112+
},
113+
"query": "SELECT STRING(date) AS date, * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${pastMonth}'"
114+
}'''
115+
);
116116
117-
-- legacy export to tech-report-apis database
118-
SELECT
119-
reports.run_export_job(
120-
JSON '''{
121-
"destination": "firestore",
122-
"config": {
123-
"database": "tech-report-apis-${constants.environment}",
124-
"collection": "core_web_vitals",
125-
"type": "report",
126-
"date": "${pastMonth}"
127-
},
128-
"query": "SELECT STRING(date) AS date, * EXCEPT(date, version) FROM ${ctx.self()} WHERE date = '${pastMonth}' AND version = 'ALL'"
129-
}'''
130-
);
131-
`)
117+
-- legacy export to tech-report-apis database
118+
SELECT
119+
reports.run_export_job(
120+
JSON '''{
121+
"destination": "firestore",
122+
"config": {
123+
"database": "tech-report-apis-${constants.environment}",
124+
"collection": "core_web_vitals",
125+
"type": "report",
126+
"date": "${pastMonth}"
127+
},
128+
"query": "SELECT STRING(date) AS date, * EXCEPT(date, version) FROM ${ctx.self()} WHERE date = '${pastMonth}' AND version = 'ALL'"
129+
}'''
130+
);
131+
`)

definitions/output/reports/tech_report_geos.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ WHERE
1616
AND version = 'ALL'
1717
${constants.devRankFilter}
1818
`).postOps(ctx => `
19-
SELECT
20-
reports.run_export_job(
21-
JSON '''{
22-
"destination": "firestore",
23-
"config": {
24-
"database": "tech-report-api-${constants.environment}",
25-
"collection": "geos",
26-
"type": "dict"
27-
},
28-
"query": "SELECT * FROM ${ctx.self()}"
29-
}'''
30-
);
31-
`)
19+
SELECT
20+
reports.run_export_job(
21+
JSON '''{
22+
"destination": "firestore",
23+
"config": {
24+
"database": "tech-report-api-${constants.environment}",
25+
"collection": "geos",
26+
"type": "dict"
27+
},
28+
"query": "SELECT * FROM ${ctx.self()}"
29+
}'''
30+
);
31+
`)

definitions/output/reports/tech_report_lighthouse.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -76,32 +76,32 @@ GROUP BY
7676
technology,
7777
version
7878
`).postOps(ctx => `
79-
SELECT
80-
reports.run_export_job(
81-
JSON '''{
82-
"destination": "firestore",
83-
"config": {
84-
"database": "tech-report-api-${constants.environment}",
85-
"collection": "lighthouse",
86-
"type": "report",
87-
"date": "${pastMonth}"
88-
},
89-
"query": "SELECT STRING(date) AS date, * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${pastMonth}'"
90-
}'''
91-
);
79+
SELECT
80+
reports.run_export_job(
81+
JSON '''{
82+
"destination": "firestore",
83+
"config": {
84+
"database": "tech-report-api-${constants.environment}",
85+
"collection": "lighthouse",
86+
"type": "report",
87+
"date": "${pastMonth}"
88+
},
89+
"query": "SELECT STRING(date) AS date, * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${pastMonth}'"
90+
}'''
91+
);
9292
93-
-- legacy export to tech-report-apis database
94-
SELECT
95-
reports.run_export_job(
96-
JSON '''{
97-
"destination": "firestore",
98-
"config": {
99-
"database": "tech-report-apis-${constants.environment}",
100-
"collection": "lighthouse",
101-
"type": "report",
102-
"date": "${pastMonth}"
103-
},
104-
"query": "SELECT STRING(date) AS date, * EXCEPT(date, version) FROM ${ctx.self()} WHERE date = '${pastMonth}' AND version = 'ALL'"
105-
}'''
106-
);
107-
`)
93+
-- legacy export to tech-report-apis database
94+
SELECT
95+
reports.run_export_job(
96+
JSON '''{
97+
"destination": "firestore",
98+
"config": {
99+
"database": "tech-report-apis-${constants.environment}",
100+
"collection": "lighthouse",
101+
"type": "report",
102+
"date": "${pastMonth}"
103+
},
104+
"query": "SELECT STRING(date) AS date, * EXCEPT(date, version) FROM ${ctx.self()} WHERE date = '${pastMonth}' AND version = 'ALL'"
105+
}'''
106+
);
107+
`)

definitions/output/reports/tech_report_page_weight.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -69,32 +69,32 @@ GROUP BY
6969
technology,
7070
version
7171
`).postOps(ctx => `
72-
SELECT
73-
reports.run_export_job(
74-
JSON '''{
75-
"destination": "firestore",
76-
"config": {
77-
"database": "tech-report-api-${constants.environment}",
78-
"collection": "page_weight",
79-
"type": "report",
80-
"date": "${pastMonth}"
81-
},
82-
"query": "SELECT STRING(date) AS date, * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${pastMonth}'"
83-
}'''
84-
);
72+
SELECT
73+
reports.run_export_job(
74+
JSON '''{
75+
"destination": "firestore",
76+
"config": {
77+
"database": "tech-report-api-${constants.environment}",
78+
"collection": "page_weight",
79+
"type": "report",
80+
"date": "${pastMonth}"
81+
},
82+
"query": "SELECT STRING(date) AS date, * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${pastMonth}'"
83+
}'''
84+
);
8585
86-
-- legacy export for tech-report-apis
87-
SELECT
88-
reports.run_export_job(
89-
JSON '''{
90-
"destination": "firestore",
91-
"config": {
92-
"database": "tech-report-apis-${constants.environment}",
93-
"collection": "page_weight",
94-
"type": "report",
95-
"date": "${pastMonth}"
96-
},
97-
"query": "SELECT STRING(date) AS date, * EXCEPT(date, version) FROM ${ctx.self()} WHERE date = '${pastMonth}' AND version = 'ALL'"
98-
}'''
99-
);
100-
`)
86+
-- legacy export for tech-report-apis
87+
SELECT
88+
reports.run_export_job(
89+
JSON '''{
90+
"destination": "firestore",
91+
"config": {
92+
"database": "tech-report-apis-${constants.environment}",
93+
"collection": "page_weight",
94+
"type": "report",
95+
"date": "${pastMonth}"
96+
},
97+
"query": "SELECT STRING(date) AS date, page_weight AS pageWeight, * EXCEPT(date, version, page_weight) FROM ${ctx.self()} WHERE date = '${pastMonth}' AND version = 'ALL'"
98+
}'''
99+
);
100+
`)

definitions/output/reports/tech_report_ranks.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ WHERE
1616
AND version = 'ALL'
1717
${constants.devRankFilter}
1818
`).postOps(ctx => `
19-
SELECT
20-
reports.run_export_job(
21-
JSON '''{
22-
"destination": "firestore",
23-
"config": {
24-
"database": "tech-report-api-${constants.environment}",
25-
"collection": "ranks",
26-
"type": "dict"
27-
},
28-
"query": "SELECT * FROM ${ctx.self()}"
29-
}'''
30-
);
31-
`)
19+
SELECT
20+
reports.run_export_job(
21+
JSON '''{
22+
"destination": "firestore",
23+
"config": {
24+
"database": "tech-report-api-${constants.environment}",
25+
"collection": "ranks",
26+
"type": "dict"
27+
},
28+
"query": "SELECT * FROM ${ctx.self()}"
29+
}'''
30+
);
31+
`)

0 commit comments

Comments
 (0)