Skip to content

Commit

Permalink
Merge pull request #103 from RedisLabsModules/add_redis_compatible_ve…
Browse files Browse the repository at this point in the history
…rsion_field

Add redis compatible version field [MOD-6995]
  • Loading branch information
alonre24 authored May 2, 2024
2 parents 9e7407d + 4b45a84 commit 9e3e2d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RAMP/module_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
RUN_COMMAND_LINE_ARGS = None
MIN_REDIS_VERSION = "4.0"
MIN_REDIS_PACK_VERSION = "5.2"
COMPATIBLE_REDIS_VERSION = "7.4"
RAMP_FORMAT_VERSION = 1
CONFIG_COMMAND = ""
OVERIDE_COMMAND = [] # type: List[Dict[str, str]]
Expand Down Expand Up @@ -55,6 +56,7 @@
"license",
"min_redis_pack_version",
"min_redis_version",
"compatible_redis_version",
"module_file",
"module_name",
"os",
Expand Down Expand Up @@ -120,6 +122,7 @@ def create_default_metadata(module_path):
"optional-dependencies": MODULE_OPTIONAL_DEPENDENCIES,
"min_redis_version": MIN_REDIS_VERSION,
"min_redis_pack_version": MIN_REDIS_PACK_VERSION,
"compatible_redis_version": COMPATIBLE_REDIS_VERSION,
"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 @@ -98,6 +98,7 @@ def unpack(bundle):
@click.option('--runcmdargs', 'run_command_line_args', default=None, help='if set, use those args when running the redis server')
@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('--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
4 changes: 3 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,15 @@ def test_bundle_from_cmd():
command_line_args = "\\\"-output f --level debug\\\""
min_redis_version = "4.6"
min_redis_pack_version = "5.0"
compatible_redis_version = "7.2"
display_name = "test_module"
capability_name = "Test & Module"
module_name = "module_test"

argv = [MODULE_FILE_PATH, '-a', author, '-e', email, '-D', description,
'-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,
'-r', min_redis_version, '-R', min_redis_pack_version, '-cr', compatible_redis_version,
'-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 @@ -150,6 +151,7 @@ def test_bundle_from_cmd():
assert metadata["command_line_args"] == command_line_args
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["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 9e3e2d6

Please sign in to comment.