Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): option to skip metadata update #3025

Merged
merged 11 commits into from Jul 19, 2022
4 changes: 2 additions & 2 deletions renku/ui/cli/rerun.py
Expand Up @@ -54,7 +54,7 @@
In some cases it may be desirable to avoid updating the renku metadata
and to avoid committing this and any other change in the repository when the rerun
command is used. If this is the case then you can pass the ``--skip-metadata-update``
flag (or simply ``-s``) to ``renku rerun``.
flag to ``renku rerun``.

.. cheatsheet::
:group: Running
Expand All @@ -74,7 +74,7 @@

@click.command()
@click.option("--dry-run", "-n", is_flag=True, default=False, help="Show a preview of plans that will be executed.")
@click.option("-s", "--skip-metadata-update", is_flag=True, help="Do not update the metadata store for the execution.")
@click.option("--skip-metadata-update", is_flag=True, help="Do not update the metadata store for the execution.")
@click.option(
"--from",
"sources",
Expand Down
4 changes: 2 additions & 2 deletions renku/ui/cli/update.py
Expand Up @@ -79,7 +79,7 @@
In some cases it may be desirable to avoid updating the renku metadata
and to avoid committing this and any other change in the repository when the update
command is run. If this is the case then you can pass the ``--skip-metadata-update``
flag (or simply ``-s``) to ``renku update``.
flag to ``renku update``.

.. cheatsheet::
:group: Running
Expand Down Expand Up @@ -172,7 +172,7 @@
"config", "-c", "--config", metavar="<config file>", help="YAML file containing configuration for the provider."
)
@click.option("-i", "--ignore-deleted", is_flag=True, help="Ignore deleted paths.")
@click.option("-s", "--skip-metadata-update", is_flag=True, help="Do not update the metadata store for the execution.")
@click.option("--skip-metadata-update", is_flag=True, help="Do not update the metadata store for the execution.")
def update(update_all, dry_run, paths, provider, config, ignore_deleted, skip_metadata_update):
"""Update existing files by rerunning their outdated workflow."""
from renku.command.format.activity import tabulate_activities
Expand Down
8 changes: 4 additions & 4 deletions renku/ui/cli/workflow.py
Expand Up @@ -152,7 +152,7 @@
In some cases it may be desirable to avoid updating the renku metadata
and to avoid committing this and any other change in the repository when a workflow
is executed. If this is the case then you can pass the ``--skip-metadata-update``
flag (or simply ``-s``) to ``renku workflow execute``.
flag to ``renku workflow execute``.

Iterate Plans
*************
Expand Down Expand Up @@ -220,7 +220,7 @@
In some cases it may be desirable to avoid updating the renku metadata
and to avoid committing this and any other change in the repository when a workflow
is iterated through. If this is the case then you can pass the ``--skip-metadata-update``
flag (or simply ``-s``) to ``renku workflow iterate``.
flag to ``renku workflow iterate``.

Exporting Plans
***************
Expand Down Expand Up @@ -1093,7 +1093,7 @@ def outputs(ctx, paths):
type=click.Path(exists=True, dir_okay=False),
help="YAML file containing parameter mappings to be used.",
)
@click.option("-s", "--skip-metadata-update", is_flag=True, help="Do not update the metadata store for the execution.")
@click.option("--skip-metadata-update", is_flag=True, help="Do not update the metadata store for the execution.")
@click.argument("name_or_id", required=True, shell_complete=_complete_workflows)
def execute(
provider,
Expand Down Expand Up @@ -1208,7 +1208,7 @@ def visualize(sources, columns, exclude_files, ascii, interactive, no_color, pag


@workflow.command()
@click.option("-s", "--skip-metadata-update", is_flag=True, help="Do not update the metadata store for the execution.")
@click.option("--skip-metadata-update", is_flag=True, help="Do not update the metadata store for the execution.")
@click.option(
"mapping_path",
"--mapping",
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/test_rerun.py
Expand Up @@ -47,7 +47,7 @@ def test_rerun(project, client, client_database_injection_manager, renku_cli, pr
def rerun():
cmd = ["rerun", "-p", provider]
if skip_metadata_update:
cmd.append("-s")
cmd.append("--skip-metadata-update")
cmd.append(output)
assert 0 == renku_cli(*cmd).exit_code
with client_database_injection_manager(client):
Expand Down
4 changes: 2 additions & 2 deletions tests/cli/test_update.py
Expand Up @@ -48,7 +48,7 @@ def test_update(runner, client, renku_cli, client_database_injection_manager, pr

cmd = ["update", "-p", provider, "--all"]
if skip_metadata_update:
cmd.append("-s")
cmd.append("--skip-metadata-update")
exit_code, activity = renku_cli(*cmd)

assert 0 == exit_code
Expand Down Expand Up @@ -100,7 +100,7 @@ def test_update_multiple_steps(

cmd = ["update", "-p", provider, "--all"]
if skip_metadata_update:
cmd.append("-s")
cmd.append("--skip-metadata-update")
exit_code, activities = renku_cli(*cmd)

assert 0 == exit_code
Expand Down
5 changes: 2 additions & 3 deletions tests/cli/test_workflow.py
Expand Up @@ -22,7 +22,6 @@
import logging
import os
import re
import sys
import tempfile
import uuid
from pathlib import Path
Expand Down Expand Up @@ -1133,7 +1132,7 @@ def test_workflow_iterate(
iteration_cmd = ["renku", "workflow", "iterate", "-p", provider]
outputs = []
if skip_metadata_update:
iteration_cmd.append("-s")
iteration_cmd.append("--skip-metadata-update")
iteration_cmd.append(workflow_name)
index_re = re.compile(r"{iter_index}")

Expand Down Expand Up @@ -1253,7 +1252,7 @@ def test_workflow_cycle_detection(run_shell, project, capsys, client):
assert b"Cycles detected in execution graph" in result[0]


@pytest.mark.skipif(sys.platform == "darwin", reason="GitHub macOS image doesn't include Docker")
# @pytest.mark.skipif(sys.platform == "darwin", reason="GitHub macOS image doesn't include Docker")
olevski marked this conversation as resolved.
Show resolved Hide resolved
def test_workflow_execute_docker_toil(runner, client, run_shell, caplog):
"""Test workflow execute using docker with the toil provider."""
caplog.set_level(logging.INFO)
Expand Down