Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

feat: improved the dynamic MIB loading #41

Merged
merged 25 commits into from
Jul 21, 2021
Merged

Conversation

lingy1028
Copy link
Contributor

No description provided.

lstoppa and others added 9 commits July 16, 2021 09:34
- I have just rewritten a very-basic lookup that works. I don't fully understand
  the mongodb-related part, but at least this should give us a basic point where
  we can start from.
- Fixed one MIB file name in unit-test
- Fixed one MIB file name in unit-test (and removed useless lookups)
- Fixed the find_mib_file method to add a feature that searching the MIBs using the OID without index
- changed to find/load all mapping MIBs instead of find/load one.

- changed unit-test to test HOST-RESOURCES-MIB instead of NETSERVER-MIB.

- Note/Finding: After loading all the mapping MIBs, only the last loaded MIB is used to do the translation.
- fixed to lazy load extra MIBs only when the exception is a non-OBJECT-TYPE exception
@codecov-commenter
Copy link

codecov-commenter commented Jul 20, 2021

Codecov Report

Merging #41 (86f01db) into develop (32b315f) will increase coverage by 1.28%.
The diff coverage is 94.73%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #41      +/-   ##
===========================================
+ Coverage    97.04%   98.33%   +1.28%     
===========================================
  Files           27       32       +5     
  Lines         5081     6731    +1650     
===========================================
+ Hits          4931     6619    +1688     
+ Misses         150      112      -38     
Impacted Files Coverage Δ
...unk_connect_for_snmp_mib_server/snmp_mib_server.py 44.11% <50.00%> (+44.11%) ⬆️
splunk_connect_for_snmp_mib_server/translator.py 83.58% <96.77%> (+3.48%) ⬆️
splunk_connect_for_snmp_mib_server/mongo.py 82.22% <100.00%> (+16.36%) ⬆️
tests/test_translator.py 91.83% <100.00%> (+0.17%) ⬆️
mibs/pysnmp/UCD-SNMP-MIB.py 100.00% <0.00%> (ø)
mibs/pysnmp/NETSERVER-MIB.py 100.00% <0.00%> (ø)
mibs/pysnmp/HOST-RESOURCES-V2-MIB.py 100.00% <0.00%> (ø)
mibs/pysnmp/HCNUM-TC.py 100.00% <0.00%> (ø)
mibs/pysnmp/HOST-RESOURCES-MIB.py 100.00% <0.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32b315f...86f01db. Read the comment docs.

lingy1028 and others added 11 commits July 20, 2021 15:17
- I have just rewritten a very-basic lookup that works. I don't fully understand
  the mongodb-related part, but at least this should give us a basic point where
  we can start from.
- Fixed one MIB file name in unit-test
- Fixed one MIB file name in unit-test (and removed useless lookups)
- Fixed the find_mib_file method to add a feature that searching the MIBs using the OID without index
- changed to find/load all mapping MIBs instead of find/load one.

- changed unit-test to test HOST-RESOURCES-MIB instead of NETSERVER-MIB.

- Note/Finding: After loading all the mapping MIBs, only the last loaded MIB is used to do the translation.
- fixed to lazy load extra MIBs only when the exception is a non-OBJECT-TYPE exception
…t-for-snmp-mib-server into feature/fix-semgrep
@github-actions
Copy link
Contributor

github-actions bot commented Jul 20, 2021

CLA Assistant Lite bot: All contributors have NOT signed the COC Document


I have read the Code of Conduct and I hereby accept the Terms


1 out of 2 committers have signed the CLA.
@lingy1028
@lstoppa
You can retrigger this bot by commenting recheck in this Pull Request

@lingy1028
Copy link
Contributor Author

I have read the Code of Conduct and I hereby accept the Terms

@github-actions
Copy link
Contributor

github-actions bot commented Jul 21, 2021

Expected release notes (by @lingy1028)

fixes:
added types-PyYAML (86f01db)
dummy commit to resolve lint issue by running suggested pip command - python3 -m pip install types-PyYAML (e0a7249)
reformatted to pass the lint checks (7e16d0a)
removed the failed CI step: Upload result to GitHub Code Scanning (bd58ff3)
partial fix for dynamic MIB loading (f6cad57)
partial fix for dynamic MIB loading (e167cd7)
partial fix for dynamic MIB loading (c3380d6)
removed unexpected argument for yaml.safe_load (7dfb5b5)
partial fix for dynamic MIB loading - Fixed one MIB file name in unit-test (and removed useless lookups) (50b19ca)
partial fix for dynamic MIB loading - Fixed one MIB file name in unit-test (9d55d14)
partial fix for dynamic MIB loading - I have just rewritten a very-basic lookup that works. I don't fully understand the mongodb-related part, but at least this should give us a basic point where we can start from. (b42ee99)
added unit-test for HOST-RESOURCES-MIB (d6a29b9)
(semgrep) use yaml::safe_load instead of yaml::load (cf9123c)
fixed the cla-assistant version (bed65bf)
partial fix for dynamic MIB loading (3d6e791)
partial fix for dynamic MIB loading (d17cfc5)
partial fix for dynamic MIB loading (0c995c4)
removed unexpected argument for yaml.safe_load (fedde57)
partial fix for dynamic MIB loading - Fixed one MIB file name in unit-test (and removed useless lookups) (19f829d)
partial fix for dynamic MIB loading - Fixed one MIB file name in unit-test (13177d4)
partial fix for dynamic MIB loading - I have just rewritten a very-basic lookup that works. I don't fully understand the mongodb-related part, but at least this should give us a basic point where we can start from. (d057539)
added unit-test for HOST-RESOURCES-MIB (a13e76e)
(semgrep) use yaml::safe_load instead of yaml::load (71b32b4)
update python version quotes (d0c8cd4)
update NOTICE (aa41392)
correct image path (975c556)

others (will not be included in Semantic-Release notes):
refactor to remove the duplicate code (8dab52a)
32b315f Feature/addon 39052 (#40)
update copyright header (304d196)
move to actions (#33) (03afb42)

  • I hereby acknowledge these release notes are 🥙 AWESOME 🥙

Copy link
Contributor

@lstoppa lstoppa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Al looks good. I have run on my local environments those tests and all is green. Please merge.

@lstoppa
Copy link
Contributor

lstoppa commented Jul 21, 2021

I have read the Code of Conduct and I hereby accept the Terms

@lstoppa lstoppa merged commit 9114730 into develop Jul 21, 2021
@lstoppa lstoppa deleted the feature/fix-semgrep branch July 21, 2021 07:30
@github-actions github-actions bot locked and limited conversation to collaborators Jul 21, 2021
@weliasz
Copy link
Contributor

weliasz commented Sep 1, 2021

🎉 This PR is included in version 1.8.0-develop.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants