nebius/SWE-bench-extra huggingface dataset:
Repository: typesafehub/conductr-cli

Issue:
Running sandbox with unparseable version should give nicer error
When I run `sandbox run abc`, I expect the program will give me an error that is understandable.

Instead, I get this:

```
~/work/conductr-crash/target/bundle $ sandbox run abc
Error: Encountered unexpected error.
Error: Reason: ValueError invalid literal for int() with base 10: 'a'
Error: Further information of the error can be found in the error log file: /home/longshorej/.conductr/errors.log
-> 1
```

Comments:

Patch:
diff --git a/conductr_cli/sandbox_main.py b/conductr_cli/sandbox_main.py
index 657dd85..d07aba2 100644
--- a/conductr_cli/sandbox_main.py
+++ b/conductr_cli/sandbox_main.py
@@ -33,6 +33,7 @@ def build_parser():
     add_image_dir(run_parser)
     run_parser.add_argument('image_version',
                             nargs='?',
+                            type=validation.argparse_version,
                             help='Version of the ConductR docker image to use\n'
                                  'To obtain the current version and additional information, please visit\n'
                                  'http://lightbend.com/product/conductr/developer')
diff --git a/conductr_cli/validation.py b/conductr_cli/validation.py
index 201c7c3..88143b2 100644
--- a/conductr_cli/validation.py
+++ b/conductr_cli/validation.py
@@ -464,3 +464,13 @@ def format_timestamp(timestamp, args):
 
 def get_logger_for_func(func):
     return logging.getLogger('conductr_cli.{}'.format(func.__name__))
+
+
+def argparse_version(value):
+    import argparse
+    import re
+
+    if re.match("^[0-9]+([.][0-9]+)*$", value):
+        return value
+
+    raise argparse.ArgumentTypeError("'%s' is not a valid version number" % value)


Test patch:
diff --git a/conductr_cli/test/test_validation.py b/conductr_cli/test/test_validation.py
new file mode 100644
index 0000000..049ebd2
--- /dev/null
+++ b/conductr_cli/test/test_validation.py
@@ -0,0 +1,30 @@
+from argparse import ArgumentTypeError
+from conductr_cli.validation import argparse_version
+from conductr_cli.test.cli_test_case import CliTestCase
+
+
+class TestTerminal(CliTestCase):
+    def test_argparse_version_number(self):
+        def expect_fail(value):
+            passed = False
+
+            try:
+                argparse_version(value)
+            except ArgumentTypeError:
+                passed = True
+
+            self.assertTrue(passed)
+
+        def expect_pass(value):
+            self.assertEqual(argparse_version(value), value)
+
+        expect_pass('1')
+        expect_pass('1.1')
+        expect_pass('1.1.0')
+        expect_pass('1.2.3.4.5')
+        expect_pass('2')
+        expect_pass('2.0.0')
+
+        expect_fail('potato')
+        expect_fail('1.')
+        expect_fail(' asdf 1 hello')
Repository: typesafehub/conductr-cli

Issue:
load-license message not needed?
Encountered this while upgrading conductr cluster from alpha1 to alpha3:
```
conduct load-license -f <<< '...'

An access token is required. Please visit https://www.lightbend.com/account/access-token to
obtain one, and a free license or your commercial one.

Please enter your access token: Loading license into ConductR at 172.31.60.175

Licensed To: 1d1400b6-3e12-45fe-b0cc-15790b5a9b73
Expires In: 364 days (Fri 04 May 2018 01:21AM)
Grants: akka-sbr, cinnamon, conductr

License successfully loaded
```

The initial message is confusing. 
1) I'm loading a new access token so the message is out of place to begin with. 
2) What does " and a free license or your commercial one" mean? Perhaps just omit that?


Comments:

Patch:
diff --git a/conductr_cli/license_auth.py b/conductr_cli/license_auth.py
index b1d2128..1ab3c67 100644
--- a/conductr_cli/license_auth.py
+++ b/conductr_cli/license_auth.py
@@ -1,5 +1,6 @@
 from conductr_cli.constants import DEFAULT_AUTH_TOKEN_FILE
 import os
+import sys
 try:
     import readline
 except ImportError:
@@ -7,7 +8,7 @@ except ImportError:
 
 
 AUTH_TOKEN_PROMPT = '\nAn access token is required. Please visit https://www.lightbend.com/account/access-token to \n' \
-                    'obtain one, and a free license or your commercial one.\n' \
+                    'obtain one for free and commercial licenses.\n' \
                     '\n' \
                     'Please enter your access token: '
 
@@ -34,7 +35,10 @@ def prompt_for_auth_token():
     readline.clear_history()
 
     try:
-        return input(AUTH_TOKEN_PROMPT).strip()
+        if sys.stdin.isatty():
+            return input(AUTH_TOKEN_PROMPT).strip()
+        else:
+            return input().strip()
     except EOFError:
         return ''
 


Test patch:
diff --git a/conductr_cli/test/test_license_auth.py b/conductr_cli/test/test_license_auth.py
index 727cf24..0c7b5b1 100644
--- a/conductr_cli/test/test_license_auth.py
+++ b/conductr_cli/test/test_license_auth.py
@@ -39,11 +39,25 @@ class TestPromptForAuthToken(TestCase):
         mock_input = MagicMock(return_value=auth_token)
 
         with patch('builtins.print', mock_print), \
-                patch('builtins.input', mock_input):
+                patch('builtins.input', mock_input), \
+                patch('sys.stdin.isatty', lambda: True):
             self.assertEqual(auth_token, license_auth.prompt_for_auth_token())
 
         mock_input.assert_called_once_with(license_auth.AUTH_TOKEN_PROMPT)
 
+    def test_no_tty_dont_prompt_for_auth_token(self):
+        auth_token = 'test auth token'
+
+        mock_print = MagicMock()
+        mock_input = MagicMock(return_value=auth_token)
+
+        with patch('builtins.print', mock_print), \
+                patch('builtins.input', mock_input), \
+                patch('sys.stdin.isatty', lambda: False):
+            self.assertEqual(auth_token, license_auth.prompt_for_auth_token())
+
+        mock_input.assert_called_once_with()
+
 
 class TestRemoveCachedAuthToken(TestCase):
     def test_cached_token_exists(self):
Repository: typesafehub/conductr-cli

Issue:
bndl endpoint should default to --path-beg

Comments:

Patch:
diff --git a/conductr_cli/endpoint.py b/conductr_cli/endpoint.py
index b8048f5..4cf8d4c 100644
--- a/conductr_cli/endpoint.py
+++ b/conductr_cli/endpoint.py
@@ -112,7 +112,7 @@ class HttpRequest:
 
     def hocon(self):
         request_tree = ConfigTree()
-        request_tree.put(self.match if self.match else 'path', self.value)
+        request_tree.put(self.match if self.match else 'path-beg', self.value)
         if self.method:
             request_tree.put('method', self.method)
         if self.rewrite:


Test patch:
diff --git a/conductr_cli/test/test_bndl_utils.py b/conductr_cli/test/test_bndl_utils.py
index 70ab43c..72c200b 100644
--- a/conductr_cli/test/test_bndl_utils.py
+++ b/conductr_cli/test/test_bndl_utils.py
@@ -434,7 +434,7 @@ class TestBndlUtils(CliTestCase):
                |      http {
                |        requests = [
                |          {
-               |            path = "/"
+               |            path-beg = "/"
                |          }
                |        ]
                |      }