Skip to content

Add Scheduled Job #19

@leogdion

Description

@leogdion

Goal

Add GitHub Actions workflow for automated RSS feed updates with smart scheduling based on feed quality, popularity, and staleness.

Implementation Approach

Phase 1: Pragmatic Solution (2-3 hours)

Quick implementation using existing CLI options:

  • ✅ Multi-tier scheduling (high-priority hourly, standard 6h, stale daily)
  • ✅ Uses --min-popularity and --max-failures for filtering
  • ✅ No code changes required
  • ❌ No quality-score filtering yet (uses popularity as proxy)

Phase 2: Complete Solution (6-8 hours)

Enhanced CLI with true smart scheduling:

  • ✅ Add --min-quality-score, --featured-only, --verified-only filters
  • ✅ Add --sort-by option (quality/popularity/staleness/mixed)
  • ✅ Add --limit control
  • ✅ 4-tier scheduling (featured 30min, high hourly, standard 6h, stale daily)

Smart Scheduling Tiers

Tier 1 - Featured/Verified (Every 30 min):

  • Target: Featured OR verified feeds
  • Priority: Highest (trusted sources)

Tier 2 - High Quality (Hourly):

  • Target: qualityScore >= 75 AND subscriberCount >= 50
  • Priority: High (proven quality)

Tier 3 - Standard (Every 6 hours):

  • Target: qualityScore 50-74 OR high subscriber count
  • Priority: Medium (active feeds)

Tier 4 - Stale (Daily):

  • Target: lastAttempted > 7 days ago
  • Priority: Catch-up (missed updates)

Required Setup

GitHub Secrets (Settings → Secrets and variables → Actions):

  1. CLOUDKIT_CONTAINER_ID - Container identifier
  2. CLOUDKIT_KEY_ID - Server-to-Server key ID
  3. CLOUDKIT_PRIVATE_KEY - Full PEM file contents

Files to Create/Modify

Phase 1

  • Create: .github/workflows/update-feeds.yml (~250 lines)

Phase 2

  • Modify: Sources/CelestraCloud/Commands/UpdateCommand.swift (+120 lines)
  • Modify: Sources/CelestraCloudKit/Services/CloudKitService+Celestra.swift (+80 lines)
  • Create: .github/workflows/update-feeds-smart.yml (~400 lines)
  • Update: CLAUDE.md (document new features)

Resource Analysis

GitHub Actions: Unlimited minutes (public repo)
CloudKit: Free within limits (50K req/day well within 4M limit)
Processing Capacity: ~1,000-1,500 feeds/day

Success Criteria

  • ✅ High-priority feeds update hourly
  • ✅ Standard feeds update every 6 hours
  • ✅ Stale feeds caught up daily
  • ✅ Success rate > 90% for quality feeds
  • ✅ Rate limiting and robots.txt respected
  • ✅ CloudKit authentication reliable

Testing Strategy

  1. Set up GitHub secrets
  2. Create Phase 1 workflow
  3. Test via manual dispatch
  4. Monitor first scheduled run
  5. Implement Phase 2 enhancements (optional)
  6. Tune thresholds based on monitoring

Recommendation

Start with Phase 1 for quick wins, then implement Phase 2 for optimal smart scheduling.

See detailed implementation plan in Claude Code plan file for full technical details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions