Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/algorithm-catalog-portal-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Algorithm Catalog — Disasters Portal PR

# An activation request that carries an event page (Submit form → "Page content") becomes a PR on
# the Disasters Portal (Disasters-Learning-Portal/disasters-portal) — the page file plus its entry
# in app/site-config/event/index.ts, generated by the same src/portal.ts the app previews.
#
# The PR is only opened if the portal's OWN checks pass on it first (Biome lint:ci + tsc
# typecheck, run in a real checkout by scripts/portal_pr.mjs), so a generated page cannot arrive
# red. Each request PR here maps to one portal branch, veda-catalog/pr-<N>; pushing to the
# request PR regenerates and force-updates that branch, and the portal PR follows.
#
# Token: the portal is another org's repo, so GITHUB_TOKEN cannot push there. Uses
# DISASTERS_PORTAL_TOKEN if set, else PROJECT_TOKEN_FOR_BOARD_READS (classic PAT, `repo` scope).
# Its owner needs write access to disasters-portal; the PRs are opened as that user.

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "algorithm-catalog/data/requests/**"

permissions:
contents: read
pull-requests: write # the link-back comment on the request PR

concurrency:
group: algorithm-catalog-portal-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
portal-pr:
name: Open / update the portal PR
# Fork PRs get no secrets — and must never drive a push into another org's repo.
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_URL: ${{ github.event.pull_request.html_url }}
BASE_REF: ${{ github.base_ref }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Request files in this PR
id: files
run: |
files=$(git diff --name-only --diff-filter=AM "origin/${BASE_REF}...HEAD" -- 'algorithm-catalog/data/requests/*.json' | tr '\n' ' ')
echo "Request files: ${files:-none}"
echo "files=${files}" >> "$GITHUB_OUTPUT"

- uses: actions/setup-node@v4
if: steps.files.outputs.files != ''
with:
node-version: "24"

- name: Check out the Disasters Portal
if: steps.files.outputs.files != ''
env:
TOKEN: ${{ secrets.DISASTERS_PORTAL_TOKEN || secrets.PROJECT_TOKEN_FOR_BOARD_READS }}
run: |
git clone --depth 1 --branch develop \
"https://x-access-token:${TOKEN}@github.com/Disasters-Learning-Portal/disasters-portal.git" portal
cd portal
git config user.name "veda-algorithm-catalog"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
cp .env.example .env.local
corepack enable
pnpm install --frozen-lockfile --ignore-scripts

- name: Generate, check, and open the portal PR
if: steps.files.outputs.files != ''
id: portal
env:
GH_TOKEN: ${{ secrets.DISASTERS_PORTAL_TOKEN || secrets.PROJECT_TOKEN_FOR_BOARD_READS }}
FILES: ${{ steps.files.outputs.files }}
run: |
# shellcheck disable=SC2086
node algorithm-catalog/scripts/portal_pr.mjs --portal portal \
--branch "veda-catalog/pr-${PR_NUMBER}" --source-pr "${PR_URL}" $FILES

- name: Link the portal PR back here
if: steps.portal.outputs.url != ''
env:
GH_TOKEN: ${{ github.token }}
URL: ${{ steps.portal.outputs.url }}
run: |
body="🌐 Disasters Portal page PR: ${URL} — regenerated automatically on every push to this PR."
gh pr comment "$PR_NUMBER" --edit-last --body "$body" || gh pr comment "$PR_NUMBER" --body "$body"
8 changes: 7 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ Netlify reads the `netlify.toml` **inside that base dir**, so the sites stay iso
**The standard is enforced automatically**: `src/rules.ts` holds the rules (the
`YYYYMM_Hazard_Location` regex is lifted verbatim from upstream `dps/_validate.sh:29-36`),
mirrored 1:1 in `scripts/validate_data.py`, kept honest by `scripts/rules_parity_test.py`, and
gated in CI by `.github/workflows/algorithm-catalog-validate.yml`. See `docs/ALGORITHM_CATALOG.md`.
gated in CI by `.github/workflows/algorithm-catalog-validate.yml`. **Event pages:** a request may
carry `page` (the science.data.nasa.gov page text, newest-wins over the published event) and
`places` (bundled gazetteer `data/places*.json`, hierarchical ids `US-AL` › `US-AL-c51000`, bbox
auto-filled). `.github/workflows/algorithm-catalog-portal-pr.yml` turns such a request PR into a
PR on `Disasters-Learning-Portal/disasters-portal` via `scripts/portal_pr.mjs` + `src/portal.ts`,
only after the portal's own Biome `lint:ci` + `typecheck` pass in a checkout; hand-written portal
pages are never overwritten. See `docs/ALGORITHM_CATALOG.md`.
- `board-explorer/` — Vite React SPA; `board-explorer/netlify.toml` (base=`board-explorer`, build,
publish `dist`). Makes a **Projects v2 board searchable**: free-text search plus **GitHub's own
Projects filter grammar made clickable**, over **Table / By-assignee / Timeline** views. Reads
Expand Down
57 changes: 38 additions & 19 deletions algorithm-catalog/data/algorithms.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"Flood",
"Landslide",
"Volcano"
]
],
"portalData": "DATA__LANDSAT_TRUE_COLOR"
},
{
"id": "pan",
Expand All @@ -76,7 +77,8 @@
"Volcano",
"Landslide"
],
"primaryHazards": []
"primaryHazards": [],
"portalData": "DATA__LANDSAT_NATURAL_COLOR"
},
{
"id": "colorIR",
Expand All @@ -93,7 +95,8 @@
"primaryHazards": [
"Fire",
"Landslide"
]
],
"portalData": "DATA__LANDSAT_COLOR_INFRARED"
},
{
"id": "ndvi",
Expand All @@ -110,7 +113,8 @@
"primaryHazards": [
"Drought",
"Heat"
]
],
"portalData": "DATA__LANDSAT_NDVI"
},
{
"id": "ndwi",
Expand All @@ -135,7 +139,8 @@
"primaryHazards": [
"Flood",
"TropicalCyclone"
]
],
"portalData": "DATA__LANDSAT_MNDWI"
},
{
"id": "evi",
Expand All @@ -158,7 +163,8 @@
],
"primaryHazards": [
"Fire"
]
],
"portalData": "DATA__LANDSAT_NBR"
},
{
"id": "we",
Expand Down Expand Up @@ -327,7 +333,8 @@
"Landslide",
"Volcano",
"WinterWx"
]
],
"portalData": "DATA__SENTINEL_2_TRUE_COLOR"
},
{
"id": "nat",
Expand All @@ -339,7 +346,8 @@
"Volcano",
"Landslide"
],
"primaryHazards": []
"primaryHazards": [],
"portalData": "DATA__SENTINEL_2_NATURAL_COLOR"
},
{
"id": "swir",
Expand All @@ -354,7 +362,8 @@
"primaryHazards": [
"Fire",
"Volcano"
]
],
"portalData": "DATA__SENTINEL_2_SWIR"
},
{
"id": "colorIR",
Expand All @@ -371,7 +380,8 @@
"primaryHazards": [
"Fire",
"Flood"
]
],
"portalData": "DATA__SENTINEL_2_COLOR_INFRARED"
},
{
"id": "ndvi",
Expand All @@ -388,7 +398,8 @@
"primaryHazards": [
"Drought",
"Heat"
]
],
"portalData": "DATA__SENTINEL_2_NDVI"
},
{
"id": "ndwi",
Expand All @@ -413,7 +424,8 @@
"primaryHazards": [
"Flood",
"TropicalCyclone"
]
],
"portalData": "DATA__SENTINEL_2_MNDWI"
},
{
"id": "nbr",
Expand All @@ -424,7 +436,8 @@
],
"primaryHazards": [
"Fire"
]
],
"portalData": "DATA__SENTINEL_2_NBR"
},
{
"id": "we",
Expand Down Expand Up @@ -558,7 +571,8 @@
"Earthquake",
"TropicalCyclone",
"Landslide"
]
],
"portalData": "DATA__SATELLOGIC_TRUE_COLOR"
},
{
"id": "colorir",
Expand All @@ -571,7 +585,8 @@
"Earthquake",
"Landslide"
],
"primaryHazards": []
"primaryHazards": [],
"portalData": "DATA__SATELLOGIC_COLOR_INFRARED"
},
{
"id": "ndvi",
Expand Down Expand Up @@ -717,7 +732,8 @@
"TropicalCyclone",
"Earthquake",
"Storm"
]
],
"portalData": "DATA__UMBRA_SIGMA_NAUGHT"
},
{
"id": "beta",
Expand Down Expand Up @@ -873,7 +889,8 @@
"TropicalCyclone",
"Earthquake",
"Storm"
]
],
"portalData": "DATA__CAPELLA_BACKSCATTER"
}
],
"inputs": [
Expand Down Expand Up @@ -958,7 +975,8 @@
"TropicalCyclone",
"Storm",
"WinterWx"
]
],
"portalData": "DATA__BLACK_MARBLE_HD"
},
{
"id": "hdnightlightscolored",
Expand Down Expand Up @@ -1197,7 +1215,8 @@
"Storm"
],
"note": "Prototype — produced via notebook, not DPS.",
"primaryHazards": []
"primaryHazards": [],
"portalData": "DATA__ICEYE_BACKSCATTER"
}
],
"inputs": [
Expand Down
Loading
Loading