engine-schema: add script to generate upgrade path changes - #14034
engine-schema: add script to generate upgrade path changes#14034shwstppr wants to merge 2 commits into
Conversation
Given from and to versions the script will generate the basic upgrade path changes with Java class and schema upgrade and cleanup files. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #14034 +/- ##
=============================================
- Coverage 19.73% 3.53% -16.21%
=============================================
Files 6371 487 -5884
Lines 575784 41863 -533921
Branches 70478 7912 -62566
=============================================
- Hits 113659 1479 -112180
+ Misses 449772 40170 -409602
+ Partials 12353 214 -12139
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Adds a scaffolding script to generate a new engine-schema database upgrade path (Java upgrade class + schema/cleanup SQL files) and auto-wire it into DatabaseUpgradeChecker.java.
Changes:
- Introduces
engine/schema/create-upgrade-path.shto generate upgrade artifacts for a given from/to version. - Auto-updates
DatabaseUpgradeChecker.javaby inserting a newUpgrade<from>to<to>import and a.next(...)entry.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| IMPORT_LINE="import com.cloud.upgrade.dao.${CLASS_NAME};" | ||
| FIRST_IMPORT_LINE=$(grep -n '^import com\.cloud\.upgrade\.dao\.Upgrade' "$CHECKER_FILE" | head -1 | cut -d: -f1) | ||
| LAST_IMPORT_LINE=$(grep -n '^import com\.cloud\.upgrade\.dao\.Upgrade' "$CHECKER_FILE" | tail -1 | cut -d: -f1) | ||
|
|
| awk -v first="$FIRST_IMPORT_LINE" -v last="$LAST_IMPORT_LINE" -v importfile="$SORTED_IMPORTS_FILE" ' | ||
| NR == first { | ||
| while ((getline line < importfile) > 0) print line | ||
| } | ||
| NR >= first && NR <= last { next } | ||
| { print } | ||
| ' "$CHECKER_FILE" > "$TMP_CHECKER" |
|
can we change the example to 4.23.0 -> 24.0.0? |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Description
Given from and to versions the script will generate the basic upgrade path changes with Java class and schema upgrade and cleanup files.
Created #14033 changes with it.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?