Skip to content

ci: check Postgres health as the postgres role and version the AVD cache key - #142

Merged
aaronbrethorst merged 2 commits into
OneBusAway:mainfrom
diveshpatil9104:ci/review-nits
Oct 11, 2026
Merged

aaronbrethorst merged 2 commits into
OneBusAway:mainfrom
diveshpatil9104:ci/review-nits

Conversation

@diveshpatil9104

@diveshpatil9104 diveshpatil9104 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #141.

Two CI follow-ups from review.

The Postgres service's health check ran plain pg_isready, which connects as the
container's root user, so every ci job logged role "root" does not exist. It now
runs pg_isready -U postgres, the same command docker-compose.yml uses.

The AVD cache key was avd-<api level>-<target>-<arch>. The emulator action
downloads the emulator and the system image on every run, so once either one was
updated, the job could restore a snapshot made with the old version against the
new one. The job now installs both before the cache step, reads each package's
Pkg.Revision from its source.properties, and puts both versions in the key. If
either version can't be read the step fails, because an empty value would quietly
bring the stale-snapshot problem back. yes is wrapped as (yes || true) so its
SIGPIPE exit can't fail the install step if the job ever runs with pipefail, as
the iOS workflow does.

I ran the version step's exact script against a local SDK: it read emulator
36.6.11 and image 4, and with an image that isn't installed it exits 1 and writes
no outputs. Both workflows parse, and the version step runs before the cache step.

This PR's first instrumented run will miss the cache once, since the key changed,
and regenerate the snapshot. That is expected.

Not in this PR: making instrumented a required check, which is a
branch-protection setting.

Summary by CodeRabbit

  • Chores
    • Improved Android test environment setup and caching, including checks that required emulator and system image versions are available.
    • Updated PostgreSQL readiness checks in the CI workflow.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e21d9b5e-0d0f-43dc-ad5d-150324492251

📥 Commits

Reviewing files that changed from the base of the PR and between a672ab2 and 7055df3.


📒 Files selected for processing (2)
  • .github/workflows/android.yml
  • .github/workflows/ci.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

The Android workflow now includes emulator and system-image revisions in the AVD cache key. The CI workflow now specifies the PostgreSQL user for its health check.

Changes

Android emulator cache

Layer / File(s) Summary
Read package revisions and version the AVD cache key
.github/workflows/android.yml
The workflow installs the configured emulator and system image, checks that both revisions are available, and adds them to the AVD cache key alongside the existing values.

PostgreSQL health check

Layer / File(s) Summary
Set the health-check user
.github/workflows/ci.yml
The health-check command now passes postgres to pg_isready.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: aaronbrethorst


Merge Risk: ⚪ Minimal · up to 7055d

The Android cache key distinguishes emulator and system-image revisions, and CI checks PostgreSQL readiness as the configured user. No concrete merge-blocking risk is evident.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes both main workflow changes: the PostgreSQL health check uses the postgres role, and the AVD cache key includes version information.
Linked Issues check Passed Issue #141 has two active coding requirements. .github/workflows/ci.yml changes the Postgres health command to pg_isready -U postgres. .github/workflows/android.yml installs the emulator and sys…
Out of Scope Changes check Passed The pull request changes only .github/workflows/ci.yml and .github/workflows/android.yml. The added installation, version validation, output handling, and comments directly support the versioned A…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…


✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aaronbrethorst

Copy link
Copy Markdown
Member

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@aaronbrethorst aaronbrethorst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Both fixes are right. pg_isready -U postgres matches the role the service creates, and putting the emulator and image versions in the AVD cache key keeps stale snapshots from being restored. Thanks.

@aaronbrethorst
aaronbrethorst merged commit c353baa into OneBusAway:main Oct 11, 2026
5 checks passed
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.

CI follow-ups: match the Postgres health check to compose, version the AVD cache key

2 participants