Skip to content

Commit f54daae

Browse files
feat(gcs): update image URLs to use staging and remove history references
- Changed image URLs to point to staging instead of production - Removed history folder references from the promotion process - Updated documentation to reflect the latest storage practices
1 parent 9b7f740 commit f54daae

File tree

6 files changed

+13
-27
lines changed

6 files changed

+13
-27
lines changed

.github/workflows/impl-generate.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,15 +661,14 @@ jobs:
661661
ISSUE: ${{ steps.issue.outputs.number }}
662662
PR_NUMBER: ${{ steps.pr.outputs.pr_number }}
663663
run: |
664-
# Use versioned production URLs (permanent, in history/ folder)
665-
# These will be available after impl-merge promotes from staging
666-
PNG_URL="https://storage.googleapis.com/pyplots-images/plots/${SPEC_ID}/${LIBRARY}/history/v0.png"
664+
# Use staging URLs (available immediately after upload)
665+
PNG_URL="https://storage.googleapis.com/pyplots-images/staging/${SPEC_ID}/${LIBRARY}/plot.png"
667666
HTML_URL=""
668667
669668
# Set HTML_URL for interactive libraries
670669
case "$LIBRARY" in
671670
plotly|bokeh|altair|highcharts|pygal|letsplot)
672-
HTML_URL="https://storage.googleapis.com/pyplots-images/plots/${SPEC_ID}/${LIBRARY}/history/v0.html"
671+
HTML_URL="https://storage.googleapis.com/pyplots-images/staging/${SPEC_ID}/${LIBRARY}/plot.html"
673672
;;
674673
esac
675674

.github/workflows/impl-merge.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,27 +165,18 @@ jobs:
165165
166166
STAGING="gs://pyplots-images/staging/${SPEC_ID}/${LIBRARY}"
167167
PRODUCTION="gs://pyplots-images/plots/${SPEC_ID}/${LIBRARY}"
168-
HISTORY="${PRODUCTION}/history"
169168
170-
# Get created date from metadata for version naming (YYYY-MM-DD)
171-
CREATED_DATE=$(yq '.created' "plots/${SPEC_ID}/metadata/${LIBRARY}.yaml" 2>/dev/null | cut -d'T' -f1 || echo "$(date +%Y-%m-%d)")
172-
echo "Created date: ${CREATED_DATE}"
173-
174-
# 1. Copy from staging to production (current)
169+
# Copy from staging to production
175170
gsutil -m cp -r "${STAGING}/*" "${PRODUCTION}/" 2>/dev/null || echo "No staging files to promote"
176171
177-
# 2. Copy versioned to history/ folder (using date instead of version number)
178-
gsutil cp "${STAGING}/plot.png" "${HISTORY}/${CREATED_DATE}.png" 2>/dev/null || true
179-
gsutil cp "${STAGING}/plot.html" "${HISTORY}/${CREATED_DATE}.html" 2>/dev/null || true
180-
181172
# Make production files public
182173
gsutil -m acl ch -r -u AllUsers:R "${PRODUCTION}/" 2>/dev/null || true
183174
184175
# Clean up staging
185176
gsutil -m rm -r "${STAGING}/" 2>/dev/null || true
186177
187178
rm -f /tmp/gcs-key.json
188-
echo "::notice::Promoted images to production + history/${CREATED_DATE}"
179+
echo "::notice::Promoted images to production"
189180
190181
- name: Update issue labels
191182
if: steps.check.outputs.should_run == 'true' && steps.issue.outputs.number != ''

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Example: `plots/scatter-basic/` contains everything for the basic scatter plot.
241241
- **`plots/{specification-id}/`**: Plot-centric directories (spec, metadata, implementations together)
242242
- `specification.md`: Library-agnostic specification (Description, Applications, Data, Notes)
243243
- `specification.yaml`: Spec-level metadata (tags, created, issue, suggested, updates)
244-
- `metadata/{library}.yaml`: Per-library metadata (preview_url, quality_score, history)
244+
- `metadata/{library}.yaml`: Per-library metadata (preview_url, quality_score, review feedback)
245245
- `implementations/{library}.py`: Library-specific implementations
246246
- **`prompts/`**: AI agent prompts for code generation, quality evaluation, and tagging
247247
- `templates/`: Spec and metadata templates
@@ -447,7 +447,7 @@ uv run python -c "from core.database import is_db_configured; print(is_db_config
447447
- Everything in `plots/{specification-id}/`:
448448
- `specification.md` - specification description
449449
- `specification.yaml` - spec-level metadata (tags, created, issue, etc.)
450-
- `metadata/{library}.yaml` - per-library metadata (quality score, generation history)
450+
- `metadata/{library}.yaml` - per-library metadata (quality score, review feedback)
451451
- `implementations/*.py` - library implementations
452452

453453
**What's NOT Stored in DB**:

docs/architecture/database.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,7 @@ GROUP BY s.id;
410410
```
411411
1. New version of implementation
412412
→ UPDATE impls SET preview_url=..., quality_score=..., updated_at=NOW()
413-
414-
2. Old GCS images moved to history/
415-
→ Database references latest URLs
413+
→ GCS images overwritten with latest version
416414
```
417415

418416
### Deletion Flow

docs/architecture/repository.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ gs://pyplots-images/
258258
├── plots/{spec-id}/{library}/ # Production (after merge)
259259
│ ├── plot.png # Full-size optimized image
260260
│ ├── plot_thumb.png # Thumbnail (600px width)
261-
│ ├── plot.html # Optional (interactive libraries)
262-
│ └── history/ # Version history
261+
│ └── plot.html # Optional (interactive libraries)
263262
264263
└── staging/{spec-id}/{library}/ # Temp (during review)
265264
└── plot.png, plot.html

docs/workflow.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pyplots is a **community-driven, AI-powered platform** that automatically discov
1414

1515
### Key Principles
1616

17-
1. **Images in GCS, Code in GitHub**: Plot PNGs stored in Google Cloud Storage with version history, source code version-controlled
17+
1. **Images in GCS, Code in GitHub**: Plot PNGs stored in Google Cloud Storage, source code version-controlled
1818
2. **Multi-Version Support**: All plots tested across Python 3.11+ (3.11, 3.12, 3.13, 3.13 primary)
1919
3. **Hybrid Automation**: AI handles routine tasks, humans approve critical decisions
2020
4. **Standard Datasets**: Use well-known datasets (pandas iris, seaborn tips, kaggle) for realistic previews
@@ -369,11 +369,10 @@ Via **GitHub Issue Labels**:
369369
- Avoid redundant evaluations
370370

371371
2. **Efficient Storage**:
372-
- GCS versioning: all versions kept permanently for history tracking
373-
- Path structure: `plots/{spec-id}/{library}/{variant}/v{ISO-timestamp}.png`
374-
- Thumbnails: `v{timestamp}_thumb.png` (400px width) for gallery views
372+
- Path structure: `plots/{spec-id}/{library}/plot.png`
373+
- Thumbnails: `plot_thumb.png` (600px width) for gallery views
375374
- Images never in git repository
376-
- Before/after comparison in Issues for updates
375+
- Only latest version stored (no version history)
377376

378377
3. **Smart Scheduling**:
379378
- Event-based maintenance (not daily scheduled)

0 commit comments

Comments
 (0)