Commit 70d3766
authored
Fix dependency CVEs in gha-artifacts and usage-log-aggregator lambdas (#8588)
## 1. `gha-artifacts` — aiohttp
aioboto3==12.1.0 -> aioboto3==15.5.0
## 2. `usage-log-aggregator` — same aiohttp
## 3. `usage-log-aggregator` — `"1T"` no longer parses under pandas 3
Verifying the above surfaced a pre-existing break unrelated to aiohttp.
`RESAMPLING_WINDOW = "1T"` uses the single-letter `T` frequency alias,
deprecated in pandas 2.2 and **removed in pandas 3.0**. pandas is
unpinned too, so any rebuild now installs 3.x and `_process_raw_logs`
raises:
ValueError: Invalid frequency: 1T. Failed to parse with error message:
ValueError("Invalid frequency: T. ... Did you mean min?")
This breaks any rebuild of this lambda from today onwards, independently
of this PR — the only thing preventing a broken deploy is that the
workflow runs pytest before `make deploy`. `"1min"` is accepted by both
pandas 2.x and 3.x, so no version pin is needed.
*Verified:* `pytest test_lambda_function.py` against both resolutions —
| pandas | aiohttp | result |
| --- | --- | --- |
| 3.0.5 | 3.14.3 | 3 passed |
| 2.3.3 | 3.14.3 | 3 passed |
Before the `"1min"` change the pandas 3.0.5 run failed
`test_process_raw_logs`.
## Deployment
Each lambda has its own path-filtered workflow, so merging redeploys
both automatically — `gha-artifacts-lambda.yml` and
`usage-log-aggregator-lambda.yml`.
Two things to check afterwards, neither included here:
1. `gha-artifacts` has **no tests** — its `test` job only runs `pip3
install`, so CI confirms the dependency set resolves but will not catch
a behavioural regression before deploy. Worth invoking the deployed
function with a recent `workflow_id` and confirming a non-empty
response. Adding an import smoke check to that workflow would help; I
could not include it here because it edits a workflow file.
2. `usage-log-aggregator`'s `requirements.txt` carries an older comment
describing these packages being installed as a Lambda layer, while the
`Makefile` bundles them into the function zip. If a layer with its own
aiohttp copy is still attached, it needs rebuilding separately — `aws
lambda get-function-configuration --function-name usage-log-aggregator
--query Layers`.
## Follow-up
`usage-log-aggregator`'s fully unpinned `requirements.txt` is what
produced both of its problems: the deployed dependency set is a function
of when the workflow last ran rather than of anything reviewed. Worth
pinning properly, or adding a lockfile, in a separate change.1 parent 61a7757 commit 70d3766
3 files changed
Lines changed: 3 additions & 3 deletions
File tree
- aws/lambda
- gha-artifacts
- usage-log-aggregator
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
0 commit comments