Skip to content

Add upgrade flag that cleanups 0.9 objects and reinits#788

Open
tsg wants to merge 3 commits intomainfrom
upgrade_flag
Open

Add upgrade flag that cleanups 0.9 objects and reinits#788
tsg wants to merge 3 commits intomainfrom
upgrade_flag

Conversation

@tsg
Copy link
Copy Markdown
Member

@tsg tsg commented Apr 3, 2026

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

Merging this branch will decrease overall coverage

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

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% (ø) 92 (+2) 0 92 (+2)
github.com/xataio/pgstream/cmd/run_cmd.go 0.00% (ø) 87 (+5) 0 87 (+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