Skip to content

Conversation

@keithwillcode
Copy link
Contributor

@keithwillcode keithwillcode commented Dec 31, 2025

What does this PR do?

Optimizes the postgres service container health check configuration across all CI workflows to reduce the "Initialize Containers" step duration.

Analysis of current behavior (from CI job logs):

  • Container starts at 11:47:44
  • Health check doesn't report "healthy" until 11:48:00
  • Total wait time: ~16 seconds

The bottleneck is the --health-interval 10s setting. Docker can't mark a container as "healthy" until a health check actually runs and succeeds. Since postgres typically starts accepting connections within 1-2 seconds (especially with pre-cached images on Blacksmith runners), we're waiting unnecessarily.

Changes applied to all 6 workflow files:

  • e2e.yml
  • e2e-app-store.yml
  • e2e-embed.yml
  • e2e-embed-react.yml
  • e2e-api-v2.yml
  • api-v1-production-build.yml

Configuration changes:

  • Reduce --health-interval from 10s to 2s for faster detection
  • Increase --health-retries from 5 to 15 to maintain tolerance (~30s total)
  • Add --health-start-period 2s for startup grace period
  • Make health command more specific with -h 127.0.0.1 -U postgres

Expected improvement: ~16s → ~4-6s for postgres health check per workflow

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - CI config only.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works. N/A - this optimizes CI itself; effectiveness will be visible in CI run times.

How should this be tested?

  1. Merge this PR and observe the "Initialize Containers" step timing in subsequent CI runs
  2. Compare the postgres health check duration before (~16s) and after (~4-6s expected)
  3. Monitor for any flakiness in the first few runs to ensure the health check parameters aren't too aggressive

Human Review Checklist

  • Verify health check parameters are reasonable (2s interval × 15 retries = 30s max wait time)
  • Confirm --health-start-period is supported on Blacksmith runners (Docker API 1.48 confirmed in logs)
  • Monitor first few CI runs after merge for any postgres connection issues

Checklist

  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
@vercel
Copy link

vercel bot commented Dec 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Review Updated (UTC)
cal Ignored Ignored Dec 31, 2025 0:45am
cal-companion Ignored Ignored Preview Dec 31, 2025 0:45am
cal-eu Ignored Ignored Dec 31, 2025 0:45am

@devin-ai-integration devin-ai-integration bot changed the title perf: optimize postgres health check in e2e workflow perf: optimize postgres health check in all CI workflows Dec 31, 2025
@github-actions
Copy link
Contributor

E2E results are ready!

@keithwillcode keithwillcode self-assigned this Dec 31, 2025
@keithwillcode keithwillcode added this to the v6.1 milestone Dec 31, 2025
@keithwillcode keithwillcode marked this pull request as ready for review December 31, 2025 12:45
@graphite-app graphite-app bot added the core area: core, team members only label Dec 31, 2025
@graphite-app graphite-app bot requested a review from a team December 31, 2025 12:45
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

@keithwillcode keithwillcode merged commit c47c6f2 into main Dec 31, 2025
49 checks passed
@keithwillcode keithwillcode deleted the devin/optimize-postgres-healthcheck-1767183679 branch December 31, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants