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

Add static typing #3315

Merged
merged 5 commits into from
Apr 5, 2023
Merged

Add static typing #3315

merged 5 commits into from
Apr 5, 2023

Conversation

SchoolGuy
Copy link
Member

Linked Items

Fixes #3314

Description

Introduce strict mypy checking.

Behaviour changes

Old: None

New: None

Category

This is related to a:

  • Bugfix
  • Feature
  • Packaging
  • Docs
  • Code Quality
  • Refactoring
  • Miscellaneous

Tests

  • Unit-Tests were created
  • System-Tests were created
  • Code is already covered by Unit-Tests
  • Code is already covered by System-Tests
  • No tests required

@SchoolGuy SchoolGuy added this to the v3.4.0 milestone Jan 7, 2023
@github-actions github-actions bot added API CI CI/CD related labels Jan 7, 2023
@SchoolGuy SchoolGuy force-pushed the feature/add-typing branch 8 times, most recently from 8870597 to 7f0f799 Compare January 12, 2023 13:15
@SchoolGuy SchoolGuy changed the title Add static typing with strict mypy Add static typing with a linter Jan 12, 2023
@SchoolGuy SchoolGuy force-pushed the feature/add-typing branch 3 times, most recently from 4daff8d to dc50fdc Compare January 17, 2023 20:55
@github-actions github-actions bot added the tests label Jan 17, 2023
@SchoolGuy
Copy link
Member Author

This took a lot of ignores but the PR is getting in a good shape. The tests need to be fixed obviously but other than that there should be not many changes required to make the CI.

@SchoolGuy SchoolGuy force-pushed the feature/add-typing branch 2 times, most recently from df1687f to 826a09e Compare January 31, 2023 09:02
@codecov
Copy link

codecov bot commented Jan 31, 2023

Codecov Report

Patch coverage: 65.07% and project coverage change: +64.64 🎉

Comparison is base (5c76a58) 0.19% compared to head (53e26a3) 64.83%.

❗ Current head 53e26a3 differs from pull request most recent head 7d3d48f. Consider uploading reports for the commit 7d3d48f to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##            main    #3315       +/-   ##
==========================================
+ Coverage   0.19%   64.83%   +64.64%     
==========================================
  Files         93      113       +20     
  Lines      12983    15788     +2805     
==========================================
+ Hits          25    10236    +10211     
+ Misses     12958     5552     -7406     
Impacted Files Coverage Δ
cobbler/api.py 70.06% <ø> (+70.06%) ⬆️
cobbler/cobblerd.py 0.00% <0.00%> (ø)
cobbler/items/image.py 88.54% <ø> (+88.54%) ⬆️
cobbler/items/item.py 86.33% <ø> (+86.33%) ⬆️
cobbler/items/menu.py 81.42% <ø> (ø)
cobbler/items/mgmtclass.py 89.39% <ø> (+89.39%) ⬆️
cobbler/items/package.py 91.89% <ø> (+91.89%) ⬆️
cobbler/items/profile.py 94.61% <ø> (+94.61%) ⬆️
cobbler/items/repo.py 85.00% <ø> (+85.00%) ⬆️
cobbler/items/resource.py 91.42% <ø> (ø)
... and 103 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@SchoolGuy SchoolGuy marked this pull request as ready for review January 31, 2023 09:12
@SchoolGuy SchoolGuy requested a review from a team January 31, 2023 09:13
@SchoolGuy SchoolGuy mentioned this pull request Jan 31, 2023
12 tasks
@SchoolGuy SchoolGuy force-pushed the feature/add-typing branch 7 times, most recently from 53e26a3 to ae9df2d Compare February 7, 2023 19:47
@SchoolGuy SchoolGuy marked this pull request as draft March 4, 2023 21:27
@SchoolGuy
Copy link
Member Author

This PR needs to be rebased as soon as #3363 is merged. The PR is a split-out from the previously mentioned PR.

@SchoolGuy
Copy link
Member Author

Rebase is in progress. However, it appears there are some errors that are in need of fixing.

@codacy-production
Copy link

codacy-production bot commented Mar 18, 2023

Coverage summary from Codacy

Merging #3315 (c2ebdef) into main (ad95448) - See PR on Codacy

Coverage variation Diff coverage
-0.68% 68.44%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (ad95448) 13886 9316 67.09%
Head commit (c2ebdef) 14394 (+508) 9559 (+243) 66.41% (-0.68%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3315) 2582 1767 68.44%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@SchoolGuy SchoolGuy force-pushed the feature/add-typing branch 2 times, most recently from 74724f1 to c629feb Compare March 24, 2023 15:37
@SchoolGuy
Copy link
Member Author

Rebase after isort PR merge.

@SchoolGuy SchoolGuy force-pushed the feature/add-typing branch 4 times, most recently from 4534ce6 to 0dab048 Compare March 28, 2023 09:42
@SchoolGuy SchoolGuy marked this pull request as ready for review March 28, 2023 09:43
@SchoolGuy
Copy link
Member Author

All linters are happy. The type system in Cobbler is far from being perfect because I require a lot of ignores (too many IMHO) to make them happy but as a first version this should do. We can improve this later on if needed.

@SchoolGuy SchoolGuy force-pushed the feature/add-typing branch 3 times, most recently from eb6a4f3 to c2ebdef Compare March 28, 2023 13:30
@SchoolGuy
Copy link
Member Author

LDAP tests are sadly failing. This is happening already for quite a while so I will ignore it for this PR.

SchoolGuy and others added 5 commits April 5, 2023 20:51
Due to numerous offenses in the type logic found it the last commits that went
undetected (even by myself), this the strict pyright checks will be enabled on
GitHub.
This is done to ensure consistent linting in all environments.
@SchoolGuy
Copy link
Member Author

Reviewing this doesn't make much sense. We can fixup the bugs later on.

@SchoolGuy SchoolGuy changed the title Add static typing with a linter Add static typing Apr 5, 2023
@SchoolGuy SchoolGuy merged commit fdf13fc into main Apr 5, 2023
@SchoolGuy SchoolGuy deleted the feature/add-typing branch April 5, 2023 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API CI CI/CD related tests
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add static typing to Cobbler
2 participants