Skip to content

Update VisitBeaches observations and confidence #20

Update VisitBeaches observations and confidence

Update VisitBeaches observations and confidence #20

name: Update VisitBeaches observations and confidence
on:
workflow_dispatch:
push:
branches: [main]
paths:
- '.github/workflows/update-visitbeaches-shadow.yml'
- 'scripts/visitbeaches_graphql.py'
- 'scripts/update_visitbeaches_shadow.py'
- 'scripts/apply_visitbeaches_confidence.py'
- 'tests/test_visitbeaches_graphql.py'
- 'tests/test_visitbeaches_confidence.py'
- 'requirements.txt'
schedule:
- cron: '37 7,9,11,13,15,17,19,21 * * *'
timezone: 'America/Chicago'
permissions:
contents: write
concurrency:
group: knowthegulf-visitbeaches-confidence
cancel-in-progress: false
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v6
with:
ref: main
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: pip
- run: pip install -r requirements.txt
- name: Validate VisitBeaches adapters
run: python -m py_compile scripts/visitbeaches_graphql.py scripts/update_visitbeaches_shadow.py scripts/apply_visitbeaches_confidence.py
- name: Run VisitBeaches regression tests
run: pytest -q tests/test_visitbeaches_graphql.py tests/test_visitbeaches_confidence.py
- name: Refresh VisitBeaches Ambassador observations
run: python scripts/update_visitbeaches_shadow.py
- name: Apply multi-source confidence and safe gap-fill policy
run: python scripts/apply_visitbeaches_confidence.py
- name: Validate generated VisitBeaches and public JSON
run: |
python - <<'PY'
import json
from pathlib import Path
root=Path('data/visitbeaches')
summary=json.loads((root/'summary.json').read_text())
assert summary['mode']=='shadow_only'
for p in root.glob('*.json'):
json.loads(p.read_text())
public=[Path('data/current_flag.json')] + list(Path('data').glob('*/current_flag.json'))
for p in public:
if p.exists(): json.loads(p.read_text())
print('VisitBeaches observations and public JSON valid')
PY
- name: Commit VisitBeaches evidence and confidence updates
run: |
owned=(
data/visitbeaches data/current_flag.json data/destin data/okaloosa-island
data/navarre-beach data/pensacola-beach data/south-walton data/cape-san-blas
data/st-joe-beach data/franklin-county data/anna-maria-island data/siesta-key
data/venice data/sanibel data/fort-myers-beach data/naples data/marco-island
)
if [[ -z "$(git status --porcelain -- "${owned[@]}")" ]]; then
echo "No VisitBeaches confidence changes to commit."; exit 0
fi
bash scripts/persist_paths.sh "data: refresh VisitBeaches confidence layer" "${owned[@]}"