openSUSE / openSUSE-release-tools

Tools to aid in staging and release work for openSUSE/SUSE
GNU General Public License v2.0
59 stars 92 forks source link

Type hints & misc smaller fixes #2976

Closed dcermak closed 1 year ago

Vogtinator commented 1 year ago

IMO it's a bit weird to convert only one of the namedtuples

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 96.96% and project coverage change: +0.14 :tada:

Comparison is base (d0aaa85) 28.22% compared to head (3b26e32) 28.36%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2976 +/- ## ========================================== + Coverage 28.22% 28.36% +0.14% ========================================== Files 85 85 Lines 14634 14664 +30 ========================================== + Hits 4131 4160 +29 - Misses 10503 10504 +1 ``` | [Impacted Files](https://app.codecov.io/gh/openSUSE/openSUSE-release-tools/pull/2976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openSUSE) | Coverage Δ | | |---|---|---| | [ReviewBot.py](https://app.codecov.io/gh/openSUSE/openSUSE-release-tools/pull/2976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openSUSE#diff-UmV2aWV3Qm90LnB5) | `64.51% <94.44%> (+0.54%)` | :arrow_up: | | [osclib/comments.py](https://app.codecov.io/gh/openSUSE/openSUSE-release-tools/pull/2976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openSUSE#diff-b3NjbGliL2NvbW1lbnRzLnB5) | `95.77% <95.45%> (-0.38%)` | :arrow_down: | | [check\_source.py](https://app.codecov.io/gh/openSUSE/openSUSE-release-tools/pull/2976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openSUSE#diff-Y2hlY2tfc291cmNlLnB5) | `71.21% <100.00%> (+0.05%)` | :arrow_up: | | [origin-manager.py](https://app.codecov.io/gh/openSUSE/openSUSE-release-tools/pull/2976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openSUSE#diff-b3JpZ2luLW1hbmFnZXIucHk=) | `86.62% <100.00%> (+0.08%)` | :arrow_up: | | [osclib/conf.py](https://app.codecov.io/gh/openSUSE/openSUSE-release-tools/pull/2976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openSUSE#diff-b3NjbGliL2NvbmYucHk=) | `96.92% <100.00%> (+0.04%)` | :arrow_up: | | [osclib/core.py](https://app.codecov.io/gh/openSUSE/openSUSE-release-tools/pull/2976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openSUSE#diff-b3NjbGliL2NvcmUucHk=) | `59.53% <100.00%> (ø)` | | | [osclib/origin.py](https://app.codecov.io/gh/openSUSE/openSUSE-release-tools/pull/2976?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openSUSE#diff-b3NjbGliL29yaWdpbi5weQ==) | `74.09% <100.00%> (+0.21%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

dcermak commented 1 year ago

IMO it's a bit weird to convert only one of the namedtuples

That's the one I cared about :shrug:

Vogtinator commented 1 year ago
./osclib/origin.py:4:1: F401 'typing.Generator' imported but unused
./osclib/origin.py:4:1: F401 'typing.Tuple' imported but unused
dcermak commented 1 year ago

Fabian Vogt @.***> writes:

@Vogtinator commented on this pull request.

     """Convert an XML element comment into a dictionary.

:param comment_element: XML element that store a comment. :returns: A Python dictionary object. """

  • comment = {
  • when_str = comment_element.get('when')

In that case I recommend to remove the handling for None again. If the value is somehow missing it should fail fast and not at some point later when there's an unexpected missing timestamp somewhere...

Done.

dirkmueller commented 1 year ago

@dcermak rebase please

dcermak commented 1 year ago

Done

fcrozat commented 1 year ago

as mentioned on slack, it broke check_tags_in_requests.py:

script-executor] Script written into '/go/pipelines/Run.Changelog.Checker/5497b97e-9b94-4d20-ad65-d1aaee788380.sh'.
check_tags_in_requests.py: option --review-mode: invalid choice: 'accept-onpass' (choose from <ReviewChoices.NORMAL: 'normal'>, <ReviewChoices.NO: 'no'>, <ReviewChoices.ACCEPT: 'accept'>, <ReviewChoices.ACCEPT_ONPASS: 'accept-onpass'>, <ReviewChoices.FALLBACK_ONFAIL: 'fallback-onfail'>, <ReviewChoices.FALLBACK_ALWAYS: 'fallback-always'>)
Try 'check_tags_in_requests.py help' for info.
[script-executor] Script completed with exit code: 1.
DimStar77 commented 1 year ago

For reference: this no longer works with osc 0.182.1 from Leap

dcermak commented 1 year ago

For reference: this no longer works with osc 0.182.1 from Leap

also with https://github.com/openSUSE/openSUSE-release-tools/pull/2990?

DimStar77 commented 1 year ago

For reference: this no longer works with osc 0.182.1 from Leap

also with #2990?

Tested with today's HEAD aka 82c067dc2c5e8ccdf473d82d687bdfff09f8be3e

DimStar77 commented 1 year ago
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/osc/commandline.py", line 9583, in _load_plugins
    mod = imp.load_source(modname, os.path.join(plugin_dir, extfile))
  File "/usr/lib64/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/dimstar/.osc-plugins/osc-staging.py", line 17, in <module>
    from osclib.accept_command import AcceptCommand
  File "/home/dimstar/.osc-plugins/osclib/accept_command.py", line 11, in <module>
    from osclib.core import attribute_value_save, attribute_value_load
  File "/home/dimstar/.osc-plugins/osclib/core.py", line 20, in <module>
    from osc.connection import http_DELETE
ModuleNotFoundError: No module named 'osc.connection'

/home/dimstar/.osc-plugins/osc-staging.py: No module named 'osc.connection'