appydave-tools 0.20.0 → 0.20.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa0d28f2da43b19537700a122baaea2401ea5c7b545d687a1bff64150d1c7d88
4
- data.tar.gz: 98b8575d8af3b09e0dbc025b076d9b221d0d5b28705ee714a2483f74022c73c6
3
+ metadata.gz: ad2e56b8d8b3c9a1cb3e97bf6a020dff3c912ae6d22be2188104276cf952a0cf
4
+ data.tar.gz: ba06bb06e615d282df69ccb5b52a1f5b5264f02dfd7af574e86a71721cec1633
5
5
  SHA512:
6
- metadata.gz: 2f3c69c161ac3b1ca8642db8d1f6a15317510956ffe396635d6bf2f49e1be6bc6b22c4b5b9e9694b9b40ffbb9214da8487979078740a68a0b2dcec7c07a42ba1
7
- data.tar.gz: de05f01bba2420b7c287cd28ac499ca56af5b7277c88522d867280e27be99d821baf2cb9d389beefe0c3e6573b6eee6095c0eafdd1a2806f1e49ec782f0de54f
6
+ metadata.gz: 53ba4ece9f3f7d7c8fe29107b9059018285a382acb02a1f26275d0b41a95745402dbe74d9609a6a089c73c0ec92ce320df58fa50b8bbd4b17578f0d84234bc1a
7
+ data.tar.gz: 927899c39261f330ceb73387a8598023a5c642cec24e5753ddde063af545a7aa373ac07969c6f0ee5c69ed2ee76b4f75d871c96cce2d015ef81d7fae6b532fab
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # [0.20.0](https://github.com/appydave/appydave-tools/compare/v0.19.0...v0.20.0) (2025-11-10)
2
+
3
+
4
+ ### Features
5
+
6
+ * Phase 2: add unified status and git repo commands (status, repo-status, repo-sync, repo-push) ([c9ff7de](https://github.com/appydave/appydave-tools/commit/c9ff7dee9bd2d60954205df08c23dd673960a524))
7
+ * Phase 2: add unified status and git repo commands (status, repo-status, repo-sync, repo-push) ([b74f343](https://github.com/appydave/appydave-tools/commit/b74f3436e188cfa7dbdff386d35cb96d75f80860))
8
+
1
9
  # [0.19.0](https://github.com/appydave/appydave-tools/compare/v0.18.5...v0.19.0) (2025-11-10)
2
10
 
3
11
 
data/bin/dam CHANGED
@@ -414,6 +414,14 @@ class VatCLI
414
414
  help [command] Show help information
415
415
  list [brand] [pattern] List brands/projects
416
416
 
417
+ Status & Monitoring:
418
+ status [brand] [project] Show unified status (local/S3/SSD/git)
419
+
420
+ Git Repository Commands:
421
+ repo-status <brand> [--all] Check git status for brand repos
422
+ repo-sync <brand> [--all] Pull updates for brand repos
423
+ repo-push <brand> [project] Push changes for brand repo
424
+
417
425
  S3 Sync Commands:
418
426
  s3-up <brand> <project> Upload to S3 staging
419
427
  s3-down <brand> <project> Download from S3 staging
@@ -438,6 +446,10 @@ class VatCLI
438
446
 
439
447
  Examples:
440
448
  dam list
449
+ dam status appydave
450
+ dam status appydave b65
451
+ dam repo-status appydave
452
+ dam repo-sync appydave
441
453
  dam s3-up appydave b65
442
454
  dam s3-down voz boy-baker --dry-run
443
455
  dam s3-status appydave b65
@@ -1,6 +1,6 @@
1
1
  # DAM (Digital Asset Management) - Integration Testing Plan
2
2
 
3
- **Date**: 2025-11-08
3
+ **Date**: 2025-11-10
4
4
  **Purpose**: Validate DAM integration into appydave-tools gem
5
5
  **Tester**: David Cruwys
6
6
  **Status**: Ready for User Acceptance Testing
@@ -37,25 +37,17 @@
37
37
  - ✅ `dam archive` - Archive to SSD with dry-run and force options
38
38
  - ✅ `dam sync-ssd` - Restore light files from SSD (dry-run supported)
39
39
 
40
- **Git Repository Management Scripts - Intentionally Not Migrated**:
40
+ **Commands - Phase 4 Complete** (Status & Git Integration):
41
+ - ✅ `dam status` - Unified status view (local/S3/SSD/git)
42
+ - ✅ `dam repo-status` - Git status for brand repositories (supports `--all`)
43
+ - ✅ `dam repo-sync` - Pull updates for brand repositories (supports `--all`)
44
+ - ✅ `dam repo-push` - Push changes for brand repository (optional project validation)
41
45
 
42
- These are **shell scripts** for managing the multi-repo video-projects git structure, NOT video asset management commands:
43
-
44
- - `status-all.sh` - Runs `git status` on all v-* brand repos (git workflow, not asset management)
45
- - `sync-all.sh` - Runs `git pull` on all v-* brand repos (git workflow, not asset management)
46
- - `clone-all.sh` - Clones all v-* brand repos if missing (git workflow, not asset management)
47
-
48
- **Why not migrated:**
49
- 1. These manage **git repositories**, not **video assets**
50
- 2. They loop through brand folders running git commands
51
- 3. They're workflow automation for the video-projects repo structure
52
- 4. They belong in `/video-projects/v-shared/`, not in the appydave-tools gem
53
- 5. Different use case: repo management vs. video file management
54
-
55
- **If you want these migrated:** We could add `dam repo-status`, `dam repo-sync`, `dam repo-clone` commands, but they would:
56
- - Need Ruby implementations of multi-repo git operations
57
- - Duplicate functionality that shell scripts handle well
58
- - Mix concerns (video assets vs. git repos)
46
+ **New Manifest Fields (Phase 4)**:
47
+ - ✅ `git_remote` - Self-healing git remote URL detection in brands.json
48
+ - `s3: { exists: true/false }` - S3 staging folder tracking in manifest
49
+ - `type: 'flivideo' | 'storyline-app'` - Project type detection
50
+ - `hasStorylineJson: true/false` - Storyline project identification
59
51
 
60
52
  ---
61
53
 
@@ -150,10 +142,19 @@ These commands only read data and don't modify files:
150
142
  | Command | Type | What It Does |
151
143
  |---------|------|--------------|
152
144
  | **list** | Read-only | List brands/projects |
145
+ | **status** | Read-only | Show unified status (local/S3/SSD/git) |
146
+ | **repo-status** | Read-only | Check git status for brand repos |
153
147
  | **manifest** | Generates JSON | Generate `projects.json` manifest |
154
148
  | **s3-status** | Read-only | Check sync status |
155
149
  | **help** | Read-only | Show help information |
156
150
 
151
+ ### Git Commands (Special Behavior)
152
+
153
+ | Command | Type | What It Does | Safety Features |
154
+ |---------|------|--------------|-----------------|
155
+ | **repo-sync** | Modifies (git pull) | Pull updates for brand repos | Skips if uncommitted changes |
156
+ | **repo-push** | Modifies (git push) | Push changes for brand repo | Warns if uncommitted changes, optional project validation |
157
+
157
158
  ### Force Flag Behavior
158
159
 
159
160
  Commands requiring `--force` provide extra protection for destructive operations:
@@ -418,6 +419,115 @@ bin/s3_sync_cleanup.rb --dry-run
418
419
 
419
420
  ---
420
421
 
422
+ #### Test 2.15: Status - Brand Overview ⭐ PHASE 4
423
+ ```bash
424
+ # Test: Show unified status for entire brand
425
+ bin/dam status appydave
426
+ ```
427
+ **Expected**: Shows brand git status, manifest summary (total projects, local, S3, SSD counts)
428
+
429
+ **Status**: [ ] Pass [ ] Fail
430
+ **Notes**: ___________________________________________
431
+
432
+ ---
433
+
434
+ #### Test 2.16: Status - Specific Project ⭐ PHASE 4
435
+ ```bash
436
+ # Test: Show detailed status for specific project
437
+ bin/dam status appydave b65
438
+ ```
439
+ **Expected**: Shows storage locations (local, S3 staging, SSD backup) and git status for project
440
+
441
+ **Status**: [ ] Pass [ ] Fail
442
+ **Notes**: ___________________________________________
443
+
444
+ ---
445
+
446
+ #### Test 2.17: Status - Auto-Detect ⭐ PHASE 4
447
+ ```bash
448
+ # Test: Auto-detect brand and project from PWD
449
+ cd ~/dev/video-projects/v-appydave/b65-*
450
+ bin/dam status
451
+ ```
452
+ **Expected**: Auto-detects and shows project status
453
+
454
+ **Status**: [ ] Pass [ ] Fail
455
+ **Notes**: ___________________________________________
456
+
457
+ ---
458
+
459
+ #### Test 2.18: Repo Status - Single Brand ⭐ PHASE 4
460
+ ```bash
461
+ # Test: Show git status for single brand
462
+ bin/dam repo-status appydave
463
+ ```
464
+ **Expected**: Shows branch, remote, working directory status, sync status
465
+
466
+ **Status**: [ ] Pass [ ] Fail
467
+ **Notes**: ___________________________________________
468
+
469
+ ---
470
+
471
+ #### Test 2.19: Repo Status - All Brands ⭐ PHASE 4
472
+ ```bash
473
+ # Test: Show git status for all brands
474
+ bin/dam repo-status --all
475
+ ```
476
+ **Expected**: Shows git status for all configured brands (appydave, voz, aitldr, etc.)
477
+
478
+ **Status**: [ ] Pass [ ] Fail
479
+ **Notes**: ___________________________________________
480
+
481
+ ---
482
+
483
+ #### Test 2.20: Repo Sync - Single Brand ⭐ PHASE 4
484
+ ```bash
485
+ # Test: Pull updates for single brand
486
+ bin/dam repo-sync appydave
487
+ ```
488
+ **Expected**: Pulls updates if available, skips if uncommitted changes, shows status
489
+
490
+ **Status**: [ ] Pass [ ] Fail
491
+ **Notes**: ___________________________________________
492
+
493
+ ---
494
+
495
+ #### Test 2.21: Repo Sync - All Brands ⭐ PHASE 4
496
+ ```bash
497
+ # Test: Pull updates for all brands
498
+ bin/dam repo-sync --all
499
+ ```
500
+ **Expected**: Syncs all brands, shows summary, skips brands with uncommitted changes
501
+
502
+ **Status**: [ ] Pass [ ] Fail
503
+ **Notes**: ___________________________________________
504
+
505
+ ---
506
+
507
+ #### Test 2.22: Repo Push - Basic ⭐ PHASE 4
508
+ ```bash
509
+ # Test: Push changes for brand (no project validation)
510
+ bin/dam repo-push appydave
511
+ ```
512
+ **Expected**: Pushes commits, shows push summary
513
+
514
+ **Status**: [ ] Pass [ ] Fail
515
+ **Notes**: ___________________________________________
516
+
517
+ ---
518
+
519
+ #### Test 2.23: Repo Push - With Project Validation ⭐ PHASE 4
520
+ ```bash
521
+ # Test: Push with project validation
522
+ bin/dam repo-push appydave b65
523
+ ```
524
+ **Expected**: Validates project exists in manifest before pushing, shows validation message
525
+
526
+ **Status**: [ ] Pass [ ] Fail
527
+ **Notes**: ___________________________________________
528
+
529
+ ---
530
+
421
531
  ### Phase 3: Gem Installation Tests (Manual - Installed Gem)
422
532
 
423
533
  **Prerequisites**: `gem install pkg/appydave-tools-*.gem`
@@ -670,31 +780,18 @@ All video asset management commands have been successfully migrated and are full
670
780
  - ✅ `dam archive` - Archive to SSD (dry-run + optional force)
671
781
  - ✅ `dam sync-ssd` - Restore light files from SSD (dry-run)
672
782
 
783
+ ### Phase 4: Status & Git Integration
784
+ - ✅ `dam status` - Unified status view (local/S3/SSD/git)
785
+ - ✅ `dam repo-status` - Git status for brand repositories (`--all` support)
786
+ - ✅ `dam repo-sync` - Pull updates for brand repositories (`--all` support)
787
+ - ✅ `dam repo-push` - Push changes with optional project validation
788
+
673
789
  ### All Commands Support:
674
790
  - **CLI args**: `dam <command> <brand> <project>`
675
791
  - **Auto-detect**: Works from project directory (where applicable)
676
792
  - **Dry-run**: All destructive operations support `--dry-run`
677
793
  - **Force flags**: Extra safety for deletions
678
-
679
- ---
680
-
681
- ## Git Repository Scripts - Separate Concern
682
-
683
- The following shell scripts are **intentionally not migrated** as they manage git repositories, not video assets:
684
-
685
- ### `/video-projects/v-shared/*.sh`
686
-
687
- - `status-all.sh` - Runs `git status` on all v-* brand repos
688
- - `sync-all.sh` - Runs `git pull` on all v-* brand repos
689
- - `clone-all.sh` - Clones missing v-* brand repos
690
-
691
- **Why separate:**
692
- 1. Different domain: Git repository management vs. video asset management
693
- 2. Different tools: Shell + git commands vs. Ruby + AWS/file operations
694
- 3. Different location: Belongs in video-projects workspace, not in distributed gem
695
- 4. Shell scripts work perfectly for this use case
696
-
697
- **If migration is desired:** Could add `dam repo-status/sync/clone` but would duplicate working shell functionality and mix concerns.
794
+ - **Git integration**: Unified status + repo management commands
698
795
 
699
796
  ---
700
797
 
@@ -707,8 +804,8 @@ The following shell scripts are **intentionally not migrated** as they manage gi
707
804
  - **TOTAL**: **64 / 64 ✅**
708
805
 
709
806
  ### Phase 2: Integration Tests (Manual - Development)
710
- - Passed: _____ / 13
711
- - Failed: _____ / 13
807
+ - Passed: _____ / 23
808
+ - Failed: _____ / 23
712
809
 
713
810
  ### Phase 3: Gem Installation Tests (Manual - Installed)
714
811
  - Passed: _____ / 6
@@ -728,8 +825,8 @@ The following shell scripts are **intentionally not migrated** as they manage gi
728
825
 
729
826
  ### **GRAND TOTAL**
730
827
  - **Unit Tests**: 64 / 64 ✅
731
- - **Manual Tests**: _____ / 29
732
- - **Overall**: _____ / 93
828
+ - **Manual Tests**: _____ / 39
829
+ - **Overall**: _____ / 103
733
830
 
734
831
  ---
735
832
 
@@ -832,8 +929,8 @@ The following shell scripts are **intentionally not migrated** as they manage gi
832
929
 
833
930
  **Then manual development tests** (safest first):
834
931
  2. Phase 2.1-2.5: Help and list commands
835
- 3. Phase 2.6-2.7: S3 upload with dry-run
836
- 4. Phase 2.8-2.13: Phase 2 commands (download, status, cleanup) with dry-run
932
+ 3. Phase 2.6-2.14: S3 commands (upload, download, status, cleanup) with dry-run
933
+ 4. Phase 2.15-2.23: Phase 4 commands (status, repo-status, repo-sync, repo-push) NEW
837
934
  5. Phase 4: Edge cases and error handling
838
935
 
839
936
  **Then gem installation tests**:
@@ -1,6 +1,6 @@
1
1
  # CODEX Recommendations - Review & Status
2
2
 
3
- > Last updated: 2025-11-10 08:12:59 UTC
3
+ > Last updated: 2025-11-10 11:01:36 UTC
4
4
  > Original recommendations provided by Codex (GPT-5) on 2025-11-09
5
5
 
6
6
  This document captures Codex's architectural recommendations with implementation status and verdicts after engineering review.
@@ -148,16 +148,20 @@ end
148
148
 
149
149
  ### 🔍 DAM Manifest & Sync Addendum (2025-11-10)
150
150
 
151
- New DAM code mirrors the VAT manifest/sync flow but reintroduces several bugs plus new inconsistencies:
151
+ Phase 1 added S3/git metadata, but several inconsistencies remain between the manifest generator and the SSD sync tooling:
152
152
 
153
- - **Archived projects still missing:** `collect_project_ids` explicitly skips the `archived` directory (`lib/appydave/tools/dam/manifest_generator.rb:70-99`), so the later logic that probes `brand_path/archived/<range>/<project>` never runs; manifests omit the majority of historical work. This also means `SyncFromSsd.should_sync_project?` (`lib/appydave/tools/dam/sync_from_ssd.rb:77-96`) will think everything is already local because manifests never flag archived presence.
154
- - **Range math diverges between components:** Manifest uses `project_id =~ /^[a-z](\d+)/` to build ranges (`lib/appydave/tools/dam/manifest_generator.rb:214-224`), but the SSD sync hard-codes `/^b(\d+)/` (`lib/appydave/tools/dam/sync_from_ssd.rb:123-138`). Projects outside the `b` prefix (aitldr, voz, etc.) will all collapse into the fallback `000-099`, creating collisions.
155
- - **SSD paths lose grouping info:** Manifests record `path: project_id` for SSD entries (`lib/appydave/tools/dam/manifest_generator.rb:119-126`), ignoring the range folders that exist on disk. The sync tool then assumes `ssd/<project_id>` (line 98) and will fail whenever the SSD organizes projects under range subdirectories.
156
- - **Disk usage ignores archived location:** Even when a project only exists under `archived/<range>`, `calculate_disk_usage` points at `File.join(brand_path, project[:id])` (`lib/appydave/tools/dam/manifest_generator.rb:131-146`), so archived-only projects report 0 bytes. Need to reuse the resolved `local_path` (flat vs archived) instead of rebuilding the path blindly.
157
- - **Heavy file detection still shallow:** `heavy_files?` only inspects direct children (`lib/appydave/tools/dam/manifest_generator.rb:233-239`), while `light_files?` walks `**/*`. Any team that keeps footage under nested folders (e.g., `/final/video.mp4`) gets `has_heavy_files: false`, which downstream sync logic relies on.
158
- - **Sync exclusion filter misidentifies generated folders:** `EXCLUDE_PATTERNS` contain glob syntax (`**/node_modules/**`, `**/.DS_Store`), but `excluded_file?` strips `**/` and compares raw path segments (`lib/appydave/tools/dam/sync_from_ssd.rb:160-182`), so patterns like `.DS_Store` or `.turbo` may still slip through or block unrelated files. Consider using `File.fnmatch` with the original glob rather than manual string surgery.
153
+ - **Range directories are inconsistent:** `ManifestGenerator#determine_range` groups projects in 50-count buckets per letter (`lib/appydave/tools/dam/manifest_generator.rb:271-285`), but `SyncFromSsd#determine_range` still assumes only `b`-series projects and uses 10-count buckets (`lib/appydave/tools/dam/sync_from_ssd.rb:186-196`). Any non-`b` brand (AITLDR, VOZ) or the new 50-count scheme will pick the wrong destination folder.
154
+ - **SSD paths are lossy:** Manifests store `storage[:ssd][:path] = project_id` even when the data actually lives under `ssd/<range>/<project>` (`lib/appydave/tools/dam/manifest_generator.rb:178-185`). `SyncFromSsd#sync_project` then only checks `ssd/<project>` (`lib/appydave/tools/dam/sync_from_ssd.rb:162-170`), so range-based backups always report “SSD path not found” despite `ssd_exists: true` in the manifest. Persist the relative range folder so both tools agree on the same layout.
155
+ - **Heavy file detection still stops at the top level:** `heavy_files?` only scans `dir/*.{mp4,...}` (`lib/appydave/tools/dam/manifest_generator.rb:314-318`), so nested footage (e.g., `final/video.mp4`) reports `has_heavy_files: false`, skewing SSD/cleanup metrics. Mirror the recursive approach used in `light_files?`.
156
+ - **Exclude patterns are fragile:** `SyncFromSsd#excluded_file?` strips `**/` from patterns and only compares path segments (`lib/appydave/tools/dam/sync_from_ssd.rb:198-223`), which means globs like `**/.DS_Store` or `**/*.lock` do not behave like actual glob patterns. Replace the manual parsing with `File.fnmatch?(pattern, relative_path, File::FNM_PATHNAME | File::FNM_DOTMATCH)` so `.git`, `.turbo`, etc., are consistently ignored.
159
157
 
160
- Action: Fold these findings into the existing VAT manifest backlog or spin up DAM‑specific tickets so both manifest implementations converge on a single, tested service.
158
+ Action: Align the manifest and sync code on the same range conventions and relative paths before we rely on Phase 2 git workflows; otherwise `dam sync-ssd` will never restore the projects that manifests say exist.
159
+
160
+ ### ⚠️ DAM Git Workflow (Phase 2)
161
+
162
+ - **Project resolver instantiated incorrectly:** Both `Status#resolve_project_path` and `RepoPush#validate_project` call `ProjectResolver.new.resolve` (`lib/appydave/tools/dam/status.rb:36-40`, `lib/appydave/tools/dam/repo_push.rb:45-63`), but `ProjectResolver` only exposes class methods inside `class << self`. These code paths raise `NoMethodError` the moment you ask for project status or run `dam repo-push … <project>`. Switch to `ProjectResolver.resolve(...)` (or add an instance API) before shipping.
163
+ - **Auto-detected brands pollute configuration:** When you run `dam status` from inside `v-appydave`, the auto-detect logic passes the literal `v-appydave` string (`bin/dam:269-290`) into `Status`, which in turn calls `Config.git_remote`. That method persists the inferred remote under whatever key it was given (`lib/appydave/tools/dam/config.rb:43-71`), so a new `v-appydave` entry gets written to `brands.json`, duplicating the real `appydave` record. Normalize auto-detected names back to the canonical brand key before calling configuration APIs.
164
+ - **Naming drift in the CLI:** `bin/dam` still defines `class VatCLI` (line 11), so stack traces and help output reference the old VAT class name. Rename the class (and any references) to avoid confusion when both `vat` and `dam` binaries coexist.
161
165
 
162
166
  ---
163
167
 
@@ -20,11 +20,10 @@ module Appydave
20
20
  end
21
21
 
22
22
  def save
23
- # Create backup if file exists
23
+ # Create backup if file exists (silent for self-healing operations)
24
24
  if File.exist?(config_path)
25
25
  backup_path = "#{config_path}.backup.#{Time.now.strftime('%Y%m%d-%H%M%S')}"
26
26
  FileUtils.cp(config_path, backup_path)
27
- log.info "Backup created: #{backup_path}" if respond_to?(:log)
28
27
  end
29
28
 
30
29
  File.write(config_path, JSON.pretty_generate(data))
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Appydave
4
4
  module Tools
5
- VERSION = '0.20.0'
5
+ VERSION = '0.20.1'
6
6
  end
7
7
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "description": "AppyDave YouTube Automation Tools",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appydave-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys