DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
FREEDOM251

Freedom251 › Blog › CI/CD

CI Passed 6 of 6 Migrations; a Neon Branch of Production Passed 1: How to Read the Gap

By Freedom251 Team · · 5 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Neon’s documentation explains how a branch of a production database can be used in CI and how its schema can be inspected at a point in time. It does not explain why the reported run shows six of six migrations passing in CI and only one pass on the production side. The two counts describe different runs. By themselves they cannot show whether both runs executed the same migrations against the same starting schema, so the gap has to be traced through the migration records and the deployment sequence.

What the reported numbers establish

The headline combines two results. The CI run reportedly passed six of six migrations. The second figure is worded ambiguously. The headline says a Neon branch of production passed 1, while the summary of the report attributes that single pass to production. Until the original run is checked, the location of the single pass should be treated as unresolved.

As an Amazon Associate I earn from qualifying purchases.

Both figures are the report’s own. Neon’s documentation does not verify this run, and it does not describe the migration framework, commands, or logs behind either number.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What Neon’s documentation says about branches in CI

Branches created for each pull request

Neon describes creating a database branch for each pull request through a GitHub Action as a CI/CD use case. This is the workflow that makes a branch useful for migration testing: the branch is an isolated database environment that a pipeline can create, run against, and discard. The documentation describes this as a capability. It does not report how any particular team’s pipeline performed.

#1 Best Overall

Copy-on-write clones of production for testing

Neon also describes creating a copy-on-write clone of a production database, with a dedicated compute endpoint, for testing. The environment is removed when testing is complete. A clone of this kind reflects production as it was when the branch was created, not as it is when production later receives its own migrations. That timing detail is central to any comparison between a branch run and a production run.

Reading a branch’s schema at a point in time

Neon’s branch schema retrieval endpoint can return the schema at the branch head, or at a specified log sequence number (LSN) or timestamp. It supports output as SQL or JSON. This lets a team read what a branch looked like at a chosen moment, which is useful when the question is what the starting state was.

Comparing schemas across branches

Neon’s schema comparison endpoint compares the schema of one database with another branch’s schema, and it accepts comparison points expressed as LSNs or timestamps. This can help show where two schemas diverge. It does not, on its own, explain why a migration passed or failed, because a schema diff describes the end state, not the sequence of steps that produced it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The default branch

According to Neon’s branch reference, a project starts with a root or default branch named main, and a project can contain one or more branches. If the report’s “production” and “branch” are both Neon branches, the question is which branch each run used and when that branch was created.

Why a branch and production can disagree

Several ordinary differences can produce different migration counts without any fault in the database itself. Each of them is a hypothesis to test, not a finding about this run:

  • Different starting points. A branch created before a production migration was applied will not contain that migration’s effects, and a later branch will contain them.
  • Different migration history. Migration tools record applied migrations in a history table. If the branch and production tables disagree, a tool may skip, re-run, or refuse migrations on one side.
  • Different migration sets. A pipeline may run migration files from a different commit, or with a different command, than the production deployment.
  • Different ways of counting. “Passed 6 of 6” and “passed 1” may count different things: migrations attempted, migrations applied, migrations eligible to run, or migrations reported as successful by a tool.

How to find where the counts diverge

  1. Record the exact commit used by the CI run and the exact commit deployed to production. If they differ, stop here: the runs are not comparable until the commits match.
  2. Record the creation time or LSN of the branch used in CI. Compare it with the time production applied each migration.
  3. Read the migration history table in both databases. List every migration recorded as applied, with its timestamp, and identify any migration that appears on one side only.
  4. Use Neon’s branch schema retrieval endpoint to read the schema of each database at the same LSN or timestamp. If no shared point exists, the schema comparison is not meaningful.
  5. Use Neon’s schema comparison endpoint between the two databases at that shared point to see whether the end states match.
  6. Read the CI log and the production deployment log for the first error, any skipped step, and the exit status of the migration command.

Comparison axes for the investigation

Check Question it answers Where to look
Commit and migration files Did both runs use the same migration files? CI configuration and production deployment record for the same commit
Starting point Was the branch created from production at the same state production had when its migrations ran? Branch creation time or LSN, compared with production deployment times
Migration history Which migrations does each database record as applied? The migration tool’s history table in each database
Schema state Do the schemas match at a shared LSN or timestamp? Neon’s branch schema retrieval and schema comparison endpoints
Execution record Did either run stop on an error or skip a step? CI log and production deployment log, including the migration command’s exit status
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What a complete report would need

A pass count becomes interpretable when it is published with the following details:

  • The migration framework and the exact command used in each environment.
  • The commit or migration set each run executed.
  • The definition of each count: attempted, applied, eligible, or reported successful.
  • The branch creation point and the production state at the time of each run, with timestamps.
  • The migration history rows from both databases, and the CI and deployment logs.
  • Where the single pass occurred, stated without ambiguity.

Neon’s documentation supports the branch-based workflow behind the test. It does not supply the records needed to explain the reported difference, and those records are the next thing to examine.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

CI/CDdatabase branchingDatabase MigrationsNEONPostgreSQLschema comparison

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.