Skip to content

Combine the return values of Start into a single data class #945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 3, 2025

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Jul 2, 2025

New data structure holds the return value of Start function of operations.

type StartOperation struct {
    Actions []DBAction
    BackfillTask *backfill.Task
}

@github-actions github-actions bot temporarily deployed to Docs Preview July 2, 2025 13:10 Inactive
@kvch kvch requested a review from andrew-farries July 2, 2025 13:13
Copy link
Collaborator

@andrew-farries andrew-farries left a comment

Choose a reason for hiding this comment

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

Looks good 👍 ; suggested a rename for the new type

@@ -78,6 +78,11 @@ type (
VersionSchema string `json:"version_schema,omitempty"`
Operations json.RawMessage `json:"operations"`
}

StartOperation struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about calling this typeStartResult?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. Thank you for the suggestion!

@github-actions github-actions bot temporarily deployed to Docs Preview July 3, 2025 08:07 Inactive
@kvch kvch enabled auto-merge (squash) July 3, 2025 08:08
@kvch kvch merged commit 92bb10a into main Jul 3, 2025
29 checks passed
@kvch kvch deleted the refactoring-less-return-params branch July 3, 2025 08:09
Copy link

github-actions bot commented Jul 3, 2025

Merging this branch changes the coverage (1 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/xataio/pgroll/pkg/migrations 76.79% (+0.06%) 👍
github.com/xataio/pgroll/pkg/roll 79.23% (-0.17%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/xataio/pgroll/pkg/migrations/migrations.go 94.12% (ø) 17 16 1
github.com/xataio/pgroll/pkg/migrations/op_add_column.go 89.90% (ø) 99 89 10
github.com/xataio/pgroll/pkg/migrations/op_alter_column.go 90.27% (ø) 113 102 11
github.com/xataio/pgroll/pkg/migrations/op_change_type.go 92.86% (ø) 14 13 1
github.com/xataio/pgroll/pkg/migrations/op_create_constraint.go 85.05% (ø) 107 91 16
github.com/xataio/pgroll/pkg/migrations/op_create_index.go 67.50% (ø) 40 27 13
github.com/xataio/pgroll/pkg/migrations/op_create_table.go 85.71% (ø) 126 108 18
github.com/xataio/pgroll/pkg/migrations/op_drop_column.go 83.33% (ø) 24 20 4
github.com/xataio/pgroll/pkg/migrations/op_drop_constraint.go 92.50% (ø) 40 37 3
github.com/xataio/pgroll/pkg/migrations/op_drop_index.go 90.91% (ø) 11 10 1
github.com/xataio/pgroll/pkg/migrations/op_drop_multicolumn_constraint.go 94.74% (ø) 57 54 3
github.com/xataio/pgroll/pkg/migrations/op_drop_not_null.go 93.33% (ø) 15 14 1
github.com/xataio/pgroll/pkg/migrations/op_drop_table.go 94.44% (+0.33%) 18 (+1) 17 (+1) 1 👍
github.com/xataio/pgroll/pkg/migrations/op_raw_sql.go 89.47% (+0.58%) 19 (+1) 17 (+1) 2 👍
github.com/xataio/pgroll/pkg/migrations/op_rename_column.go 93.33% (ø) 30 28 2
github.com/xataio/pgroll/pkg/migrations/op_rename_constraint.go 100.00% (ø) 16 16 0
github.com/xataio/pgroll/pkg/migrations/op_rename_table.go 100.00% (ø) 15 15 0
github.com/xataio/pgroll/pkg/migrations/op_set_check.go 91.30% (ø) 23 21 2
github.com/xataio/pgroll/pkg/migrations/op_set_comment.go 90.91% (+0.91%) 11 (+1) 10 (+1) 1 👍
github.com/xataio/pgroll/pkg/migrations/op_set_default.go 89.47% (ø) 19 17 2
github.com/xataio/pgroll/pkg/migrations/op_set_fk.go 77.42% (ø) 31 24 7
github.com/xataio/pgroll/pkg/migrations/op_set_notnull.go 90.48% (ø) 21 19 2
github.com/xataio/pgroll/pkg/migrations/op_set_replica_identity.go 100.00% (ø) 18 (+1) 18 (+1) 0
github.com/xataio/pgroll/pkg/migrations/op_set_unique.go 78.26% (+0.99%) 23 (+1) 18 (+1) 5 👍
github.com/xataio/pgroll/pkg/roll/execute.go 77.84% (-0.32%) 176 (+2) 137 (+1) 39 (+1) 👎

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.

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