Skip to content

Add upgrade flag that cleanups 0.9 objects and reinits#788

Merged
tsg merged 5 commits into
mainfrom
upgrade_flag
Jun 11, 2026
Merged

Add upgrade flag that cleanups 0.9 objects and reinits#788
tsg merged 5 commits into
mainfrom
upgrade_flag

Conversation

@tsg

@tsg tsg commented Apr 3, 2026

Copy link
Copy Markdown
Member

Description

Implementation of the plan from #787.

The implementation itself is pretty simple: if --upgrade is specified on run, it cleans up the objects that were created in v0.9, opening the door for init to create them with the new format.

The flag is idempotent (except for races) because it checks if the objects exists first.

Type of Change

Please select the relevant option(s):

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test coverage improvement
  • 🔨 Build/CI changes
  • 🧹 Code cleanup

Changes Made

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • All existing tests pass

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Code is well-commented
  • Documentation updated where necessary

Additional Notes

@tsg tsg enabled auto-merge (squash) June 3, 2026 09:39
@tsg tsg merged commit da95336 into main Jun 11, 2026
9 checks passed
@tsg tsg deleted the upgrade_flag branch June 11, 2026 11:32
@github-actions

Copy link
Copy Markdown

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/xataio/pgstream/cmd 0.00% (ø)
github.com/xataio/pgstream/pkg/stream 34.06% (-1.46%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/xataio/pgstream/cmd/init_cmd.go 0.00% (ø) 49 (+5) 0 49 (+5)
github.com/xataio/pgstream/cmd/root_cmd.go 0.00% (ø) 110 (+2) 0 110 (+2)
github.com/xataio/pgstream/cmd/run_cmd.go 0.00% (ø) 90 (+5) 0 90 (+5)
github.com/xataio/pgstream/pkg/stream/stream_init.go 5.97% (+0.09%) 134 (+32) 8 (+2) 126 (+30) 👍
github.com/xataio/pgstream/pkg/stream/stream_run.go 0.00% (ø) 88 0 88

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/xataio/pgstream/pkg/stream/stream_init_test.go

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