cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

refactoring views out of upgrade db schema scripts

Open KlausDornsbach opened this issue 1 year ago • 17 comments

Description

Based on the comment https://github.com/apache/cloudstack/pull/9385#issuecomment-2227061721 from @DaanHoogland, and considering that all the DB view definitions are currently refactored out of the DB upgrade schema sql scripts, I took the liberty to delete most of the remaining unused view definitions on these scripts, as they are overwritten in the end of the DB upgrade workflow.

Types of changes

  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] Enhancement (improves an existing feature and functionality)
  • [x] Cleanup (Code refactoring and cleanup, that may add test cases)
  • [ ] build/CI

Feature/Enhancement Scale

  • [ ] Major
  • [x] Minor

How Has This Been Tested?

Tested resetting the database to the 4.0.0 version via the management script cloudstack-setup-databases. After the database reset, the management server was also reset to ensure it ran all upgrade scripts.

Once the reset process was completed, various API operations were tested, particularly those that use database views to build their responses. Verifying the behavior was the same after the changes. During these tests, normal behavior was consistently observed. All API operations performed as expected, with no errors encountered.

Furthermore, the log stream was monitored throughout the testing phase to detect any potential issues or anomalies. The logs remained clear, showing no errors or warnings related to the current refactor.

KlausDornsbach avatar Jul 16 '24 16:07 KlausDornsbach

@blueorangutan package

DaanHoogland avatar Jul 16 '24 18:07 DaanHoogland

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jul 16 '24 18:07 blueorangutan

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 15.55%. Comparing base (b215abc) to head (b5a8602). :warning: Report is 1111 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##               main    #9401    +/-   ##
==========================================
  Coverage     15.55%   15.55%            
- Complexity    12010    12011     +1     
==========================================
  Files          5500     5500            
  Lines        481850   481850            
  Branches      61843    61718   -125     
==========================================
+ Hits          74935    74939     +4     
+ Misses       398628   398623     -5     
- Partials       8287     8288     +1     
Flag Coverage Δ
uitests 4.17% <ø> (ø)
unittests 16.33% <ø> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jul 16 '24 18:07 codecov[bot]

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10381

blueorangutan avatar Jul 16 '24 19:07 blueorangutan

@blueorangutan test

DaanHoogland avatar Jul 17 '24 06:07 DaanHoogland

@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

blueorangutan avatar Jul 17 '24 06:07 blueorangutan

[SF] Trillian Build Failed (tid-10883)

blueorangutan avatar Jul 17 '24 06:07 blueorangutan

Thanks for the heads up, did a double check and things are looking fine

KlausDornsbach avatar Jul 17 '24 13:07 KlausDornsbach

[SF] Trillian test result (tid-10905) Environment: kvm-alma8 (x2), Advanced Networking with Mgmt server a8 Total time taken: 49093 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9401-t10905-kvm-alma8.zip Smoke tests completed. 135 look OK, 2 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_add_multiple_annotations Failure 2.26 test_annotations.py
test_06_purge_expunged_vm_background_task Failure 341.12 test_purge_expunged_vms.py

blueorangutan avatar Jul 18 '24 23:07 blueorangutan

LGTM, but I'm not sure if it would break anything that may require the views to be created during db upgrade paths are executed and before the views are created (or re-created). I also don't know if this needs upgrade tests across different versions & hypervisor combinations. Worth investigating them, before merging this.

rohityadavcloud avatar Jul 19 '24 05:07 rohityadavcloud

LGTM, but I'm not sure if it would break anything that may require the views to be created during db upgrade paths are executed and before the views are created (or re-created). I also don't know if this needs upgrade tests across different versions & hypervisor combinations. Worth investigating them, before merging this.

good point about the upgrades, @rohityadavcloud . I'll start at least from 4.19 and 4.18. We can always advice to upgrade stepwise via any of those first.

DaanHoogland avatar Jul 19 '24 08:07 DaanHoogland

@rohityadavcloud , both upgradespassed in the an automated upgrade test with test VMs etc. Is this good enough you think?

DaanHoogland avatar Jul 19 '24 12:07 DaanHoogland

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Aug 14 '24 13:08 github-actions[bot]

@KlausDornsbach , can you resolve the conflicts, please?

DaanHoogland avatar Aug 14 '24 14:08 DaanHoogland

@blueorangutan package

DaanHoogland avatar Aug 22 '24 13:08 DaanHoogland

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Aug 22 '24 13:08 blueorangutan

Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 10758

blueorangutan avatar Aug 22 '24 15:08 blueorangutan