thoth-station / common

A common library for the Thoth project
https://thoth-station.github.io/
GNU General Public License v3.0
4 stars 19 forks source link

Autoupdate pre-commit, update prow image tags #1250

Closed xtuchyna closed 2 years ago

xtuchyna commented 2 years ago

Related Issues and Dependencies

None

This introduces a breaking change

Description

SSIA

sesheta commented 2 years ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign sesheta after the PR has been reviewed. You can assign the PR to them by writing /assign @sesheta in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/thoth-station/common/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
xtuchyna commented 2 years ago

@harshad16 do we have some issue tracking the required autoupdate for pre-commit ? Also for prow image tags?

harshad16 commented 2 years ago

Do we have some issue tracking the required autoupdate for pre-commit ? Also for prow image tags?

Not that i know about, feel free to open one @xtuchyna cc: @codificat

sesheta commented 2 years ago

@xtuchyna: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
aicoe-ci/prow/pre-commit 08ae5e08100b0c7fe55bf6ffbafb2fccbaa98be0 link true /test pre-commit

Full PR test history. Your PR dashboard. Please help us and open an issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
codificat commented 2 years ago

I agree with @harshad16:

my suggestion for now. let's remove mypy out of pre-commit and can add it as a separate check like this https://github.com/thoth-station/messaging/blob/82588c945130172f0db76d81a55ea015dabea79e/.prow.yaml#L22 so our pr is not on hold just for mypy

currently this PR is failing pre-commit checks due to mypy:

mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

thoth/common/openshift.py:374:9: error: Returning Any from function declared to return "Optional[str]"  [no-any-return]
thoth/common/openshift.py:495:9: error: Returning Any from function declared to return "str"  [no-any-return]
thoth/common/workflows.py:22:1: error: Library stubs not installed for "yaml" (or incompatible with Python 3.8)  [import]
thoth/common/workflows.py:180:51: error: Argument 1 to "OpenShift" has incompatible type "**Mapping[str, str]"; expected "bool"  [arg-type]
thoth/common/workflows.py:180:51: error: Argument 1 to "OpenShift" has incompatible type "**Mapping[str, str]"; expected "Optional[Dict[str, str]]"  [arg-type]
thoth/common/logging.py:247: error: Unused "type: ignore" comment
thoth/common/logging.py:284:9: error: Incompatible types in assignment (expression has type "str", variable has type "Union[Logger, PlaceHolder]")  [assignment]
thoth/common/config/base.py:25:1: error: Library stubs not installed for "attr" (or incompatible with Python 3.8)  [import]
thoth/common/config/base.py:25:1: note: Hint: "python3 -m pip install types-attrs"
thoth/common/config/base.py:25:1: note: (or run "mypy --install-types" to install all missing stub packages)
thoth/common/config/base.py:25:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
thoth/common/config/base.py:53: error: Unused "type: ignore" comment
thoth/common/config/base.py:64:9: error: Returning Any from function declared to return "Dict[str, Union[str, int, None]]"  [no-any-return]
thoth/common/config/hardware_information.py:20:1: error: Library stubs not installed for "attr" (or incompatible with Python 3.8)  [import]
thoth/common/config/operating_system.py:20:1: error: Library stubs not installed for "attr" (or incompatible with Python 3.8)  [import]
thoth/common/config/runtime_environment.py:28:1: error: Library stubs not installed for "attr" (or incompatible with Python 3.8)  [import]
thoth/common/config/runtime_environment.py:29:1: error: Library stubs not installed for "yaml" (or incompatible with Python 3.8)  [import]
thoth/common/config/runtime_environment.py:29:1: note: Hint: "python3 -m pip install types-PyYAML"
thoth/common/config/runtime_environment.py:102: error: Unused "type: ignore" comment
thoth/common/config/runtime_environment.py:121: error: Unused "type: ignore" comment
thoth/common/config/runtime_environment.py:131:13: error: Returning Any from function declared to return "Dict[str, Any]"  [no-any-return]
Found 17 errors in 7 files (checked 13 source files)

Having mypy in a separate check would allow more control over this

harshad16 commented 2 years ago

Already merged following commit via https://github.com/thoth-station/common/pull/1253