Skip to content

Commit 29d49c5

Browse files
committed
Fix prepare_release for 11.2 release
1 parent 44a29ed commit 29d49c5

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

packaging_automation/prepare_release.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
MULTI_EXTENSION_SQL = "src/test/regress/sql/multi_extension.sql"
3737
CITUS_CONTROL = "src/backend/distributed/citus.control"
3838
MULTI_EXTENSION_OUT = "src/test/regress/expected/multi_extension.out"
39-
CONFIG_PY = "src/test/regress/upgrade/config.py"
39+
CONFIG_PY = "src/test/regress/citus_tests/config.py"
4040
DISTRIBUTED_SQL_DIR_PATH = "src/backend/distributed/sql"
4141
DOWNGRADES_DIR_PATH = f"{DISTRIBUTED_SQL_DIR_PATH}/downgrades"
42-
CONFIGURE_IN = "configure.ac"
42+
CONFIGURE_AC = "configure.ac"
4343
CONFIGURE = "configure"
4444
CITUS_CONTROL_SEARCH_PATTERN = r"^default_version*"
4545

@@ -57,9 +57,9 @@
5757
rf"^{MULTI_EXT_DETAIL_PREFIX}\d+\.\d+{MULTI_EXT_DETAIL2_SUFFIX}$"
5858
)
5959

60-
CONFIG_PY_MASTER_VERSION_SEARCH_PATTERN = r"^MASTER_VERSION = '\d+\.\d+'"
60+
CONFIG_PY_MASTER_VERSION_SEARCH_PATTERN = r'^MASTER_VERSION = "\d+\.\d+"'
6161

62-
CONFIGURE_IN_SEARCH_PATTERN = "AC_INIT*"
62+
CONFIGURE_AC_SEARCH_PATTERN = "AC_INIT*"
6363
REPO_OWNER = "citusdata"
6464

6565
BASE_PATH = pathlib2.Path(__file__).parent.absolute()
@@ -69,7 +69,7 @@
6969
MULTI_EXT_SQL_TEMPLATE_FILE = "multi_extension_sql_prepare_release.tmpl"
7070

7171
repo_details = {
72-
"citus": {"configure-in-str": "Citus", "branch": "master"},
72+
"citus": {"configure-in-str": "Citus", "branch": "main"},
7373
"citus-enterprise": {
7474
"configure-in-str": "Citus Enterprise",
7575
"branch": "enterprise-master",
@@ -187,7 +187,7 @@ def update_release(
187187
multi_extension_out_path=f"{exec_path}/{MULTI_EXTENSION_OUT}",
188188
multi_extension_sql_path=f"{exec_path}/{MULTI_EXTENSION_SQL}",
189189
citus_control_file_path=f"{exec_path}/{CITUS_CONTROL}",
190-
configure_in_path=f"{exec_path}/{CONFIGURE_IN}",
190+
configure_in_path=f"{exec_path}/{CONFIGURE_AC}",
191191
config_py_path=f"{exec_path}/{CONFIG_PY}",
192192
distributed_dir_path=f"{exec_path}/{DISTRIBUTED_SQL_DIR_PATH}",
193193
downgrades_dir_path=f"{exec_path}/{DOWNGRADES_DIR_PATH}",
@@ -560,12 +560,13 @@ def add_downgrade_script_in_multi_extension_file(
560560

561561
if not prepend_line_in_file(
562562
multi_extension_out_path,
563-
"DROP TABLE prev_objects, extension_diff;",
563+
"DROP TABLE multi_extension.prev_objects, multi_extension.extension_diff;",
564564
string_to_prepend,
565565
):
566566
raise ValueError(
567567
f"Downgrade scripts could not be added in {multi_extension_out_path} since "
568-
f"'DROP TABLE prev_objects, extension_diff;' script could not be found "
568+
"'DROP TABLE multi_extension.prev_objects, multi_extension.extension_diff;' "
569+
"script could not be found "
569570
)
570571
print(
571572
f"### Done Test downgrade scripts successfully added in {multi_extension_out_path}. ###"
@@ -696,7 +697,7 @@ def update_version_in_configure_in(project_name, configure_in_path, project_vers
696697
print(f"### Updating version on file {configure_in_path}... ###")
697698
if not replace_line_in_file(
698699
configure_in_path,
699-
CONFIGURE_IN_SEARCH_PATTERN,
700+
CONFIGURE_AC_SEARCH_PATTERN,
700701
f"AC_INIT([{repo_details[project_name]['configure-in-str']}], [{project_version}])",
701702
):
702703
raise ValueError(f"{configure_in_path} does not have match for version")

packaging_automation/templates/multi_extension_out_prepare_release.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
ALTER EXTENSION citus UPDATE TO '{{upcoming_minor_version}}';
33
ALTER EXTENSION citus UPDATE TO '{{current_schema_version}}';
44
-- Should be empty result since upgrade+downgrade should be a no-op
5-
SELECT * FROM print_extension_changes();
5+
SELECT * FROM multi_extension.print_extension_changes();
66
previous_object | current_object
77
---------------------------------------------------------------------
88
(0 rows)
99

1010
-- Snapshot of state at {{upcoming_minor_version}}
1111
ALTER EXTENSION citus UPDATE TO '{{upcoming_minor_version}}';
12-
SELECT * FROM print_extension_changes();
12+
SELECT * FROM multi_extension.print_extension_changes();
1313
previous_object | current_object
1414
---------------------------------------------------------------------
1515
(0 rows)

packaging_automation/templates/multi_extension_sql_prepare_release.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
ALTER EXTENSION citus UPDATE TO '{{upcoming_minor_version}}';
33
ALTER EXTENSION citus UPDATE TO '{{current_schema_version}}';
44
-- Should be empty result since upgrade+downgrade should be a no-op
5-
SELECT * FROM print_extension_changes();
5+
SELECT * FROM multi_extension.print_extension_changes();
66

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

packaging_automation/tests/test_prepare_release.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
MULTI_EXTENSION_OUT,
1717
MULTI_EXTENSION_SQL,
1818
CONFIGURE,
19-
CONFIGURE_IN,
19+
CONFIGURE_AC,
2020
CITUS_CONTROL,
2121
CONFIG_PY,
2222
ProjectParams,
@@ -74,7 +74,7 @@ def test_major_release():
7474

7575
assert file_includes_line(test_base_path_major, MULTI_EXTENSION_OUT, " 10.1.0")
7676
assert file_includes_line(
77-
test_base_path_major, CONFIGURE_IN, "AC_INIT([Citus], [10.1.0])"
77+
test_base_path_major, CONFIGURE_AC, "AC_INIT([Citus], [10.1.0])"
7878
)
7979
assert file_includes_line(
8080
test_base_path_major, CONFIGURE, "PACKAGE_VERSION='10.1.0'"
@@ -154,7 +154,7 @@ def test_major_release():
154154
test_base_path_major, CONFIG_PY, "MASTER_VERSION = '10.2'"
155155
)
156156
assert file_includes_line(
157-
test_base_path_major, CONFIGURE_IN, "AC_INIT([Citus], [10.2devel])"
157+
test_base_path_major, CONFIGURE_AC, "AC_INIT([Citus], [10.2devel])"
158158
)
159159
assert file_includes_line(
160160
test_base_path_major, CONFIGURE, "PACKAGE_VERSION='10.2devel'"
@@ -213,7 +213,7 @@ def test_patch_release():
213213
)
214214
assert file_includes_line(
215215
test_base_path_patch,
216-
CONFIGURE_IN,
216+
CONFIGURE_AC,
217217
f"AC_INIT([Citus], [{project_params.project_version}])",
218218
)
219219
assert file_includes_line(

0 commit comments

Comments
 (0)