-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: Backup Workflow #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ainsleyclark
merged 10 commits into
main
from
claude/refactor-backup-workflow-011CUNjrHUV4EPG3UqTvjSpq
Oct 23, 2025
Merged
refactor: Backup Workflow #39
ainsleyclark
merged 10 commits into
main
from
claude/refactor-backup-workflow-011CUNjrHUV4EPG3UqTvjSpq
Oct 23, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… 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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.