Skip to content

Conversation

@ainsleyclark
Copy link
Contributor

No description provided.

claude and others added 10 commits October 22, 2025 18:54
… template

This change refactors the backup workflow generation to use a single
template file (backup.yaml.tmpl) instead of separate templates for each
resource type. The unified template uses conditional logic to handle
both Postgres and S3 resources.

Changes:
- Created unified backup.yaml.tmpl with conditional blocks for resource types
- Updated BackupWorkflow to use single template and generate backup-{resource}.yaml files
- Updated tests to reflect new naming convention (backup-{resource}.yaml)
- Removed deprecated backup-postgres.yaml.tmpl and backup-s3.yaml.tmpl

This results in cleaner code organisation and easier maintenance, as all
backup workflow logic is now centralised in one template file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This change refactors the backup workflow to use template-based iteration
instead of code-based iteration. The template now loops over all resources
and generates appropriate jobs for each resource type within a single
backup.yaml workflow file.

Changes:
- Updated backup.yaml.tmpl to use {{range .Resources}} for looping
- Refactored BackupWorkflow to generate single backup.yaml file
- BackupWorkflow now builds a secretData map and passes all resources to template
- Updated tests to expect single backup.yaml file
- Added test for multiple resources to verify template looping

This results in:
- One backup.yaml workflow file instead of multiple files
- Cleaner separation of concerns (template handles iteration, not code)
- Multiple jobs within one workflow (backup-db, backup-store, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…r checks

This change improves the backup workflow implementation with better data
organisation and provider validation:

Changes:
- Refactored secretData from map[string]string to map[string]map[string]string
- Secrets are now grouped by resource name for cleaner template access
- Template now uses {{ index $.Data .Name "DatabaseURL" }} instead of printf
- Added DigitalOcean provider check for S3 backups (skip non-DO providers)
- Added note that S3 backup only supports DigitalOcean Spaces currently
- Added tracking for all resources as workflow sources
- Added test for non-DigitalOcean S3 resources being skipped

Benefits:
- Cleaner template syntax without printf formatting
- Better code organisation with nested secret structure
- Prevents errors from unsupported S3 providers
- Proper manifest tracking for all resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixed two template errors where BucketName was being accessed incorrectly:
- Line 65: Changed {{ index $.Data "BucketName" }} to {{ $.BucketName }}
- Line 70: Changed {{ .BucketName }} to {{ $.BucketName }}

BucketName is at the root data level ($.BucketName), not inside the Data
map or on the Resource object. This was causing template execution errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
All test AppDefinitions were missing the Project field, which meant
appDef.Project.Name was empty and $.BucketName in the template resolved
to an empty string. This caused invalid S3 URLs in the generated
workflows (e.g., "s3://" instead of "s3://test-project").

Added Project.Name = "test-project" to all test cases.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.79%. Comparing base (7f6b060) to head (3d8d6de).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
- Coverage   64.59%   63.79%   -0.80%     
==========================================
  Files         154      154              
  Lines        6064     6176     +112     
==========================================
+ Hits         3917     3940      +23     
- Misses       2064     2153      +89     
  Partials       83       83              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ainsleyclark ainsleyclark merged commit 7be1d5f into main Oct 23, 2025
3 of 4 checks passed
@ainsleyclark ainsleyclark deleted the claude/refactor-backup-workflow-011CUNjrHUV4EPG3UqTvjSpq branch October 23, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants