mirror of
https://github.com/craigerl/aprsd.git
synced 2026-06-16 21:08:36 -04:00
feat: add APRS Chat bulletin script
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
# APRS Chat Bulletin Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** Add a standalone bulletin script that announces APRS Chat on Google Play and includes short follow-up bulletin lines.
|
||||
|
||||
**Architecture:** Add one new shell script in `tools/` that matches the existing bulletin-script pattern already used in this repo, with a minimal `set -e` safety guard so failures are not masked by later `sleep` commands. Protect the behavior with one focused Python regression test that checks the script path, executable bit, and exact bulletin command lines.
|
||||
|
||||
**Tech Stack:** Bash, pytest, Python `pathlib`
|
||||
|
||||
---
|
||||
|
||||
## File Structure
|
||||
|
||||
| File | Action | Responsibility |
|
||||
|------|--------|----------------|
|
||||
| `tools/bulletin-aprschat.sh` | Create | Standalone APRS Chat Google Play bulletin sender |
|
||||
| `tests/test_bulletin_scripts.py` | Create | Regression test for bulletin script presence and content |
|
||||
|
||||
---
|
||||
|
||||
## Chunk 1: APRS Chat Bulletin Script
|
||||
|
||||
### Task 1: Add the bulletin script with a focused regression test
|
||||
|
||||
**Files:**
|
||||
- Create: `tests/test_bulletin_scripts.py`
|
||||
- Create: `tools/bulletin-aprschat.sh`
|
||||
|
||||
- [ ] **Step 1: Write the failing test**
|
||||
|
||||
Create `tests/test_bulletin_scripts.py` with:
|
||||
|
||||
```python
|
||||
import stat
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_bulletin_aprschat_script_contents():
|
||||
repo_root = Path(__file__).resolve().parents[1]
|
||||
script = repo_root / 'tools' / 'bulletin-aprschat.sh'
|
||||
|
||||
assert script.exists()
|
||||
assert script.stat().st_mode & stat.S_IXUSR
|
||||
|
||||
lines = script.read_text().splitlines()
|
||||
send_lines = [line for line in lines if line.startswith('aprsd send-message -n')]
|
||||
|
||||
assert send_lines == [
|
||||
'aprsd send-message -n BLN0 "APRS Chat now on Google Play Store!"',
|
||||
'aprsd send-message -n BLN1 "Install: https://tinyurl.com/APRSChat"',
|
||||
'aprsd send-message -n BLN2 "Android app for APRS chat and messaging"',
|
||||
'aprsd send-message -n BLN3 "Search Google Play for APRS Chat"',
|
||||
]
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Run test to verify it fails**
|
||||
|
||||
Run: `pytest tests/test_bulletin_scripts.py -v`
|
||||
Expected: FAIL because `tools/bulletin-aprschat.sh` does not exist yet.
|
||||
|
||||
- [ ] **Step 3: Write the minimal implementation**
|
||||
|
||||
Create `tools/bulletin-aprschat.sh` with:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Send APRS bulletins announcing APRS Chat on Google Play
|
||||
|
||||
source ~/devel/mine/hamradio/aprsd/.venv/bin/activate
|
||||
|
||||
export APRS_LOGIN=WB4BOR
|
||||
export APRS_PASSWORD=24496
|
||||
|
||||
aprsd send-message -n BLN0 "APRS Chat now on Google Play Store!"
|
||||
sleep 2
|
||||
aprsd send-message -n BLN1 "Install: https://tinyurl.com/APRSChat"
|
||||
sleep 2
|
||||
aprsd send-message -n BLN2 "Android app for APRS chat and messaging"
|
||||
sleep 2
|
||||
aprsd send-message -n BLN3 "Search Google Play for APRS Chat"
|
||||
sleep 2
|
||||
```
|
||||
|
||||
- [ ] **Step 4: Make the script executable**
|
||||
|
||||
Run: `chmod +x tools/bulletin-aprschat.sh`
|
||||
|
||||
- [ ] **Step 5: Run test to verify it passes**
|
||||
|
||||
Run: `pytest tests/test_bulletin_scripts.py -v`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 6: Run a second verification pass**
|
||||
|
||||
Run: `bash -n tools/bulletin-aprschat.sh && pytest tests/test_bulletin_scripts.py -v`
|
||||
Expected: PASS
|
||||
|
||||
- [ ] **Step 7: Commit**
|
||||
|
||||
```bash
|
||||
git add tests/test_bulletin_scripts.py tools/bulletin-aprschat.sh
|
||||
git commit -m "Add APRS Chat bulletin script"
|
||||
```
|
||||
@@ -0,0 +1,66 @@
|
||||
# APRS Chat Google Play Bulletin Script
|
||||
|
||||
**Date:** 2026-05-21
|
||||
**Status:** Draft
|
||||
**Scope:** `tools/` bulletin helper scripts
|
||||
|
||||
## Overview
|
||||
|
||||
Add a new standalone bulletin script that announces APRS Chat on the Google Play Store and follows with a few short explanatory bulletin lines.
|
||||
|
||||
## Goals
|
||||
|
||||
1. Add a dedicated script for the APRS Chat Play Store announcement.
|
||||
2. Match the existing `tools/bulletin-*.sh` style and operational pattern.
|
||||
3. Keep bulletin text short, direct, and suitable for APRS bulletin usage.
|
||||
|
||||
## Current State
|
||||
|
||||
- Existing bulletin scripts in `tools/` are small standalone shell wrappers.
|
||||
- They activate the local virtual environment, export APRS credentials, send a few `BLN` messages, and pause with `sleep 2` between lines.
|
||||
- There is no dedicated APRS Chat Google Play bulletin script today.
|
||||
|
||||
## Design
|
||||
|
||||
### Script Shape
|
||||
|
||||
Create `tools/bulletin-aprschat.sh` using the same pattern as `tools/bulletin-aprsthursday.sh`, with one small safety improvement so the script exits immediately if activation or any bulletin send fails:
|
||||
|
||||
- `#!/bin/bash`
|
||||
- `set -e`
|
||||
- brief header comment describing purpose
|
||||
- `source ~/devel/mine/hamradio/aprsd/.venv/bin/activate`
|
||||
- export `APRS_LOGIN=WB4BOR` and `APRS_PASSWORD=24496`
|
||||
- send four numbered bulletin messages with `aprsd send-message -n BLN* ...`
|
||||
- pause with `sleep 2` between each message
|
||||
|
||||
### Bulletin Content
|
||||
|
||||
The script will send these lines:
|
||||
|
||||
1. `BLN0 APRS Chat now on Google Play Store!`
|
||||
2. `BLN1 Install: https://tinyurl.com/APRSChat`
|
||||
3. `BLN2 Android app for APRS chat and messaging`
|
||||
4. `BLN3 Search Google Play for APRS Chat`
|
||||
|
||||
This keeps the first line focused on the announcement, the second on the install URL, and the remaining lines as short follow-up guidance.
|
||||
|
||||
## Files to Modify
|
||||
|
||||
1. `tools/bulletin-aprschat.sh` - new standalone bulletin script
|
||||
2. `tests/test_bulletin_scripts.py` - regression test for script content and expected bulletin lines
|
||||
|
||||
## Testing Strategy
|
||||
|
||||
1. Write a failing test first asserting:
|
||||
- the new script exists
|
||||
- it is executable
|
||||
- it contains the expected ordered `BLN0`-`BLN3` send lines
|
||||
2. Add the script with the approved content.
|
||||
3. Re-run the focused test to confirm it passes.
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- Refactoring existing bulletin scripts into a shared helper
|
||||
- Folding the APRS Chat announcement into `tools/bulletin.sh`
|
||||
- Adding scheduling or automation around bulletin execution
|
||||
@@ -0,0 +1,20 @@
|
||||
import stat
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_bulletin_aprschat_script_contents():
|
||||
repo_root = Path(__file__).resolve().parents[1]
|
||||
script = repo_root / 'tools' / 'bulletin-aprschat.sh'
|
||||
|
||||
assert script.exists()
|
||||
assert script.stat().st_mode & stat.S_IXUSR
|
||||
|
||||
lines = script.read_text().splitlines()
|
||||
send_lines = [line for line in lines if line.startswith('aprsd send-message -n')]
|
||||
|
||||
assert send_lines == [
|
||||
'aprsd send-message -n BLN0 "APRS Chat now on Google Play Store!"',
|
||||
'aprsd send-message -n BLN1 "Install: https://tinyurl.com/APRSChat"',
|
||||
'aprsd send-message -n BLN2 "Android app for APRS chat and messaging"',
|
||||
'aprsd send-message -n BLN3 "Search Google Play for APRS Chat"',
|
||||
]
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# Send APRS bulletins announcing APRS Chat on Google Play
|
||||
|
||||
set -e
|
||||
|
||||
source ~/devel/mine/hamradio/aprsd/.venv/bin/activate
|
||||
|
||||
export APRS_LOGIN=WB4BOR
|
||||
export APRS_PASSWORD=24496
|
||||
|
||||
aprsd send-message -n BLN0 "APRS Chat now on Google Play Store!"
|
||||
sleep 2
|
||||
aprsd send-message -n BLN1 "Install: https://tinyurl.com/APRSChat"
|
||||
sleep 2
|
||||
aprsd send-message -n BLN2 "Android app for APRS chat and messaging"
|
||||
sleep 2
|
||||
aprsd send-message -n BLN3 "Search Google Play for APRS Chat"
|
||||
sleep 2
|
||||
Reference in New Issue
Block a user