Skip to content

Commit

Permalink
Fix the prepare_release for 11.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
onurctirtir committed Feb 3, 2023
1 parent 7ebe202 commit 985ca69
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions packaging_automation/prepare_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
MULTI_EXTENSION_SQL = "src/test/regress/sql/multi_extension.sql"
CITUS_CONTROL = "src/backend/distributed/citus.control"
MULTI_EXTENSION_OUT = "src/test/regress/expected/multi_extension.out"
CONFIG_PY = "src/test/regress/upgrade/config.py"
CONFIG_PY = "src/test/regress/citus_tests/config.py"
DISTRIBUTED_SQL_DIR_PATH = "src/backend/distributed/sql"
DOWNGRADES_DIR_PATH = f"{DISTRIBUTED_SQL_DIR_PATH}/downgrades"
CONFIGURE_IN = "configure.ac"
Expand All @@ -40,7 +40,7 @@
MULTI_EXT_DETAIL2_PATTERN = (
rf"^{MULTI_EXT_DETAIL_PREFIX}\d+\.\d+{MULTI_EXT_DETAIL2_SUFFIX}$")

CONFIG_PY_MASTER_VERSION_SEARCH_PATTERN = r"^MASTER_VERSION = '\d+\.\d+'"
CONFIG_PY_MASTER_VERSION_SEARCH_PATTERN = r'^MASTER_VERSION = "\d+\.\d+"'

CONFIGURE_IN_SEARCH_PATTERN = "AC_INIT*"
REPO_OWNER = "citusdata"
Expand All @@ -54,7 +54,7 @@
repo_details = {
"citus": {
"configure-in-str": "Citus",
"branch": "master"},
"branch": "main"},
"citus-enterprise": {
"configure-in-str": "Citus Enterprise",
"branch": "enterprise-master"}}
Expand Down Expand Up @@ -423,10 +423,10 @@ def add_downgrade_script_in_multi_extension_file(current_schema_version,
f"{template.render(current_schema_version=current_schema_version, upcoming_minor_version=f'{upcoming_minor_version}-1')}\n")

if not prepend_line_in_file(multi_extension_out_path,
"DROP TABLE prev_objects, extension_diff;",
"DROP TABLE multi_extension.prev_objects, multi_extension.extension_diff;",
string_to_prepend):
raise ValueError(f"Downgrade scripts could not be added in {multi_extension_out_path} since "
f"'DROP TABLE prev_objects, extension_diff;' script could not be found ")
f"'DROP TABLE multi_extension.prev_objects, multi_extension.extension_diff;' script could not be found ")
print(f"### Done Test downgrade scripts successfully added in {multi_extension_out_path}. ###")


Expand Down Expand Up @@ -458,7 +458,7 @@ def get_current_schema_from_citus_control(citus_control_file_path: str) -> str:
def update_version_with_upcoming_version_in_config_py(config_py_path, upcoming_minor_version):
print(f"### Updating {config_py_path} file with the upcoming version {upcoming_minor_version}... ###")
if not replace_line_in_file(config_py_path, CONFIG_PY_MASTER_VERSION_SEARCH_PATTERN,
f"MASTER_VERSION = '{upcoming_minor_version}'"):
f'MASTER_VERSION = "{upcoming_minor_version}"'):
raise ValueError(f"{config_py_path} does not have match for version")
print(f"### Done {config_py_path} file updated with the upcoming version {upcoming_minor_version}. ###")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
ALTER EXTENSION citus UPDATE TO '{{upcoming_minor_version}}';
ALTER EXTENSION citus UPDATE TO '{{current_schema_version}}';
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
SELECT * FROM multi_extension.print_extension_changes();
previous_object | current_object
---------------------------------------------------------------------
(0 rows)

-- Snapshot of state at {{upcoming_minor_version}}
ALTER EXTENSION citus UPDATE TO '{{upcoming_minor_version}}';
SELECT * FROM print_extension_changes();
SELECT * FROM multi_extension.print_extension_changes();
previous_object | current_object
---------------------------------------------------------------------
(0 rows)
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
ALTER EXTENSION citus UPDATE TO '{{upcoming_minor_version}}';
ALTER EXTENSION citus UPDATE TO '{{current_schema_version}}';
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
SELECT * FROM multi_extension.print_extension_changes();

-- Snapshot of state at {{upcoming_minor_version}}
ALTER EXTENSION citus UPDATE TO '{{upcoming_minor_version}}';
SELECT * FROM print_extension_changes();
SELECT * FROM multi_extension.print_extension_changes();

0 comments on commit 985ca69

Please sign in to comment.