Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
57 changes: 0 additions & 57 deletions .github/workflows/fetch_flutter_snapshot_hash.yml

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/update_sdk_details.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Update SDK details

on:
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
inputs:
sdk:
description: "Optional SDK provider id; empty updates all providers"
required: false
type: string

permissions:
contents: write

concurrency:
group: sdk-details-${{ github.ref }}
cancel-in-progress: false

jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests

- name: Test SDK details tooling
run: python sdk-details/tools/test.py

- name: Update generated SDK data
env:
REQUESTED_SDK: ${{ inputs.sdk }}
run: |
if [[ -n "$REQUESTED_SDK" ]]; then
python sdk-details/tools/update.py --sdk "$REQUESTED_SDK"
else
python sdk-details/tools/update.py --all
fi

- name: Validate generated SDK data
run: python sdk-details/tools/update.py --check

- name: Commit and push changes
shell: bash
run: |
set -euo pipefail
if [[ -z "$(git status --porcelain -- sdk-details)" ]]; then
echo "No SDK detail changes"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add --all -- sdk-details
git commit -m "Update SDK detail data"
git push origin "HEAD:${GITHUB_REF_NAME}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/.idea/
__pycache__/
*.py[cod]
29 changes: 29 additions & 0 deletions sdk-details/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SDK details

This directory contains remotely configurable SDK detection definitions and
generated enrichment data consumed by LibChecker's library details dialog.

`catalog.json` is generated from each `sdks/*/definition.json`. Definitions
associate stable library UUIDs with bounded detection probes, optional remote
lookups, and presentation fields. Existing rule detail JSON files remain
independent from SDK details configuration.

Definitions are data, not executable code. The client accepts only the
versioned operators and hard limits represented by `schemas/definition-v1.schema.json`;
unknown operators, unsafe paths, oversized input, and unsupported schema
versions are rejected without affecting the normal library detail UI. Remote
documents are fetched lazily and are not bundled into the app or persisted as
an offline version map.

Providers are optional. An SDK that embeds its version directly in an APK only
needs a definition. SDKs that require an external version index may expose a
`provider.py` with `SDK_ID`, `update()`, and `validate()` for the generic runner.

Run validation and updates from the repository root:

```shell
python sdk-details/tools/test.py
python sdk-details/tools/validate.py --write
python sdk-details/tools/update.py --check
python sdk-details/tools/update.py --all
```
12 changes: 12 additions & 0 deletions sdk-details/catalog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"schema_version": 1,
"entries": [
{
"sdk_id": "flutter",
"library_uuids": [
"AEF9680F-4A43-4EDC-A5B8-8119D23BCD21"
],
"definition": "sdk-details/sdks/flutter/definition.json"
}
]
}
42 changes: 42 additions & 0 deletions sdk-details/schemas/catalog-v1.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://libchecker.github.io/schemas/sdk-details/catalog-v1.schema.json",
"type": "object",
"required": ["schema_version", "entries"],
"additionalProperties": false,
"properties": {
"schema_version": {
"const": 1
},
"entries": {
"type": "array",
"minItems": 1,
"maxItems": 128,
"items": {
"type": "object",
"required": ["sdk_id", "library_uuids", "definition"],
"additionalProperties": false,
"properties": {
"sdk_id": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
},
"library_uuids": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$"
}
},
"definition": {
"type": "string",
"pattern": "^sdk-details/sdks/[a-z0-9_-]+/definition\\.json$"
}
}
}
}
}
}
Loading