nav icon indicating copy to clipboard operation
nav copied to clipboard

Create event when new device is discovered

Open stveit opened this issue 2 years ago • 6 comments

Fixes #2391

Creates alerts when discovering new devices. The alert type depends on what type of device it is, e.g. chassis, module etc.

Also fixes a small bug in EventFactory.

stveit avatar May 16 '22 00:05 stveit

Codecov Report

Merging #2414 (a87d748) into master (fe217e2) will increase coverage by 0.01%. The diff coverage is 34.00%.

@@            Coverage Diff             @@
##           master    #2414      +/-   ##
==========================================
+ Coverage   53.31%   53.32%   +0.01%     
==========================================
  Files         554      554              
  Lines       40315    40363      +48     
==========================================
+ Hits        21494    21524      +30     
- Misses      18821    18839      +18     
Impacted Files Coverage Δ
python/nav/ipdevpoll/shadows/__init__.py 41.87% <29.03%> (-0.78%) :arrow_down:
python/nav/ipdevpoll/shadows/entity.py 27.48% <30.76%> (+0.27%) :arrow_up:
python/nav/models/manage.py 71.14% <66.66%> (-0.03%) :arrow_down:
python/nav/ipdevpoll/pool.py 89.92% <0.00%> (+5.03%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar May 16 '22 00:05 codecov[bot]

Test results

     12 files       12 suites   12m 46s :stopwatch: 3 111 tests 3 015 :heavy_check_mark:   96 :zzz: 0 :x: 8 808 runs  8 520 :heavy_check_mark: 288 :zzz: 0 :x:

Results for commit a87d7482.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 16 '22 00:05 github-actions[bot]

I'm inclined to say that this looks pretty good now, based on the code alone (some history cleanup/squashing is probably in order) ! :-)

I have not tested it in practice, though...

I'll do some testing and cleanups before i merge it

stveit avatar Jun 20 '22 11:06 stveit

I'm inclined to say that this looks pretty good now, based on the code alone (some history cleanup/squashing is probably in order) ! :-) I have not tested it in practice, though...

I'll do some testing and cleanups before i merge it

Please wait until I have made and merged the PR that will provide the functions get_extended_description and get_related_objects

johannaengland avatar Jun 20 '22 11:06 johannaengland

Please wait until I have made and merged the PR that will provide the functions get_extended_description and get_related_objects

Indeed, @stveit, I forgot that your alert templates need to include a more human-readable description of devices, instead of the current {{ device }}, which would only print a serial number.

lunkwill42 avatar Jun 20 '22 12:06 lunkwill42

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Aug 23 '22 17:08 sonarqubecloud[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Nov 24 '22 08:11 sonarqubecloud[bot]

Codecov complains a bit, but honestly not sure how to add tests to this, so ill put it back as ready 4 review

stveit avatar Jan 11 '23 21:01 stveit

Codecov complains a bit, but honestly not sure how to add tests to this, so ill put it back as ready 4 review

I think we need a testing workshop at some point, and after that, try to come up with some good ways of testing the untested parts of ipdevpoll.

lunkwill42 avatar Jan 20 '23 12:01 lunkwill42