source_monitor 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.claude/agent-memory/vbw-vbw-dev/MEMORY.md +34 -0
- data/.claude/agent-memory/vbw-vbw-lead/MEMORY.md +49 -0
- data/.claude/commands/release.md +255 -0
- data/.claude/skills/sm-configure/SKILL.md +13 -2
- data/.claude/skills/sm-configure/reference/configuration-reference.md +33 -0
- data/.claude/skills/sm-host-setup/SKILL.md +21 -3
- data/.claude/skills/sm-host-setup/reference/setup-checklist.md +36 -0
- data/.claude/skills/sm-job/SKILL.md +10 -9
- data/.gitignore +4 -0
- data/.vbw-planning/REQUIREMENTS.md +22 -0
- data/.vbw-planning/ROADMAP.md +125 -0
- data/.vbw-planning/STATE.md +43 -0
- data/.vbw-planning/config.json +3 -1
- data/.vbw-planning/discovery.json +3 -1
- data/.vbw-planning/phases/01-generator-steps/01-CONTEXT.md +33 -0
- data/.vbw-planning/phases/01-generator-steps/01-VERIFICATION.md +86 -0
- data/.vbw-planning/phases/01-generator-steps/PLAN-01-SUMMARY.md +61 -0
- data/.vbw-planning/phases/01-generator-steps/PLAN-01.md +380 -0
- data/.vbw-planning/phases/02-verification/02-VERIFICATION.md +78 -0
- data/.vbw-planning/phases/02-verification/PLAN-01-SUMMARY.md +46 -0
- data/.vbw-planning/phases/02-verification/PLAN-01.md +500 -0
- data/.vbw-planning/phases/03-docs-alignment/03-VERIFICATION.md +89 -0
- data/.vbw-planning/phases/03-docs-alignment/PLAN-01-SUMMARY.md +48 -0
- data/.vbw-planning/phases/03-docs-alignment/PLAN-01.md +456 -0
- data/.vbw-planning/phases/04-dashboard-ux/04-VERIFICATION.md +129 -0
- data/.vbw-planning/phases/04-dashboard-ux/PLAN-01-SUMMARY.md +70 -0
- data/.vbw-planning/phases/04-dashboard-ux/PLAN-01.md +747 -0
- data/.vbw-planning/phases/05-active-storage-images/05-VERIFICATION.md +156 -0
- data/.vbw-planning/phases/05-active-storage-images/PLAN-01-SUMMARY.md +69 -0
- data/.vbw-planning/phases/05-active-storage-images/PLAN-01.md +455 -0
- data/.vbw-planning/phases/05-active-storage-images/PLAN-02-SUMMARY.md +39 -0
- data/.vbw-planning/phases/05-active-storage-images/PLAN-02.md +488 -0
- data/.vbw-planning/phases/06-netflix-feed-fix/06-VERIFICATION.md +100 -0
- data/.vbw-planning/phases/06-netflix-feed-fix/PLAN-01-SUMMARY.md +37 -0
- data/.vbw-planning/phases/06-netflix-feed-fix/PLAN-01.md +345 -0
- data/CHANGELOG.md +43 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/app/assets/builds/source_monitor/application.css +9 -0
- data/app/helpers/source_monitor/application_helper.rb +38 -0
- data/app/jobs/source_monitor/download_content_images_job.rb +72 -0
- data/app/models/source_monitor/item_content.rb +2 -0
- data/app/views/source_monitor/dashboard/_recent_activity.html.erb +9 -0
- data/app/views/source_monitor/items/_details.html.erb +2 -2
- data/app/views/source_monitor/logs/index.html.erb +9 -0
- data/app/views/source_monitor/sources/_details.html.erb +2 -2
- data/app/views/source_monitor/sources/_row.html.erb +1 -1
- data/docs/setup.md +13 -4
- data/docs/troubleshooting.md +38 -7
- data/lib/generators/source_monitor/install/install_generator.rb +201 -0
- data/lib/source_monitor/configuration/http_settings.rb +7 -1
- data/lib/source_monitor/configuration/images_settings.rb +37 -0
- data/lib/source_monitor/configuration.rb +3 -1
- data/lib/source_monitor/dashboard/queries/recent_activity_query.rb +16 -7
- data/lib/source_monitor/dashboard/recent_activity.rb +1 -0
- data/lib/source_monitor/dashboard/recent_activity_presenter.rb +15 -2
- data/lib/source_monitor/fetching/feed_fetcher/entry_processor.rb +13 -0
- data/lib/source_monitor/http.rb +23 -0
- data/lib/source_monitor/images/content_rewriter.rb +81 -0
- data/lib/source_monitor/images/downloader.rb +82 -0
- data/lib/source_monitor/logs/table_presenter.rb +25 -0
- data/lib/source_monitor/setup/procfile_patcher.rb +31 -0
- data/lib/source_monitor/setup/queue_config_patcher.rb +84 -0
- data/lib/source_monitor/setup/verification/recurring_schedule_verifier.rb +102 -0
- data/lib/source_monitor/setup/verification/runner.rb +1 -1
- data/lib/source_monitor/setup/verification/solid_queue_verifier.rb +1 -1
- data/lib/source_monitor/setup/workflow.rb +10 -0
- data/lib/source_monitor/version.rb +1 -1
- data/lib/source_monitor.rb +8 -0
- metadata +34 -3
- data/.vbw-planning/.notification-log.jsonl +0 -294
- data/.vbw-planning/.session-log.jsonl +0 -1376
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<!-- VBW ROADMAP -- Phase decomposition with requirement mapping -->
|
|
2
|
+
<!-- Created during /vbw scope -->
|
|
3
|
+
|
|
4
|
+
# SourceMonitor Generator Enhancements Roadmap
|
|
5
|
+
|
|
6
|
+
**Milestone:** generator-enhancements
|
|
7
|
+
**Goal:** Make the install generator and verification suite catch the two most common host-app setup failures: missing Procfile.dev jobs entry and missing recurring_schedule dispatcher wiring.
|
|
8
|
+
|
|
9
|
+
## Phases
|
|
10
|
+
|
|
11
|
+
1. [x] ~~Phase 0: Documentation Gaps~~ (shipped via quick fix ea788ea)
|
|
12
|
+
2. [x] Phase 1: Install Generator Steps (Procfile.dev + Queue Config)
|
|
13
|
+
3. [x] Phase 2: Recurring Schedule Verifier
|
|
14
|
+
4. [x] Phase 3: Skills & Documentation Alignment
|
|
15
|
+
5. [x] Phase 4: Dashboard UX Improvements
|
|
16
|
+
6. [x] Phase 5: Active Storage Image Downloads
|
|
17
|
+
7. [x] Phase 6: Netflix Feed Investigation
|
|
18
|
+
|
|
19
|
+
## Phase Details
|
|
20
|
+
|
|
21
|
+
### Phase 1: Install Generator Steps
|
|
22
|
+
|
|
23
|
+
**Goal:** Add two new idempotent steps to the install generator: (a) patch `Procfile.dev` with a `jobs:` entry for Solid Queue, and (b) patch the queue config dispatcher with `recurring_schedule: config/recurring.yml`.
|
|
24
|
+
|
|
25
|
+
**Requirements:** REQ-16, REQ-17, REQ-18
|
|
26
|
+
|
|
27
|
+
**Success Criteria:**
|
|
28
|
+
- `bin/rails generate source_monitor:install` patches Procfile.dev when present (idempotent, skip if entry exists)
|
|
29
|
+
- `bin/rails generate source_monitor:install` patches queue.yml dispatcher with recurring_schedule (idempotent)
|
|
30
|
+
- Both steps wired into `Setup::Workflow` for the guided installer
|
|
31
|
+
- Generator tests cover: fresh file, existing file with entry, existing file without entry, missing file
|
|
32
|
+
- `bin/rails test` passes, RuboCop clean
|
|
33
|
+
|
|
34
|
+
### Phase 2: Recurring Schedule Verifier
|
|
35
|
+
|
|
36
|
+
**Goal:** Add a `RecurringScheduleVerifier` to the verification suite that checks whether recurring tasks are actually registered with Solid Queue dispatchers, and enhance the existing `SolidQueueVerifier` to suggest Procfile.dev when workers aren't detected.
|
|
37
|
+
|
|
38
|
+
**Requirements:** REQ-19, REQ-20
|
|
39
|
+
|
|
40
|
+
**Success Criteria:**
|
|
41
|
+
- `bin/source_monitor verify` checks that recurring tasks are registered (not just that workers heartbeat)
|
|
42
|
+
- Warning when no recurring tasks found with actionable remediation message
|
|
43
|
+
- SolidQueueVerifier remediation mentions Procfile.dev for `bin/dev` users
|
|
44
|
+
- Verifier tests with mocked Solid Queue state
|
|
45
|
+
- `bin/rails test` passes, RuboCop clean
|
|
46
|
+
|
|
47
|
+
### Phase 3: Skills & Documentation Alignment
|
|
48
|
+
|
|
49
|
+
**Goal:** Update all `sm-*` skills and docs to reflect that the generator now automatically handles Procfile.dev and recurring_schedule wiring. Remove manual steps that are now automated.
|
|
50
|
+
|
|
51
|
+
**Requirements:** REQ-21
|
|
52
|
+
|
|
53
|
+
**Success Criteria:**
|
|
54
|
+
- sm-host-setup skill reflects new generator capabilities (auto-patching, not manual steps)
|
|
55
|
+
- sm-configure skill references the automatic recurring_schedule wiring
|
|
56
|
+
- docs/setup.md updated to note the generator handles both automatically
|
|
57
|
+
- docs/troubleshooting.md updated with improved diagnostics
|
|
58
|
+
- setup-checklist.md reflects automation (checked by default, not manual)
|
|
59
|
+
|
|
60
|
+
### Phase 4: Dashboard UX Improvements
|
|
61
|
+
|
|
62
|
+
**Goal:** Show source URLs in fetch log entries for both successes and failures on the dashboard, and make links to sources and items clickable (opening in a new tab).
|
|
63
|
+
|
|
64
|
+
**Requirements:** REQ-22, REQ-23
|
|
65
|
+
|
|
66
|
+
**Success Criteria:**
|
|
67
|
+
- Fetch log entries on the dashboard display the source URL alongside the existing summary
|
|
68
|
+
- Both success and failure fetch logs show the URL
|
|
69
|
+
- Source names and item titles are clickable links that open in a new tab
|
|
70
|
+
- Existing dashboard layout is preserved
|
|
71
|
+
- `bin/rails test` passes, RuboCop clean
|
|
72
|
+
|
|
73
|
+
### Phase 5: Active Storage Image Downloads
|
|
74
|
+
|
|
75
|
+
**Goal:** Add a configurable option to download inline images from feed items to Active Storage instead of loading them directly from the source URL. This prevents broken images when sources go offline and improves page load performance.
|
|
76
|
+
|
|
77
|
+
**Requirements:** REQ-24
|
|
78
|
+
|
|
79
|
+
**Success Criteria:**
|
|
80
|
+
- New configuration option (`config.images.download_to_active_storage` or similar) defaults to `false`
|
|
81
|
+
- When enabled, inline images in item content are detected and downloaded to Active Storage
|
|
82
|
+
- Original image URLs are replaced with Active Storage URLs in the stored content
|
|
83
|
+
- Images that fail to download gracefully fall back to original URLs
|
|
84
|
+
- Configuration is documented in sm-configure skill
|
|
85
|
+
- `bin/rails test` passes, RuboCop clean
|
|
86
|
+
|
|
87
|
+
### Phase 6: Netflix Feed Investigation
|
|
88
|
+
|
|
89
|
+
**Goal:** Investigate and fix the failing fetch for `https://netflixtechblog.com/feed`. Determine whether the issue is in the feed parser, HTTP client configuration, or content format, and apply appropriate fixes.
|
|
90
|
+
|
|
91
|
+
**Requirements:** REQ-25
|
|
92
|
+
|
|
93
|
+
**Success Criteria:**
|
|
94
|
+
- Root cause identified and documented
|
|
95
|
+
- Fix applied (parser, HTTP client, or configuration change)
|
|
96
|
+
- Netflix Tech Blog feed fetches successfully
|
|
97
|
+
- No regressions in other feed types
|
|
98
|
+
- `bin/rails test` passes, RuboCop clean
|
|
99
|
+
|
|
100
|
+
## Progress
|
|
101
|
+
|
|
102
|
+
| Phase | Status | Plans |
|
|
103
|
+
|-------|--------|-------|
|
|
104
|
+
| 0 | Complete | - |
|
|
105
|
+
| 1 | Complete | PLAN-01 (5 tasks, 4 commits) |
|
|
106
|
+
| 2 | Complete | PLAN-01 (5 tasks, 1 commit) |
|
|
107
|
+
| 3 | Complete | PLAN-01 (5 tasks, 1 commit) |
|
|
108
|
+
| 4 | Complete | PLAN-01 (5 tasks, 5 commits) |
|
|
109
|
+
| 5 | Complete | PLAN-01 (4 tasks, 5 commits) + PLAN-02 (4 tasks, 4 commits) |
|
|
110
|
+
| 6 | Complete | PLAN-01 (5 tasks, 5 commits) |
|
|
111
|
+
|
|
112
|
+
## Requirement Mapping
|
|
113
|
+
|
|
114
|
+
| REQ | Phase | Description |
|
|
115
|
+
|-----|-------|-------------|
|
|
116
|
+
| REQ-16 | 1 | Generator patches Procfile.dev with jobs: entry |
|
|
117
|
+
| REQ-17 | 1 | Generator patches queue config with recurring_schedule |
|
|
118
|
+
| REQ-18 | 1 | Guided workflow integrates both new steps |
|
|
119
|
+
| REQ-19 | 2 | RecurringScheduleVerifier checks recurring task registration |
|
|
120
|
+
| REQ-20 | 2 | SolidQueueVerifier remediation mentions Procfile.dev |
|
|
121
|
+
| REQ-21 | 3 | Skills and docs reflect automated setup |
|
|
122
|
+
| REQ-22 | 4 | Fetch logs show source URL on dashboard |
|
|
123
|
+
| REQ-23 | 4 | Dashboard links clickable in new tab |
|
|
124
|
+
| REQ-24 | 5 | Download inline images to Active Storage |
|
|
125
|
+
| REQ-25 | 6 | Fix Netflix Tech Blog feed fetch |
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- VBW STATE -- Current milestone progress -->
|
|
2
|
+
|
|
3
|
+
# State
|
|
4
|
+
|
|
5
|
+
**Milestone:** generator-enhancements
|
|
6
|
+
**Current Phase:** All phases complete
|
|
7
|
+
**Status:** Ready for archive
|
|
8
|
+
**Date:** 2026-02-12
|
|
9
|
+
|
|
10
|
+
## Progress
|
|
11
|
+
|
|
12
|
+
- Phase 0: Complete (quick fix ea788ea)
|
|
13
|
+
- Phase 1: Complete (1 plan, 5 tasks, 4 commits)
|
|
14
|
+
- Phase 2: Complete (1 plan, 5 tasks, 1 commit)
|
|
15
|
+
- Phase 3: Complete (1 plan, 5 tasks, 1 commit) -- QA PASS
|
|
16
|
+
- Phase 4: Complete (1 plan, 5 tasks, 5 commits) -- QA PASS 23/23
|
|
17
|
+
- Phase 5: Complete (2 plans, 9 tasks, 9 commits) -- QA PASS 34/34
|
|
18
|
+
- Phase 6: Complete (1 plan, 5 tasks, 5 commits) -- QA PASS 18/18
|
|
19
|
+
|
|
20
|
+
## Decisions
|
|
21
|
+
|
|
22
|
+
| Decision | Date | Rationale |
|
|
23
|
+
|----------|------|-----------|
|
|
24
|
+
| Docs-first approach | 2026-02-11 | Shipped doc fixes before code changes to unblock users immediately |
|
|
25
|
+
| 3 phases for code changes | 2026-02-11 | Generator steps, verification, then docs alignment -- each independently testable |
|
|
26
|
+
| Always create/patch Procfile.dev | 2026-02-11 | Maximum hand-holding for host app setup |
|
|
27
|
+
| Target queue.yml only | 2026-02-11 | Rails 8 default, no legacy naming support |
|
|
28
|
+
| External links open new tab with icon | 2026-02-12 | Consistent UX for all external URLs across dashboard, logs, sources, items |
|
|
29
|
+
| Fetch log URL display: domain for RSS, item URL for scrapes | 2026-02-12 | User requested contextual URL display based on event type |
|
|
30
|
+
| Image downloads via background job to ItemContent | 2026-02-12 | Content images only, opt-in via config.images.download_to_active_storage |
|
|
31
|
+
| SSL fix: general cert store config, not Netflix-specific | 2026-02-12 | OpenSSL::X509::Store#set_default_paths on every Faraday connection |
|
|
32
|
+
|
|
33
|
+
## Metrics
|
|
34
|
+
|
|
35
|
+
| Metric | Value |
|
|
36
|
+
|--------|-------|
|
|
37
|
+
| Phases | 7 (Phase 0-6) |
|
|
38
|
+
| Plans completed | 7 (across all phases) |
|
|
39
|
+
| Tasks completed | 34 |
|
|
40
|
+
| Commits | ~26 |
|
|
41
|
+
| Tests | 973 (up from 841) |
|
|
42
|
+
| RuboCop | 389 files, 0 offenses |
|
|
43
|
+
| Brakeman | 0 warnings |
|
data/.vbw-planning/config.json
CHANGED
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
"User wants comprehensive cleanup, not surface-level",
|
|
20
20
|
"Public API changes are acceptable for convention alignment",
|
|
21
21
|
"Tests should be updated to match any changes, not removed",
|
|
22
|
-
"All layers: models, controllers, services, dead code"
|
|
22
|
+
"All layers: models, controllers, services, dead code",
|
|
23
|
+
"Generator should be maximally helpful -- create files rather than just warn",
|
|
24
|
+
"Target Rails 8 defaults (queue.yml) rather than supporting legacy naming"
|
|
23
25
|
]
|
|
24
26
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Phase 1 Context: Install Generator Steps
|
|
2
|
+
|
|
3
|
+
## User Vision
|
|
4
|
+
Enhance the install generator to automatically handle the two most common Solid Queue setup failures in host apps: missing Procfile.dev jobs entry and missing recurring_schedule dispatcher wiring.
|
|
5
|
+
|
|
6
|
+
## Essential Features
|
|
7
|
+
- Generator creates Procfile.dev if missing (with web: and jobs: entries)
|
|
8
|
+
- Generator patches existing Procfile.dev to add jobs: entry (idempotent)
|
|
9
|
+
- Generator patches config/queue.yml dispatcher with recurring_schedule: config/recurring.yml
|
|
10
|
+
- Both steps integrated into the guided Setup::Workflow
|
|
11
|
+
|
|
12
|
+
## Technical Preferences
|
|
13
|
+
- **Procfile.dev:** Always create/patch -- maximum hand-holding. Create if missing, patch if exists.
|
|
14
|
+
- **Queue config:** Target `config/queue.yml` (Rails 8 default). Don't worry about legacy `solid_queue.yml` naming.
|
|
15
|
+
- Follow existing generator patterns (idempotent, skip-if-present, say_status output)
|
|
16
|
+
|
|
17
|
+
## Boundaries
|
|
18
|
+
- Don't modify any other config files (cable.yml, database.yml, etc.)
|
|
19
|
+
- Don't modify the initializer template
|
|
20
|
+
- Don't change existing generator steps (routes, initializer, recurring.yml)
|
|
21
|
+
- Don't add verification logic here (that's Phase 2)
|
|
22
|
+
|
|
23
|
+
## Acceptance Criteria
|
|
24
|
+
- `bin/rails generate source_monitor:install` creates Procfile.dev with web: + jobs: when none exists
|
|
25
|
+
- `bin/rails generate source_monitor:install` adds jobs: line to existing Procfile.dev without duplicating
|
|
26
|
+
- `bin/rails generate source_monitor:install` adds recurring_schedule to queue.yml dispatcher
|
|
27
|
+
- `bin/source_monitor install` (guided) runs both new steps
|
|
28
|
+
- All existing generator tests still pass
|
|
29
|
+
- New tests cover: fresh Procfile.dev, existing with entry, existing without entry, missing queue.yml
|
|
30
|
+
|
|
31
|
+
## Decisions Made
|
|
32
|
+
- Create Procfile.dev if missing (not just warn)
|
|
33
|
+
- Target config/queue.yml only (Rails 8 default), not solid_queue.yml
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# PLAN-01 Verification Report
|
|
2
|
+
|
|
3
|
+
## Verdict: PASS
|
|
4
|
+
|
|
5
|
+
**Verified by:** QA agent (deep tier, 30 checks)
|
|
6
|
+
**Date:** 2026-02-11
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Functional Verification
|
|
11
|
+
|
|
12
|
+
| # | Check | Result | Notes |
|
|
13
|
+
|---|-------|--------|-------|
|
|
14
|
+
| 1 | Generator tests pass | PASS | 20 runs, 109 assertions, 0 failures, 0 errors |
|
|
15
|
+
| 2 | Workflow tests pass | PASS | 8 runs, 22 assertions, 0 failures, 0 errors |
|
|
16
|
+
| 3 | Full test suite passes | PASS | 867 runs, 2898 assertions, 0 failures, 0 errors |
|
|
17
|
+
| 4 | RuboCop clean | PASS | 376 files inspected, no offenses detected |
|
|
18
|
+
| 5 | Brakeman clean | PASS | 0 warnings, 0 errors |
|
|
19
|
+
|
|
20
|
+
## Code Review Checks
|
|
21
|
+
|
|
22
|
+
| # | Check | Result | Notes |
|
|
23
|
+
|---|-------|--------|-------|
|
|
24
|
+
| 6 | Public method order correct | PASS | Order is: `add_routes_mount` (L17), `create_initializer` (L24), `configure_recurring_jobs` (L36), `patch_procfile_dev` (L52), `configure_queue_dispatcher` (L70), `print_next_steps` (L90) |
|
|
25
|
+
| 7 | `patch_procfile_dev` handles 3 cases | PASS | Create (L64-66), append (L62-63), skip (L57-60) |
|
|
26
|
+
| 8 | `configure_queue_dispatcher` handles 4 cases | PASS | Missing file (L73-76), already configured (L80-83), needs patching (L85-87), no dispatchers (L254-256 via `add_recurring_schedule_to_dispatchers!`) |
|
|
27
|
+
| 9 | Private methods/constants in private section | PASS | `PROCFILE_JOBS_ENTRY` (L104), `RECURRING_SCHEDULE_VALUE` (L201), `DEFAULT_DISPATCHER` (L203), `queue_config_has_recurring_schedule?` (L209), `add_recurring_schedule_to_dispatchers!` (L229) -- all after `private` on L102 |
|
|
28
|
+
| 10 | `frozen_string_literal: true` on all new files | PASS | `procfile_patcher.rb` (L1), `queue_config_patcher.rb` (L1) both have it |
|
|
29
|
+
| 11 | Idempotency: both steps safe to run multiple times | PASS | `patch_procfile_dev`: checks `/^jobs:/` before acting; `configure_queue_dispatcher`: checks `has_recurring_schedule?` before acting. Test `test_does_not_duplicate_jobs_entry_when_rerun` explicitly verifies. |
|
|
30
|
+
| 12 | `YAML.safe_load` uses `aliases: true` | PASS | Generator L78: `YAML.safe_load(File.read(queue_path), aliases: true)`. QueueConfigPatcher L24: `YAML.safe_load(path.read, aliases: true)` |
|
|
31
|
+
| 13 | ProcfilePatcher matches `/^jobs:/` regex | PASS | Both generator (L57) and ProcfilePatcher (L17) use `/^jobs:/` regex |
|
|
32
|
+
| 14 | QueueConfigPatcher recursive dispatcher search | PASS | `has_recurring_schedule?` (L36-53) recursively iterates `parsed.each_value`, checks nested hashes, and also checks top-level `dispatchers` key for flat configs |
|
|
33
|
+
| 15 | Workflow has both new kwargs with defaults | PASS | `procfile_patcher: ProcfilePatcher.new` (L40), `queue_config_patcher: QueueConfigPatcher.new` (L41) |
|
|
34
|
+
| 16 | Workflow calls patchers in correct position | PASS | Called at L73-74, after `initializer_patcher.ensure_navigation_hint` (L72) and before devise check (L76) |
|
|
35
|
+
| 17 | Autoload entries in `lib/source_monitor.rb` | PASS | `ProcfilePatcher` (L164), `QueueConfigPatcher` (L165) both present in `Setup` module autoloads |
|
|
36
|
+
| 18 | No hardcoded paths or env-specific assumptions | PASS | Paths are relative to `destination_root` (generator) or injected via constructor kwargs (patcher classes). No absolute paths. |
|
|
37
|
+
| 19 | Test isolation (no cross-test contamination) | PASS | Generator tests use `prepare_destination` in setup. Workflow tests use Spy/Mock objects for all collaborators. No shared state. WORKER_SUFFIX handles parallel workers. |
|
|
38
|
+
| 20 | `say_status` calls use correct symbols | PASS | `:create` (L66), `:append` (L63), `:skip` (L58, L74, L81), `:info` (L91-99) -- all correct |
|
|
39
|
+
|
|
40
|
+
## Edge Case Verification
|
|
41
|
+
|
|
42
|
+
| # | Check | Result | Notes |
|
|
43
|
+
|---|-------|--------|-------|
|
|
44
|
+
| 21 | Procfile.dev has `jobs:` with different content | PASS | Regex `/^jobs:/` matches any line starting with `jobs:` regardless of the command after it. Correctly skips without overwriting. |
|
|
45
|
+
| 22 | queue.yml nested environments with different dispatchers | PASS | `queue_config_has_recurring_schedule?` recursively walks all hash values. `add_recurring_schedule_to_dispatchers!` processes all nested dispatcher arrays under any env key. Both handle flat and nested configs. |
|
|
46
|
+
| 23 | queue.yml empty/nil after parsing | PASS | L78: `|| {}` ensures nil YAML parse result becomes empty hash. `queue_config_has_recurring_schedule?({})` returns false. `add_recurring_schedule_to_dispatchers!({})` adds default dispatcher section. |
|
|
47
|
+
| 24 | Procfile.dev has trailing newlines | PASS | When appending (L62), uses `puts("", PROCFILE_JOBS_ENTRY)` which adds a blank line before the jobs entry. This handles trailing newlines gracefully -- the blank line acts as separator. |
|
|
48
|
+
| 25 | queue.yml dispatchers is empty array | PASS | If `dispatchers: []`, the `any?` check in `has_recurring_schedule?` returns false (no items to check). `add_recurring_schedule_to_dispatchers!` iterates the empty array (no-op) but sets `found_dispatchers = true` since the key exists. This means an empty dispatchers array stays empty with no recurring_schedule added. **Minor note**: This is a debatable edge case -- an empty dispatchers array means the user intentionally has no dispatchers, so not adding one is reasonable behavior. |
|
|
49
|
+
|
|
50
|
+
## Requirements Verification
|
|
51
|
+
|
|
52
|
+
| # | Check | Result | Notes |
|
|
53
|
+
|---|-------|--------|-------|
|
|
54
|
+
| 26 | REQ-16: Generator patches Procfile.dev | PASS | `patch_procfile_dev` creates/appends/skips as needed. 4 tests cover all scenarios. |
|
|
55
|
+
| 27 | REQ-17: Generator patches queue.yml | PASS | `configure_queue_dispatcher` patches/skips/handles-missing as needed. 4 tests cover all scenarios. |
|
|
56
|
+
| 28 | REQ-18: Workflow integrates both | PASS | `workflow.rb` L73-74 calls both patchers. Workflow test L96-97 verifies both are called. |
|
|
57
|
+
| 29 | Test count increased | PASS | Was 841, now 867 (+26 tests: 8 new generator tests + 18 other additions from this phase) |
|
|
58
|
+
| 30 | No regressions in existing tests | PASS | Full suite: 867 runs, 2898 assertions, 0 failures, 0 errors |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Issues Found
|
|
63
|
+
|
|
64
|
+
### Minor (non-blocking)
|
|
65
|
+
|
|
66
|
+
1. **Empty dispatchers array edge case (Check #25)**: If `queue.yml` has `dispatchers: []`, the code sees `found_dispatchers = true` (the key exists) but doesn't add any recurring_schedule since there are no dispatcher hashes to iterate. This means the empty array is left as-is. This is arguably correct behavior (respecting user intent), but worth documenting.
|
|
67
|
+
|
|
68
|
+
2. **Generator test count**: The plan expected "11 existing + 8 new = 19" but the actual count is 20 (12 existing + 8 new). The plan summary correctly notes 20. The 12th existing test was likely the `test_outputs_next_steps_with_doc_links` test that was already present. No issue -- just a plan estimate mismatch.
|
|
69
|
+
|
|
70
|
+
### None (blocking)
|
|
71
|
+
|
|
72
|
+
No blocking issues found.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Risk Assessment
|
|
77
|
+
|
|
78
|
+
**Risk level: LOW**
|
|
79
|
+
|
|
80
|
+
- All 867 tests pass with 0 failures
|
|
81
|
+
- RuboCop and Brakeman clean
|
|
82
|
+
- Both new generator steps follow established idempotent patterns
|
|
83
|
+
- Workflow integration is minimal (2 unconditional patcher calls)
|
|
84
|
+
- New files are self-contained with no side effects
|
|
85
|
+
- Test coverage includes all happy paths, skip paths, and edge cases
|
|
86
|
+
- No security concerns (file operations are scoped to destination_root)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# PLAN-01 Summary: procfile-queue-generator-steps
|
|
2
|
+
|
|
3
|
+
## Status: COMPLETE
|
|
4
|
+
|
|
5
|
+
## What was done
|
|
6
|
+
|
|
7
|
+
### Task 1: Add Procfile.dev generator step
|
|
8
|
+
- Added `patch_procfile_dev` public method to `InstallGenerator` (between `configure_recurring_jobs` and `print_next_steps`)
|
|
9
|
+
- Handles 3 cases: create new file, append to existing, skip if already present
|
|
10
|
+
- Added `PROCFILE_JOBS_ENTRY` private constant
|
|
11
|
+
- Updated `print_next_steps` with Procfile.dev info message
|
|
12
|
+
|
|
13
|
+
### Task 2: Add queue.yml dispatcher step
|
|
14
|
+
- Added `configure_queue_dispatcher` public method to `InstallGenerator` (between `patch_procfile_dev` and `print_next_steps`)
|
|
15
|
+
- Handles 4 cases: missing file, already configured, needs patching, no dispatchers key
|
|
16
|
+
- Added private helpers: `queue_config_has_recurring_schedule?`, `add_recurring_schedule_to_dispatchers!`
|
|
17
|
+
- Added `RECURRING_SCHEDULE_VALUE` and `DEFAULT_DISPATCHER` private constants
|
|
18
|
+
|
|
19
|
+
### Task 3: Add 8 generator tests
|
|
20
|
+
- 4 Procfile.dev tests: create, append, skip, no-duplicate
|
|
21
|
+
- 4 queue.yml tests: patch dispatchers, skip when configured, skip when missing, add default dispatcher
|
|
22
|
+
- All 20 generator tests pass (12 existing + 8 new)
|
|
23
|
+
|
|
24
|
+
### Task 4: Add workflow helpers and integration
|
|
25
|
+
- Created `lib/source_monitor/setup/procfile_patcher.rb` (lightweight Pathname-based helper)
|
|
26
|
+
- Created `lib/source_monitor/setup/queue_config_patcher.rb` (YAML parsing with recursive dispatcher search)
|
|
27
|
+
- Modified `lib/source_monitor/setup/workflow.rb`: added 2 new kwargs, wired into `run` after `initializer_patcher` and before devise check
|
|
28
|
+
- Added autoload entries in `lib/source_monitor.rb`
|
|
29
|
+
- Updated all 8 workflow tests with new collaborator spies
|
|
30
|
+
|
|
31
|
+
### Task 5: Full suite verification
|
|
32
|
+
- 867 test runs, 2898 assertions, 0 failures, 0 errors
|
|
33
|
+
- RuboCop: 376 files, 0 offenses
|
|
34
|
+
- Brakeman: 0 warnings
|
|
35
|
+
|
|
36
|
+
## Files modified
|
|
37
|
+
- `lib/generators/source_monitor/install/install_generator.rb` -- 2 new public methods, 4 private helpers/constants
|
|
38
|
+
- `test/lib/generators/install_generator_test.rb` -- 8 new tests
|
|
39
|
+
- `lib/source_monitor/setup/procfile_patcher.rb` -- NEW
|
|
40
|
+
- `lib/source_monitor/setup/queue_config_patcher.rb` -- NEW
|
|
41
|
+
- `lib/source_monitor/setup/workflow.rb` -- 2 new kwargs, 2 new patcher calls
|
|
42
|
+
- `test/lib/source_monitor/setup/workflow_test.rb` -- added patcher spies to all tests
|
|
43
|
+
- `lib/source_monitor.rb` -- 2 new autoload entries
|
|
44
|
+
|
|
45
|
+
## Commits
|
|
46
|
+
1. `af59468` feat(generator): add Procfile.dev patching step to install generator
|
|
47
|
+
2. `29250af` feat(generator): add queue.yml dispatcher step to install generator
|
|
48
|
+
3. `96365b9` feat(generator): add 8 tests for Procfile.dev and queue.yml steps
|
|
49
|
+
4. `4393d17` feat(generator): add workflow helpers and wire patchers into guided install
|
|
50
|
+
|
|
51
|
+
## Acceptance criteria met
|
|
52
|
+
- Generator creates Procfile.dev with web: + jobs: entries when none exists (REQ-16)
|
|
53
|
+
- Generator appends jobs: entry to existing Procfile.dev without duplicating (REQ-16)
|
|
54
|
+
- Generator skips Procfile.dev when jobs: entry already present (REQ-16 idempotency)
|
|
55
|
+
- Generator patches queue.yml dispatchers with recurring_schedule (REQ-17)
|
|
56
|
+
- Generator skips queue.yml when recurring_schedule already configured (REQ-17 idempotency)
|
|
57
|
+
- Generator handles missing queue.yml gracefully (REQ-17 edge case)
|
|
58
|
+
- Guided workflow runs both patchers after generator step (REQ-18)
|
|
59
|
+
- All existing tests continue to pass (no regressions)
|
|
60
|
+
- 8 new generator tests cover all scenarios
|
|
61
|
+
- RuboCop clean, Brakeman clean
|