Skip to content

Conversation

@QuinnNTonic
Copy link
Collaborator

No description provided.

QuinnNTonic and others added 30 commits July 22, 2025 17:20
- Add migration detection for both pending and new migrations
- Implement manual review steps for migration approval
- Create utility scripts for checking pending migrations and schema drift
- Ensure all migrations run BEFORE API deployment
- Add database backup functionality before migrations
- Generate and commit new migrations automatically after approval
- Include proper error handling and rollback capabilities

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

Co-Authored-By: Claude <[email protected]>
…etection

- Separate pending migration check from schema drift detection
- Apply pending migrations BEFORE checking for schema drift
- This prevents false positives where pending migrations would resolve apparent drift
- Ensures schema drift check runs against updated database state

The correct flow is now:
1. Check for pending migrations
2. Apply pending migrations (with review)
3. THEN check for schema drift against updated database
4. Generate new migrations only if drift still exists

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

Co-Authored-By: Claude <[email protected]>
…d such. Firing Claude back up to work through being able to see the generated migration on the approval step.
- Remove emergency bypass logic and always() conditions for better workflow cancellation
- Add proxy connection testing with nc to verify readiness
- Increase wait time to 10 seconds for proxy startup
- Add proper error handling and cleanup for failed proxy connections

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

Co-Authored-By: Claude <[email protected]>
- Fix check-schema-drift to run when no pending migrations found (pending-migrations == 'false')
- Ensure schema drift check runs after successful migration application
- Clean up redundant conditional expressions in migration jobs
- This ensures schema drift checking happens in both scenarios: no pending migrations or after successful migration application

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

Co-Authored-By: Claude <[email protected]>
- Make apply-pending-migrations always run (conditionally execute migration steps inside)
- Ensure migrations are applied before schema drift checking for accurate results
- Handle both scenarios: with pending migrations (after approval) and without migrations
- Maintain workflow cancellability by avoiding always() conditions
- Schema drift now runs after migration state is clean and consistent

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

Co-Authored-By: Claude <[email protected]>
… check

- Make apply-pending-migrations job run in both scenarios (with/without pending migrations)
- Add proper dependency on review-pending-migrations for approval flow
- Change environment to Test-Database-NoApproval to avoid blocking when no migrations exist
- This ensures check-schema-drift job always has a successful predecessor to depend on

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

Co-Authored-By: Claude <[email protected]>
- Fix check-pending-migrations to properly capture and set GitHub output variables
- Add conditional execution for show-migrations and apply-migrations steps
- Consolidate migration steps into single job for better resource utilization
- Update check-schema-drift to depend directly on check-pending-migrations
- Move approval requirement to Test-Database-Approval environment for migration application
- Remove redundant apply-pending-migrations job

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

Co-Authored-By: Claude <[email protected]>
QuinnNTonic and others added 26 commits July 28, 2025 13:59
…atically generated and approved. Generated and applied at: Mon Jul 28 18:21:03 UTC 2025
…atically generated and approved. Generated and applied at: Mon Jul 28 18:45:42 UTC 2025
… scaling

- Changed from `gcloud app versions stop` to version cleanup strategy
- Keeps last 3 versions for rollback capability while cleaning up older ones
- Fixes deployment error: "serving status cannot be changed for Automatic Scaling versions"
- Preserves rollback functionality by not immediately deleting previous version

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

Co-Authored-By: Claude <[email protected]>
Database backup improvements:
- Fix backup-id null/empty string handling in GitHub Actions conditions
- Prevent duplicate backups when pending migrations already created one

Drift detection fixes:
- Handle TypeORM "no changes found" as success case, not error
- Ensure MIGRATION_NEEDED=false is output consistently for no-drift scenarios
- Fix pipeline failures when schema is already in sync

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

Co-Authored-By: Claude <[email protected]>
…atically generated and approved. Generated and applied at: Mon Jul 28 19:34:56 UTC 2025
- Replace unreliable --format="value(name)" with --format="json"
- Use jq to properly extract backup ID from JSON response
- Add comprehensive debugging output to troubleshoot backup creation
- Add validation to fail fast if backup ID extraction fails
- Display instance name for better troubleshooting

This fixes the issue where BACKUP_ID was empty despite successful backup creation.

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

Co-Authored-By: Claude <[email protected]>
- Fix jq error when gcloud returns empty array [] instead of object
- Add support for both array and object response formats
- Implement fallback mechanism to query recent backups list
- Improve error handling and debugging for backup ID extraction

This resolves the "Cannot index array with string" jq error.

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

Co-Authored-By: Claude <[email protected]>
- Add proper error detection for gcloud backup creation commands
- Implement alternative backup method when JSON format fails
- Use unique descriptions to identify created backups
- Add timing delay and multiple lookup strategies for backup ID retrieval
- Improve error messages and debugging output

This addresses cases where gcloud returns empty arrays but backups are actually created.

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

Co-Authored-By: Claude <[email protected]>
…rors

- Use --quiet flag for backup creation to suppress status messages
- Retrieve backup info via separate list command with clean JSON output
- Remove mixed text/JSON output that was causing jq parse failures
- Simplify backup ID extraction by getting most recent backup directly

This fixes the "Invalid numeric literal" jq error caused by mixed output formats.

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

Co-Authored-By: Claude <[email protected]>
…t pipeline

- Replace simple deployment with full migration pipeline from MR_TO_MAIN.yml
- Change trigger from PR to tag-based releases (push: tags: ['v*'])
- Update all environment variables and secrets from TEST to PROD
- Add migration safety: fail pipeline if schema drift detected after applying pending migrations
- Include robust backup creation with fallback strategies for production database
- Implement atomic deployment with comprehensive rollback capabilities
- Remove automatic migration generation - production requires clean schema state
- Remove prod-env-verified step as requested
- Update permissions and dependencies for tag-based workflow
- Maintain version cleanup (keeping last 3 versions for rollback)

This ensures production deployments are safe and only proceed with clean database schema.

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

Co-Authored-By: Claude <[email protected]>
@QuinnNTonic QuinnNTonic temporarily deployed to Test-Database-NoApproval July 29, 2025 22:52 — with GitHub Actions Inactive
@QuinnNTonic QuinnNTonic merged commit 24ae0d4 into main Jul 29, 2025
1 check passed
@QuinnNTonic QuinnNTonic deleted the feature/claude_helps_with_cicd branch July 29, 2025 22:52
@QuinnNTonic QuinnNTonic had a problem deploying to Test-Database-Approval July 29, 2025 22:54 — with GitHub Actions Error
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.

2 participants