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

Check actual event type and not PmType #344

Merged
merged 3 commits into from
Aug 8, 2024
Merged

Conversation

stveit
Copy link
Contributor

@stveit stveit commented Aug 7, 2024

Scope and purpose

Fixes a bug where it compares the type of event to a planned maintenance type, which makes no sense. Instead it should check if the event is an instance of the correct event subclass.

This bug luckily did not actually have any impact on the behaviour, since it checks if event.type equals "portstate", which effectively does the same as checking isinstance(event, PortstateEvent), which is why this was not picked up by any tests

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to Zino can be found in the
README.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with black, ruff and isort, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done

@stveit stveit added the bug Something isn't working label Aug 7, 2024
@stveit stveit self-assigned this Aug 7, 2024
Copy link

github-actions bot commented Aug 7, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 1 0 0.56s
✅ PYTHON isort 1 0 0.22s
✅ PYTHON ruff 1 0 0.01s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Copy link

github-actions bot commented Aug 7, 2024

Test results

    3 files      3 suites   1m 18s ⏱️
  547 tests   547 ✅ 0 💤 0 ❌
1 617 runs  1 615 ✅ 2 💤 0 ❌

Results for commit 8e22f76.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.20%. Comparing base (a9a85fb) to head (8e22f76).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #344   +/-   ##
=======================================
  Coverage   98.20%   98.20%           
=======================================
  Files          64       64           
  Lines        7926     7926           
=======================================
  Hits         7783     7783           
  Misses        143      143           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Co-authored-by: Johanna England <[email protected]>
Copy link

sonarqubecloud bot commented Aug 8, 2024

@stveit stveit merged commit 70b1a57 into master Aug 8, 2024
11 checks passed
@johannaengland johannaengland deleted the fix-checking-type-of-event branch August 8, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants