Add Kīlauea Activity app - #587
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a Kīlauea Activity app that normalizes USGS HANS notices, caches live results, renders animated pixel-art scenes and status cards, and integrates the app with repository metadata, documentation, an image asset, and five-minute scheduling. ChangesKīlauea Activity app
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Device
participant fetch_status
participant USGS_HANS
participant normalize_notice
participant Renderer
Device->>fetch_status: Request app status
fetch_status->>USGS_HANS: GET volcano 332010 data
USGS_HANS-->>fetch_status: Notice JSON
fetch_status->>normalize_notice: Normalize notice and freshness
normalize_notice-->>fetch_status: Status model
fetch_status->>Renderer: Provide status model
Renderer-->>Device: Render scene and information animation
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/kilaueaactivity/kilaueaactivity.star`:
- Around line 592-600: Update short_date to strip the time component from
sent_utc before splitting and parsing the date, ensuring the year-month-day
prefix is used so the day conversion remains numeric and invalid input still
returns an empty string.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d7c678b0-f4e6-4e71-8ac9-c4f41e1b536a
📒 Files selected for processing (5)
apps/kilaueaactivity/README.mdapps/kilaueaactivity/kilaueaactivity.starapps/kilaueaactivity/kilaueaactivity.webpapps/kilaueaactivity/manifest.yamlupdate_intervals.txt
| def short_date(sent_utc): | ||
| parts = sent_utc.split("-") | ||
| if len(parts) != 3: | ||
| return "" | ||
|
|
||
| month_number = int(parts[1]) | ||
| if month_number < 1 or month_number > 12: | ||
| return "" | ||
| return "%s %d" % (MONTHS[month_number - 1][1], int(parts[2])) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
USGS HANS newestForVolcano API sentUtc field format
💡 Result:
In the USGS Hazard Notification System (HANS) API, the sentUtc field generally follows the format: "YYYY-MM-DD HH:MM:SS" [1][2][3]. This represents the date and time the notice was sent in Coordinated Universal Time (UTC) [1]. For example, API responses show values such as "2026-07-03 20:06:55" and "2026-06-09 18:15:37" [2][3]. This field provides a standardized timestamp independent of local time zones for the various observatories [1]. Users should note that while this format is consistent in many HANS API endpoints, API implementations can occasionally vary or be updated, so it is recommended to verify the specific output for the endpoint being used [4][1].
Citations:
- 1: https://volcanoes.usgs.gov/hans-public/api/search/search
- 2: https://volcanoes.usgs.gov/vsc/api/volcanoApi/elevated
- 3: https://volcanoes.usgs.gov/vsc/api/volcanoApi/elevated?obs=avo
- 4: https://volcanoes.usgs.gov/vsc/api/
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the relevant function with line numbers.
sed -n '560,630p' apps/kilaueaactivity/kilaueaactivity.star | cat -n
printf '\n--- sentUtc usages ---\n'
rg -n 'sentUtc|short_date\(' apps/kilaueaactivity/kilaueaactivity.starRepository: tronbyt/apps
Length of output: 2867
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- payload -> sent_date path ---'
sed -n '840,890p' apps/kilaueaactivity/kilaueaactivity.star | cat -n
printf '\n%s\n' '--- all sentUtc examples across repo ---'
rg -n '"sentUtc"|sentUtc' .
printf '\n%s\n' '--- nearby tests/fixtures for short_date or sent_date ---'
rg -n 'short_date|sent_date|sentUtc' apps/kilaueaactivity -A3 -B3Repository: tronbyt/apps
Length of output: 7063
Strip the time portion before parsing sentUtc. HANS sentUtc values include a time component (for example 2026-07-03 20:06:55), so split("-") makes parts[2] non-numeric and int(...) can raise. Parse only the YYYY-MM-DD prefix to keep the detail view from crashing.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/kilaueaactivity/kilaueaactivity.star` around lines 592 - 600, Update
short_date to strip the time component from sent_utc before splitting and
parsing the date, ensuring the year-month-day prefix is used so the day
conversion remains numeric and invalid input still returns an empty string.
There was a problem hiding this comment.
Does this make sense to do or is coderabbit a dummy ?
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
ast-grep outline apps/kilaueaactivity/kilaueaactivity.star \
--items all \
--type function \
--match 'normalize_notice|short_date|detail_line'
printf '\n--- normalization and date-display path ---\n'
rg -n -A90 -B10 'def normalize_notice\(|def short_date\(|def detail_line\(' \
apps/kilaueaactivity/kilaueaactivity.star
printf '\n--- date-related test coverage ---\n'
rg -n -A4 -B4 'short_date|sent_date|sentUtc' apps/kilaueaactivityLength of output: 13176
@tavdog — the Comment image shows a small dark blue/purple starfield thumbnail with scattered pale stars and a faint central glow; no text or controls are visible.
This one makes sense. The live path copies payload["sentUtc"] directly into sent_date (Line 870), and short_date() later does int(parts[2]) (Line 600). For a normal timestamp like 2026-07-03 20:06:55, parts[2] becomes "03 20:06:55", causing a conversion error when the detail view renders.
The fixtures use date-only values, so they mask the problem.
A minimal safe fix is:
def short_date(sent_utc):
date = sent_utc.split(" ")[0]
parts = date.split("-")
if len(parts) != 3:
return ""
month_number = int(parts[1])
if month_number < 1 or month_number > 12:
return ""
return "%s %d" % (MONTHS[month_number - 1][1], int(parts[2]))So: not a dummy finding—just a slightly overdramatic severity label for a small, valid defensive parsing fix.
tavdog
left a comment
There was a problem hiding this comment.
very nice complement to the cam app ! Does the coderabbit suggestion make sense at all ? If not then I approve.
Hide the app when the current USGS alert level is below the configured threshold. Co-authored-by: Cursor <cursoragent@cursor.com>
Kīlauea Activity
Adds a new 64×32 app that turns Kīlauea's latest official USGS status into an original animated pixel-art caldera.
This intentionally complements the existing
kilaueawebcam app rather than replacing it. No existing app files are changed: users can choose between live webcam imagery and this data-driven visual interpretation.What it shows
Data and reliability
332010:https://volcanoes.usgs.gov/hans-public/api/volcano/newestForVolcano/332010.noticeSectionsentry by volcano number rather than trusting notice-wide maximum fields.Validation
pixlet format --dry-runandpixlet lintpass.pixlet check apps/kilaueaactivitypasses with the repository-pinned Tronbyt Pixlet v0.50.1 and current v0.53.1.Development source and tests: https://github.com/daveshilobod/tidbyt-kilauea
Summary by CodeRabbit