Skip to content

Commit

Permalink
Add RofV2 support flag to module metadata and command line options (#106
Browse files Browse the repository at this point in the history
)
  • Loading branch information
eranhd authored Nov 21, 2024
1 parent f15b62d commit 02cb985
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions RAMP/module_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
MIN_REDIS_VERSION = "4.0"
MIN_REDIS_PACK_VERSION = "5.2"
COMPATIBLE_REDIS_VERSION = "7.4"
BIGSTORE_VERSION_2_SUPPORT = False
RAMP_FORMAT_VERSION = 1
CONFIG_COMMAND = ""
OVERIDE_COMMAND = [] # type: List[Dict[str, str]]
Expand Down Expand Up @@ -57,6 +58,7 @@
"min_redis_pack_version",
"min_redis_version",
"compatible_redis_version",
"bigstore_version_2_support",
"module_file",
"module_name",
"os",
Expand Down Expand Up @@ -123,6 +125,7 @@ def create_default_metadata(module_path):
"min_redis_version": MIN_REDIS_VERSION,
"min_redis_pack_version": MIN_REDIS_PACK_VERSION,
"compatible_redis_version": COMPATIBLE_REDIS_VERSION,
"bigstore_version_2_support": BIGSTORE_VERSION_2_SUPPORT,
"sha256": sha256_checksum(module_path),
"commands": MODULE_COMMANDS,
"ramp_format_version": RAMP_FORMAT_VERSION,
Expand Down
1 change: 1 addition & 0 deletions RAMP/ramp.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def unpack(bundle):
@click.option('--redis-min-version', '-r', 'min_redis_version', default=None, help='redis minimum version')
@click.option('--redis-pack-min-version', '-R', 'min_redis_pack_version', default=None, help='redis pack minimum version')
@click.option('--redis-compatible-version', '-cr', 'compatible_redis_version', default=None, help='redis compatible version')
@click.option('--bigstore-version-2-support', 'bigstore_version_2_support', default=False, help='This module supports RofV2')
@click.option('--config-command', '-cc', default=None, help='command used to configure module args at runtime')
@click.option('--os', '-O', default=None, help='build target OS (Darwin/Linux)')
@click.option('--capabilities', '-C', callback=comma_seperated_to_list, help='comma separated list of module capabilities')
Expand Down
3 changes: 3 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def test_bundle_from_cmd():
min_redis_version = "4.6"
min_redis_pack_version = "5.0"
compatible_redis_version = "7.2"
bigstore_version_2_support = True
display_name = "test_module"
capability_name = "Test & Module"
module_name = "module_test"
Expand All @@ -123,6 +124,7 @@ def test_bundle_from_cmd():
'-d', display_name, '-b', capability_name, '-n', module_name,
'-h', homepage, '-l', _license, '-c', command_line_args,
'-r', min_redis_version, '-R', min_redis_pack_version, '-cr', compatible_redis_version,
'--bigstore-version-2-support', bigstore_version_2_support,
'-C', ','.join([cap['name'] for cap in MODULE_CAPABILITIES]),
'-o', BUNDLE_ZIP_FILE, '-cc', CONFIG_COMMAND, '-E', 'graph.bulk',
'-E', 'graph.BULK',
Expand Down Expand Up @@ -152,6 +154,7 @@ def test_bundle_from_cmd():
assert metadata["min_redis_version"] == min_redis_version
assert metadata["min_redis_pack_version"] == min_redis_pack_version
assert metadata["compatible_redis_version"] == compatible_redis_version
assert metadata["bigstore_version_2_support"] == bigstore_version_2_support
assert metadata["config_command"] == CONFIG_COMMAND
assert metadata["sha256"] == sha256_checksum(MODULE_FILE_PATH)
assert len(metadata["capabilities"]) == len(MODULE_CAPABILITIES)
Expand Down

0 comments on commit 02cb985

Please sign in to comment.