feat(cli): add trip reports command#83
Conversation
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 51 minutes and 15 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR implements the complete ChangesTrip-Reports CLI Implementation
Sequence DiagramsequenceDiagram
participant User
participant CLI as trip-reports Command
participant Collector as TripReportCollector
participant Client as PeakBaggerClient
participant Scraper as PeakBaggerScraper
participant Formatter as PeakFormatter
User->>CLI: peakbagger trip-reports <peak_id> --limit 5
CLI->>CLI: validate filters & dates
CLI->>Client: create connection
CLI->>Collector: create with client/scraper
CLI->>Collector: collect(peak_id, limit=5, ...)
Collector->>Client: get(summary_url)
Client-->>Collector: summary_html
Collector->>Scraper: parse_peak_ascents(html)
Scraper-->>Collector: list[Ascent]
Collector->>Collector: filter summaries (date, trip-report presence)
loop for each candidate ascent
Collector->>Client: get(detail_url)
Client-->>Collector: detail_html
Collector->>Scraper: parse_ascent_detail(html)
Scraper-->>Collector: Ascent with trip_report_text
Collector->>Collector: validate text & word_count
alt word_count >= min_words
Collector->>Collector: build TripReport
else skip
end
end
Collector-->>CLI: list[TripReport]
CLI->>Formatter: format_trip_reports(reports, format="text")
Formatter-->>User: Rich formatted output
CLI->>Client: close()
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #83 +/- ##
==========================================
+ Coverage 93.43% 93.48% +0.05%
==========================================
Files 10 11 +1
Lines 1857 2026 +169
Branches 239 265 +26
==========================================
+ Hits 1735 1894 +159
Misses 84 84
- Partials 38 48 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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 `@docs/superpowers/plans/2026-05-24-trip-reports-command.md`:
- Line 943: The phrase "rate limiting reuse" in the document should be
hyphenated as a compound adjective; locate the occurrence of the text "rate
limiting reuse" (around the summary line containing "summary filtering, date
filters, word-count filters, rate limiting reuse, dump") and change it to
"rate-limiting reuse" to improve readability and maintain consistent technical
style.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8822d109-2f60-4d95-b38f-204568cf2d4a
📒 Files selected for processing (7)
README.mddocs/superpowers/plans/2026-05-24-trip-reports-command.mdpeakbagger/cli.pypeakbagger/formatters.pypeakbagger/models.pypeakbagger/trip_reports.pytests/test_trip_reports.py
Addressed in 116e350; latest CodeRabbit check is passing.
Babysit PR summaryPR: #83 Required CIPass: Required Checks and dependency-review are green. What changed
Review feedback
Remaining risk / notes
Ready for human merge?Yes: PR is clean, all checks are passing, and reviewDecision is clear. |
Who's affected
CLI users and automation that need full PeakBagger trip report text for a peak.
What changed
Before this change, callers had to list peak ascents, pick ascent IDs with trip reports, call
ascent showrepeatedly, and filter short reports themselves.This adds
peakbagger trip-reports PEAK_ID, which returns detailed trip report records in one CLI invocation. The command supports--limit,--min-words,--within,--after,--before,--format, and--rate-limit. JSON output is a parseable list with ascent ID/URL, climber, date, full report text, word count, GPX availability, route, and external URL when present.Invalid filter combinations and malformed filters are rejected before network work at both the CLI and collector boundaries. The collector applies summary filters before detail-page fetches and treats
limitas the maximum returned reports after detail validation.Refs #82 and dreamiurg/claude-mountaineering-skills#35.
Notable decisions
PeakBagger does not expose full report text from the ascent summary page, so this is one CLI call for callers but internally performs one summary request plus selected detail requests. That keeps the caller contract simple while still respecting the existing rate-limited client.
CodeRabbit CLI review was requested but could not run because agent-mode auth is not configured.
coderabbit auth status --agentreturnednot_authenticated;coderabbit auth login --agenttimed out waiting for browser authentication.Agent context
trip-reports; new JSON output contract forTripReportrecords.peak,peak ascents,peak stats, orascent showcommand contracts.Verification
uv run pytest tests/test_trip_reports.py -v: 24 passeduv run ruff format --check peakbagger tests: 23 files already formatteduv run ruff check peakbagger tests: passeduv run ty check: exit 0, with two pre-existing warnings in untouched filesuv run pytest: 203 passed, 3 skippeduv run peakbagger trip-reports --help: rendered expected command help