You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@aurora.apache.org by Michael Leinartas <ml...@gmail.com> on 2015/06/22 23:37:18 UTC

Review Request 35745: Allow equals in bound variables passed via cmdline

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35745/
-----------------------------------------------------------

Review request for Aurora.


Repository: aurora


Description
-------

- Allow equals in bound variables passed via cmdline

The parsing for the --bind parameter splits the parameter value on equals and enforces only two elements. This prevents parameters whose value contains an equals to be passed.

Example case:
    HELLO_WORLD = Job(
         name = 'hello',
         role = 'bozo',
         cluster = 'west',
         environment = 'test',
         instances = 1,
         update_config = UpdateConfig(
           batch_size = 1,
           restart_threshold = 60,
           watch_secs = 45,
           max_per_shard_failures = 2,
         ),
         task = Task(
           name = 'test',
           processes = [Process(name = 'hello_world', cmdline = 'echo {{flags}}')],
           resources = Resources(cpu = 0.1, ram = 64 * MB, disk = 64 * MB),
         )
       )
       jobs = [HELLO_WORLD]
       

aurora job create --bind flags=-myflag=value west/bozo/test/hello ./hello_world.aurora

Instead, the split() should use the maxsplit parameter to limit to 1 match and leave additional equals signs in the parameter


Diffs
-----

  src/main/python/apache/aurora/client/cli/options.py f8ac25287e296bcec89d3701738c7dd06ffae133 

Diff: https://reviews.apache.org/r/35745/diff/


Testing
-------

Tried adding an equals to bind parameter (cluster_binding) in test_simple_successful_create_job_with_bindings and re-ran tests


Thanks,

Michael Leinartas


Re: Review Request 35745: Allow equals in bound variables passed via cmdline

Posted by Aurora ReviewBot <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35745/#review88857
-----------------------------------------------------------


Master (3351b09) is green with this patch.
  ./build-support/jenkins/build.sh

However, it appears that it might lack test coverage.

I will refresh this build result if you post a review containing "@ReviewBot retry"

- Aurora ReviewBot


On June 22, 2015, 9:39 p.m., Michael Leinartas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35745/
> -----------------------------------------------------------
> 
> (Updated June 22, 2015, 9:39 p.m.)
> 
> 
> Review request for Aurora.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> - Allow equals in bound variables passed via cmdline
> 
> The parsing for the --bind parameter splits the parameter value on equals and enforces only two elements. This prevents parameters whose value contains an equals to be passed.
> 
> Example case:
>     HELLO_WORLD = Job(
>          name = 'hello',
>          role = 'bozo',
>          cluster = 'west',
>          environment = 'test',
>          instances = 1,
>          update_config = UpdateConfig(
>            batch_size = 1,
>            restart_threshold = 60,
>            watch_secs = 45,
>            max_per_shard_failures = 2,
>          ),
>          task = Task(
>            name = 'test',
>            processes = [Process(name = 'hello_world', cmdline = 'echo {{flags}}')],
>            resources = Resources(cpu = 0.1, ram = 64 * MB, disk = 64 * MB),
>          )
>        )
>        jobs = [HELLO_WORLD]
>        
> 
> aurora job create --bind flags=-myflag=value west/bozo/test/hello ./hello_world.aurora
> 
> Instead, the split() should use the maxsplit parameter to limit to 1 match and leave additional equals signs in the parameter
> 
> 
> Diffs
> -----
> 
>   src/main/python/apache/aurora/client/cli/options.py f8ac25287e296bcec89d3701738c7dd06ffae133 
> 
> Diff: https://reviews.apache.org/r/35745/diff/
> 
> 
> Testing
> -------
> 
> Tried adding an equals to bind parameter (cluster_binding) in test_simple_successful_create_job_with_bindings and re-ran tests
> 
> 
> Thanks,
> 
> Michael Leinartas
> 
>


Re: Review Request 35745: Allow equals in bound variables passed via cmdline

Posted by Michael Leinartas <ml...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35745/
-----------------------------------------------------------

(Updated June 22, 2015, 10:09 p.m.)


Review request for Aurora.


Changes
-------

Modified binding test to include this case

@ReviewBot retry


Repository: aurora


Description
-------

- Allow equals in bound variables passed via cmdline

The parsing for the --bind parameter splits the parameter value on equals and enforces only two elements. This prevents parameters whose value contains an equals to be passed.

Example case:
    HELLO_WORLD = Job(
         name = 'hello',
         role = 'bozo',
         cluster = 'west',
         environment = 'test',
         instances = 1,
         update_config = UpdateConfig(
           batch_size = 1,
           restart_threshold = 60,
           watch_secs = 45,
           max_per_shard_failures = 2,
         ),
         task = Task(
           name = 'test',
           processes = [Process(name = 'hello_world', cmdline = 'echo {{flags}}')],
           resources = Resources(cpu = 0.1, ram = 64 * MB, disk = 64 * MB),
         )
       )
       jobs = [HELLO_WORLD]
       

aurora job create --bind flags=-myflag=value west/bozo/test/hello ./hello_world.aurora

Instead, the split() should use the maxsplit parameter to limit to 1 match and leave additional equals signs in the parameter


Diffs (updated)
-----

  src/main/python/apache/aurora/client/cli/options.py f8ac25287e296bcec89d3701738c7dd06ffae133 
  src/test/python/apache/aurora/client/cli/test_create.py 9f32ca3474ea51529217db29b88911010fa73602 
  src/test/python/apache/aurora/client/cli/util.py 053c9a56248848478ca2fe6ab2c12e24c3d93c13 

Diff: https://reviews.apache.org/r/35745/diff/


Testing (updated)
-------

Added a new binding to UNBOUND_CONFIG and a matching --bind parameter with an equals sign in it to test_simple_successful_create_job_with_bindings (test_create.py)

    $ ./pants test --test-pytest-options='-k _bindings' src/test/python/apache/aurora:all
passes


Thanks,

Michael Leinartas


Re: Review Request 35745: Allow equals in bound variables passed via cmdline

Posted by Zameer Manji <zm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35745/#review88850
-----------------------------------------------------------


Thanks for your contribution! Would you please add me to the people line of the review?

Also, would you mind adding the testcase you described to the test? This way regressions can be caught.

- Zameer Manji


On June 22, 2015, 2:39 p.m., Michael Leinartas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35745/
> -----------------------------------------------------------
> 
> (Updated June 22, 2015, 2:39 p.m.)
> 
> 
> Review request for Aurora.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> - Allow equals in bound variables passed via cmdline
> 
> The parsing for the --bind parameter splits the parameter value on equals and enforces only two elements. This prevents parameters whose value contains an equals to be passed.
> 
> Example case:
>     HELLO_WORLD = Job(
>          name = 'hello',
>          role = 'bozo',
>          cluster = 'west',
>          environment = 'test',
>          instances = 1,
>          update_config = UpdateConfig(
>            batch_size = 1,
>            restart_threshold = 60,
>            watch_secs = 45,
>            max_per_shard_failures = 2,
>          ),
>          task = Task(
>            name = 'test',
>            processes = [Process(name = 'hello_world', cmdline = 'echo {{flags}}')],
>            resources = Resources(cpu = 0.1, ram = 64 * MB, disk = 64 * MB),
>          )
>        )
>        jobs = [HELLO_WORLD]
>        
> 
> aurora job create --bind flags=-myflag=value west/bozo/test/hello ./hello_world.aurora
> 
> Instead, the split() should use the maxsplit parameter to limit to 1 match and leave additional equals signs in the parameter
> 
> 
> Diffs
> -----
> 
>   src/main/python/apache/aurora/client/cli/options.py f8ac25287e296bcec89d3701738c7dd06ffae133 
> 
> Diff: https://reviews.apache.org/r/35745/diff/
> 
> 
> Testing
> -------
> 
> Tried adding an equals to bind parameter (cluster_binding) in test_simple_successful_create_job_with_bindings and re-ran tests
> 
> 
> Thanks,
> 
> Michael Leinartas
> 
>


Re: Review Request 35745: Allow equals in bound variables passed via cmdline

Posted by Michael Leinartas <ml...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35745/
-----------------------------------------------------------

(Updated June 22, 2015, 9:39 p.m.)


Review request for Aurora.


Repository: aurora


Description
-------

- Allow equals in bound variables passed via cmdline

The parsing for the --bind parameter splits the parameter value on equals and enforces only two elements. This prevents parameters whose value contains an equals to be passed.

Example case:
    HELLO_WORLD = Job(
         name = 'hello',
         role = 'bozo',
         cluster = 'west',
         environment = 'test',
         instances = 1,
         update_config = UpdateConfig(
           batch_size = 1,
           restart_threshold = 60,
           watch_secs = 45,
           max_per_shard_failures = 2,
         ),
         task = Task(
           name = 'test',
           processes = [Process(name = 'hello_world', cmdline = 'echo {{flags}}')],
           resources = Resources(cpu = 0.1, ram = 64 * MB, disk = 64 * MB),
         )
       )
       jobs = [HELLO_WORLD]
       

aurora job create --bind flags=-myflag=value west/bozo/test/hello ./hello_world.aurora

Instead, the split() should use the maxsplit parameter to limit to 1 match and leave additional equals signs in the parameter


Diffs (updated)
-----

  src/main/python/apache/aurora/client/cli/options.py f8ac25287e296bcec89d3701738c7dd06ffae133 

Diff: https://reviews.apache.org/r/35745/diff/


Testing
-------

Tried adding an equals to bind parameter (cluster_binding) in test_simple_successful_create_job_with_bindings and re-ran tests


Thanks,

Michael Leinartas