Skip to content
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

Require upgrade from 2.x #4112

Merged
merged 8 commits into from
Sep 16, 2024
Merged

Require upgrade from 2.x #4112

merged 8 commits into from
Sep 16, 2024

Conversation

qwerty287
Copy link
Contributor

Remove old DB migrations and require users to upgrade to 2.x first.

I don't think this has a big impact as there won't be many still using 1.x, but not sure - what do you think about this?

@qwerty287 qwerty287 added refactor delete or replace old code breaking will break existing installations if no manual action happens labels Sep 14, 2024
@qwerty287 qwerty287 added this to the 3.0.0 milestone Sep 14, 2024
@woodpecker-bot
Copy link
Contributor

woodpecker-bot commented Sep 14, 2024

@6543
Copy link
Member

6543 commented Sep 14, 2024

What are the benefits of removing it?

Else i just would let the upgrade path as wide as maintainable ...

@qwerty287
Copy link
Contributor Author

What are the benefits of removing it?

Less code, and especially because the migrations folder contains a lot of helper structs, but they're not always used properly. Migrations are really a somewhat critical part and requiring users to split it up can help to avoid problems if you try to upgrade from very old versions. We know that it works to upgrade from 1.x to 2.x and from 2.x to 3.x but we don't test upgrading 1.x to 3.x.
Also, I don't think there are many users that will be impacted by this, using 1.0 is a pretty bad idea and you can still update by upgrading to 2.x first.

@zc-devs
Copy link
Contributor

zc-devs commented Sep 15, 2024

Sounds like Nextcloud Approaching Upgrades.

@qwerty287
Copy link
Contributor Author

In general yes, but I wouldn't be that strict. Upgrading from any version to the next major should be possible (so e.g. 2.0 to 3.0)

Copy link

codecov bot commented Sep 15, 2024

Codecov Report

Attention: Patch coverage is 89.39394% with 7 lines in your changes missing coverage. Please review.

Project coverage is 26.28%. Comparing base (4289853) to head (7dc3240).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
server/store/datastore/migration/001_add_org_id.go 50.00% 0 Missing and 1 partial ⚠️
...re/migration/004_remove_secrets_plugin_only_col.go 50.00% 0 Missing and 1 partial ⚠️
...ation/005_convert_to_new_pipeline_errors_format.go 83.33% 0 Missing and 1 partial ⚠️
...datastore/migration/007_clean_registry_pipeline.go 66.66% 0 Missing and 1 partial ⚠️
...re/datastore/migration/008_set_default_forge_id.go 83.33% 0 Missing and 1 partial ⚠️
...re/datastore/migration/009_unify_columns_tables.go 92.85% 0 Missing and 1 partial ⚠️
...e/datastore/migration/012_rename_start_end_time.go 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4112      +/-   ##
==========================================
- Coverage   26.97%   26.28%   -0.69%     
==========================================
  Files         395      373      -22     
  Lines       27414    26918     -496     
==========================================
- Hits         7395     7076     -319     
+ Misses      19315    19190     -125     
+ Partials      704      652      -52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@6543
Copy link
Member

6543 commented Sep 15, 2024

How did you generate the new test database?

@qwerty287
Copy link
Contributor Author

Just executed it after commenting out the new migrations, so only those that were removed run.

@6543 6543 enabled auto-merge (squash) September 16, 2024 16:58
@6543 6543 merged commit c45e088 into woodpecker-ci:main Sep 16, 2024
7 checks passed
@woodpecker-bot woodpecker-bot mentioned this pull request Sep 16, 2024
1 task
@qwerty287 qwerty287 deleted the old-mig branch October 13, 2024 06:46
@woodpecker-bot woodpecker-bot mentioned this pull request Dec 14, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking will break existing installations if no manual action happens refactor delete or replace old code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants