refactoring views out of upgrade db schema scripts
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.
@blueorangutan package
@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.
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.
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10381
@blueorangutan test
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
[SF] Trillian Build Failed (tid-10883)
Thanks for the heads up, did a double check and things are looking fine
[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 |
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.
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.
@rohityadavcloud , both upgradespassed in the an automated upgrade test with test VMs etc. Is this good enough you think?
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@KlausDornsbach , can you resolve the conflicts, please?
@blueorangutan package
@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.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 10758