nebius/SWE-bench-extra huggingface dataset:
Repository: castle/castle-python

Issue:
change timeout configuration from seconds to miliseconds

Comments:

Patch:
diff --git a/HISTORY.md b/HISTORY.md
index c705403..e66e5a4 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -1,3 +1,8 @@
+## master
+
+### Breaking Changes:
+- switched configuration request_timeout from seconds to milliseconds
+
 ## 2.0.0 (2018-02-09)
 
 ### Features:
diff --git a/README.rst b/README.rst
index 5fc110f..1436405 100644
--- a/README.rst
+++ b/README.rst
@@ -29,8 +29,8 @@ import and configure the library with your Castle API secret.
     # For authenticate method you can set failover strategies: allow(default), deny, challenge, throw
     configuration.failover_strategy = 'deny'
 
-    # Castle::RequestError is raised when timing out in seconds (default: 0.5 of the second)
-    configuration.request_timeout = 1
+    # Castle::RequestError is raised when timing out in milliseconds (default: 500 milliseconds)
+    configuration.request_timeout = 1000
 
     # Whitelisted and Blacklisted headers are case insensitive and allow to use _ and - as a separator, http prefixes are removed
     # Whitelisted headers
diff --git a/castle/configuration.py b/castle/configuration.py
index 1a9a6dc..c406191 100644
--- a/castle/configuration.py
+++ b/castle/configuration.py
@@ -19,7 +19,7 @@ WHITELISTED = [
 BLACKLISTED = ['HTTP_COOKIE']
 
 # 500 milliseconds
-REQUEST_TIMEOUT = 0.5
+REQUEST_TIMEOUT = 500
 FAILOVER_STRATEGIES = ['allow', 'deny', 'challenge', 'throw']
 
 
diff --git a/castle/request.py b/castle/request.py
index 7e38c79..230787c 100644
--- a/castle/request.py
+++ b/castle/request.py
@@ -13,7 +13,7 @@ class Request(object):
             method,
             self.build_url(path),
             auth=('', configuration.api_secret),
-            timeout=configuration.request_timeout,
+            timeout=configuration.request_timeout / 1000.0,
             headers=self.headers,
             verify=Request.verify(),
             data=None if params is None else json.dumps(params)


Test patch:
diff --git a/castle/test/configuration_test.py b/castle/test/configuration_test.py
index 67fd056..6c80f05 100644
--- a/castle/test/configuration_test.py
+++ b/castle/test/configuration_test.py
@@ -15,7 +15,7 @@ class ConfigurationTestCase(unittest.TestCase):
                          HeadersFormatter.call(v) for v in WHITELISTED])
         self.assertEqual(config.blacklisted, [
                          HeadersFormatter.call(v) for v in BLACKLISTED])
-        self.assertEqual(config.request_timeout, 0.5)
+        self.assertEqual(config.request_timeout, 500)
         self.assertEqual(config.failover_strategy, 'allow')
 
     def test_api_secret_setter(self):
@@ -70,8 +70,8 @@ class ConfigurationTestCase(unittest.TestCase):
 
     def test_request_timeout_setter(self):
         config = Configuration()
-        config.request_timeout = 5
-        self.assertEqual(config.request_timeout, 5.0)
+        config.request_timeout = 5000
+        self.assertEqual(config.request_timeout, 5000)
 
     def test_failover_strategy_setter_valid(self):
         config = Configuration()
Repository: cekit/cekit

Issue:
Try to detect certifi package installs and warn user if custom installation is found
The certifi library when installed locally provides a custom certificate store that can override the globally provided setting. We should try to find if certifi is installed and if yes, we should warn the user that certificate-related issues may appear.

We probably should do this only when `--redhat` switch is used.

Comments:

Patch:
diff --git a/cekit/tools.py b/cekit/tools.py
index a53b9ec..9aaba1e 100644
--- a/cekit/tools.py
+++ b/cekit/tools.py
@@ -352,6 +352,14 @@ class DependencyHandler(object):
         self._handle_dependencies(
             DependencyHandler.EXTERNAL_CORE_DEPENDENCIES)
 
+        try:
+            import certifi  # pylint: disable=unused-import
+            LOGGER.warning(("The certifi library (https://certifi.io/) was found, depending on the operating " +
+                            "system configuration this may result in certificate validation issues"))
+            LOGGER.warning("Certificate Authority (CA) bundle in use: '{}'".format(certifi.where()))
+        except ImportError:
+            pass
+
     def handle(self, o):
         """
         Handles dependencies from selected object. If the object has 'dependencies' method,


Test patch:
diff --git a/tests/test_unit_tools.py b/tests/test_unit_tools.py
index 9ac8561..fba8b71 100644
--- a/tests/test_unit_tools.py
+++ b/tests/test_unit_tools.py
@@ -1,6 +1,7 @@
 import logging
 import pytest
 import subprocess
+import sys
 import yaml
 
 from contextlib import contextmanager
@@ -550,3 +551,25 @@ def test_dependency_handler_check_for_executable_with_executable_fail_with_packa
 
         with pytest.raises(CekitError, match=r"^CEKit dependency: 'xyz' was not found, please provide the 'xyz-aaa' executable. To satisfy this requirement you can install the 'package-xyz' package.$"):
             handler._check_for_executable('xyz', 'xyz-aaa', 'package-xyz')
+
+
+def test_handle_core_dependencies_no_certifi(mocker, caplog):
+    sys.modules['certifi'] = None
+
+    with mocked_dependency_handler(mocker) as handler:
+        handler.handle_core_dependencies()
+
+    assert "The certifi library (https://certifi.io/) was found, depending on the operating system configuration this may result in certificate validation issues" not in caplog.text
+
+
+def test_handle_core_dependencies_with_certifi(mocker, caplog):
+    mock_certifi = mocker.Mock()
+    mock_certifi.where.return_value = 'a/path.pem'
+
+    sys.modules['certifi'] = mock_certifi
+
+    with mocked_dependency_handler(mocker) as handler:
+        handler.handle_core_dependencies()
+
+    assert "The certifi library (https://certifi.io/) was found, depending on the operating system configuration this may result in certificate validation issues" in caplog.text
+    assert "Certificate Authority (CA) bundle in use: 'a/path.pem'" in caplog.text