pre-commit / pre-commit-hooks

Some out-of-the-box hooks for pre-commit
MIT License
5.3k stars 705 forks source link

YAML uncontrolled update in the dep chain causes error in CI #1101

Closed blaggacao closed 1 day ago

blaggacao commented 1 day ago

No pressure, this just happens sometimes (sic!) :smile:

There seems to be an uncontrolled update in the dependency chain causing an incompatibility:

I'm reporting this within roughly the 1 hour window of the offending change as determined by a prior, still successful, CI run.

check yaml...............................................................Failed
- hook id: check-yaml
- exit code: 1

Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repo51rnf047/py_env-python3.10/bin/check-yaml", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.cache/pre-commit/repo51rnf047/py_env-python3.10/lib/python3.10/site-packages/pre_commit_hooks/check_yaml.py", line 64, in main
    load_fn(f)
  File "/home/runner/.cache/pre-commit/repo51rnf047/py_env-python3.10/lib/python3.10/site-packages/ruamel/yaml/main.py", line 451, in load
    return constructor.get_single_data()
  File "/home/runner/.cache/pre-commit/repo51rnf047/py_env-python3.10/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 114, in get_single_data
    node = self.composer.get_single_node()
  File "_ruamel_yaml.pyx", line 701, in ruamel.yaml.clib._ruamel_yaml.CParser.get_single_node
  File "_ruamel_yaml.pyx", line 902, in ruamel.yaml.clib._ruamel_yaml.CParser._parse_next_event
  File "_ruamel_yaml.pyx", line 919, in ruamel.yaml.clib._ruamel_yaml.input_handler
TypeError: a string value is expected
Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repo51rnf047/py_env-python3.10/bin/check-yaml", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.cache/pre-commit/repo51rnf047/py_env-python3.10/lib/python3.10/site-packages/pre_commit_hooks/check_yaml.py", line 64, in main
    load_fn(f)
  File "/home/runner/.cache/pre-commit/repo51rnf047/py_env-python3.10/lib/python3.10/site-packages/ruamel/yaml/main.py", line 451, in load
    return constructor.get_single_data()
  File "/home/runner/.cache/pre-commit/repo51rnf047/py_env-python3.10/lib/python3.10/site-packages/ruamel/yaml/constructor.py", line 114, in get_single_data
    node = self.composer.get_single_node()
  File "_ruamel_yaml.pyx", line 701, in ruamel.yaml.clib._ruamel_yaml.CParser.get_single_node
  File "_ruamel_yaml.pyx", line 902, in ruamel.yaml.clib._ruamel_yaml.CParser._parse_next_event
  File "_ruamel_yaml.pyx", line 919, in ruamel.yaml.clib._ruamel_yaml.input_handler
TypeError: a string value is expected
PrivatePuffin commented 1 day ago

Can confirm.

We should also have things like this pinned, however: https://github.com/pre-commit/pre-commit-hooks/blob/51c43c4b295db1ec59a56abc6afd06aa5fc862e0/setup.cfg#L22

chintanms commented 1 day ago

It would help if pinning versions on underling libraries for hooks is exposed to end users.

Opened a placeholder issue on the underlying package repo: https://sourceforge.net/p/ruamel-yaml-clib/tickets/38/ I see a change made to the underling repo earlier today: https://github.com/ruamel/yaml.clib

PrivatePuffin commented 1 day ago

It would help if pinning versions on underling libraries for hooks is exposed to end users.

Opened a placeholder issue on the underlying package repo: https://sourceforge.net/p/ruamel-yaml-clib/tickets/38/ I see a change made to the underling repo earlier today: https://github.com/ruamel/yaml.clib

Thats also a fair point indeed.

PrivatePuffin commented 1 day ago

@AvdN Should be tagged as this is likely his code.

AvdN commented 1 day ago

I yanked the offending release, I need to do more testing on all versions and platforms.

asottile commented 1 day ago

libraries should not pin. you can always use additional_dependencies if you want to select a specific version