-
Notifications
You must be signed in to change notification settings - Fork 98
qa: manifest-check tool for #2225 (failed to download manifest) #354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: manifest-check | ||
|
|
||
| # Catch issue #2225 ("Failed to download manifest") regressions. Probes the | ||
| # public ESP Web Tools manifest endpoints served by functions/releases/[[path]].ts | ||
| # and asserts they return well-formed JSON with reachable binaries. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "tools/manifest_check/**" | ||
| - "functions/releases/**" | ||
| - ".github/workflows/manifest-check.yml" | ||
| pull_request: | ||
| paths: | ||
| - "tools/manifest_check/**" | ||
| - "functions/releases/**" | ||
| - ".github/workflows/manifest-check.yml" | ||
| schedule: | ||
| - cron: "17 * * * *" | ||
| workflow_dispatch: {} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| unit-tests: | ||
| name: Schema unit tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - run: python3 tools/manifest_check/test_check_manifest.py | ||
|
|
||
| probe-manifest: | ||
| name: Probe public manifest endpoints | ||
| runs-on: ubuntu-latest | ||
| needs: unit-tests | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Probe manifest URLs | ||
| run: python3 tools/manifest_check/check_manifest.py | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| __pycache__/ | ||
| *.pyc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # manifest-check | ||
|
|
||
| Headless probe of the public ESP Web Tools manifest endpoints served by this | ||
| repo's `functions/releases/[[path]].ts`. Reproduces issue | ||
| [#2225](https://github.com/ESPresense/ESPresense/issues/2225) ("Failed to | ||
| download manifest"), where `https://espresense.com/releases/{version}.json?flavor={flavor}` | ||
| returns 5xx/404 and the web installer surfaces it as a generic "Failed to | ||
| download manifest" toast with no diagnostic. | ||
|
|
||
| ## Run locally | ||
|
|
||
| ```sh | ||
| python3 tools/manifest_check/check_manifest.py | ||
| ``` | ||
|
|
||
| Skip the per-binary HEAD validation (faster, useful when iterating on the | ||
| script itself): | ||
|
|
||
| ```sh | ||
| python3 tools/manifest_check/check_manifest.py --no-check-parts | ||
| ``` | ||
|
|
||
| Probe a different host (for local dev via `wrangler pages dev`): | ||
|
|
||
| ```sh | ||
| python3 tools/manifest_check/check_manifest.py --base http://localhost:8788 | ||
| ``` | ||
|
|
||
| ## What the probe checks | ||
|
|
||
| For each `version,flavor` listed in [`targets.txt`](./targets.txt): | ||
|
|
||
| 1. `GET /releases/{version}.json?flavor={flavor}` returns HTTP 200 with | ||
| `application/json`. | ||
| 2. The body parses as JSON. | ||
| 3. Required top-level keys are present (`name`, `version`, `builds`). | ||
| 4. Each `builds[]` entry has a non-empty `parts[]` array with `path` and | ||
| `offset`. | ||
| 5. Every `parts[].path` HEAD-resolves to 200 / 3xx (catches stale binaries | ||
| removed from the CDN). | ||
|
|
||
| Single transient 5xx responses are retried up to 3 times with exponential | ||
| backoff before failing the run; this keeps CI from flapping on transient | ||
| upstream hiccups while still catching persistent failures like the one | ||
| reported on [#2225](https://github.com/ESPresense/ESPresense/issues/2225). | ||
|
|
||
| ## Updating the target list | ||
|
|
||
| [`targets.txt`](./targets.txt) is the source of truth for which (version, | ||
| flavor) pairs the installer is expected to serve. Edit it when: | ||
|
|
||
| - A new release ships and is added to the installer dropdown. | ||
| - A new flavor (board / variant) enters the installer dropdown. | ||
| - A release is removed from the public installer (e.g., yanked due to a | ||
| bricking bug). | ||
|
|
||
| Lines starting with `#` are comments. Format is `version,flavor` per line. | ||
|
|
||
| ## CI | ||
|
|
||
| [`.github/workflows/manifest-check.yml`](../../.github/workflows/manifest-check.yml) | ||
| runs the probe on: | ||
|
|
||
| - pull requests that touch this directory, the release handler, or the workflow, | ||
| - pushes to `main` that touch the same, | ||
| - an hourly cron (`17 * * * *`), | ||
| - manual `workflow_dispatch`. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
Do not enable a known-red production gate.
This command currently reports 31 failures:
latestmanifests return 404/429 and multiple versioned binary URLs return 404. The plannedlatesthandler follow-up alone will not clear the stale-binary failures. Land the endpoint/asset fixes before enabling this required probe, or defer the workflow until it has a green baseline.🤖 Prompt for AI Agents
Source: Pipeline failures