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

verify-alpha-spec does not work on pre-commit.ci #58

Open
bdice opened this issue Dec 8, 2024 · 0 comments
Open

verify-alpha-spec does not work on pre-commit.ci #58

bdice opened this issue Dec 8, 2024 · 0 comments

Comments

@bdice
Copy link
Contributor

bdice commented Dec 8, 2024

The verify-alpha-spec hook appears to be failing when used with pre-commit.ci. It requires downloading a file from GitHub, which may be against security policy for pre-commit.ci or something like that. Here is the full error log:

verify-alpha-spec........................................................Failed
- hook id: verify-alpha-spec
- exit code: 1

Traceback (most recent call last):
  File "/usr/lib/python3.12/urllib/request.py", line 1344, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.12/http/client.py", line 1336, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.12/http/client.py", line 1382, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.12/http/client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.12/http/client.py", line 1091, in _send_output
    self.send(msg)
  File "/usr/lib/python3.12/http/client.py", line 1035, in send
    self.connect()
  File "/usr/lib/python3.12/http/client.py", line 1470, in connect
    super().connect()
  File "/usr/lib/python3.12/http/client.py", line 1001, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/socket.py", line 841, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/socket.py", line 976, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/bin/verify-alpha-spec", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_pre_commit_hooks/alpha_spec.py", line 316, in main
    with m.execute() as ctx:
         ^^^^^^^^^^^
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_pre_commit_hooks/lint.py", line 276, in __exit__
    check(linter, self.args)
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_pre_commit_hooks/alpha_spec.py", line 296, in check_alpha_spec
    check_root(linter, args, loader.document_anchors[0], set(), root)
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_pre_commit_hooks/alpha_spec.py", line 260, in check_root
    check_dependencies(linter, args, anchors, used_anchors, root_value)
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_pre_commit_hooks/alpha_spec.py", line 241, in check_dependencies
    check_common(
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_pre_commit_hooks/alpha_spec.py", line 183, in check_common
    check_packages(
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_pre_commit_hooks/alpha_spec.py", line 165, in check_packages
    check_package_spec(linter, args, anchors, used_anchors, package_spec)
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_pre_commit_hooks/alpha_spec.py", line 119, in check_package_spec
    in get_rapids_version(args).prerelease_packages
       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_pre_commit_hooks/alpha_spec.py", line 48, in get_rapids_version
    md = all_metadata()
         ^^^^^^^^^^^^^^
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_pre_commit_hooks/alpha_spec.py", line 40, in all_metadata
    return fetch_latest()
           ^^^^^^^^^^^^^^
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_metadata/remote.py", line 33, in fetch_latest
    return _fetch_from_url(_GITHUB_METADATA_URL)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/Snh3JbNeSBuwwobXK8YN9w/py_env-python3/lib/python3.12/site-packages/rapids_metadata/remote.py", line 28, in _fetch_from_url
    with urllib.request.urlopen(url) as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 215, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 515, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 532, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 1392, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/urllib/request.py", line 1347, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>

Example run: https://results.pre-commit.ci/run/github/160453496/1733415061.N-S7Hv6PT7CcB8uDhTexlA

Discovered while working on rapidsai/rmm#1746. For now, skipping verify-alpha-spec in pre-commit.ci is sufficient. We will need to continue using self-hosted runners for style checks anyway, due to limitations like those described here: rapidsai/build-planning#124 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant