-
Notifications
You must be signed in to change notification settings - Fork 1
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
Filter incoming messages on product name #21
Conversation
…roduct name "afimg" Signed-off-by: Adam.Dybbroe <a000680@c21856.ad.smhi.se>
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #21 +/- ##
==========================================
- Coverage 82.73% 82.71% -0.03%
==========================================
Files 21 21
Lines 2554 2574 +20
Branches 386 389 +3
==========================================
+ Hits 2113 2129 +16
- Misses 410 414 +4
Partials 31 31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Adam.Dybbroe <a000680@c21856.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c21856.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
…b CI jobs Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
…ttroll for the CI tests to pass Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, otherwise looks good.
@@ -180,6 +181,9 @@ def run(self): | |||
elif msg.type not in ['file', 'collection', 'dataset']: | |||
LOG.debug("Message type not supported: %s", str(msg.type)) | |||
continue | |||
elif product_list and msg.data.get('product') not in product_list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if there is not product in the message? is None a possible value in the product_list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! As I have implemented it yes one needs to specify a list with at leas one product (name) in it. Before it was hardcoded to only consider one, and that should be named afimg
. At SMHI we now produce two kinds of GeoJSON output, one using the default WGS84 and one using SWEREF99, the later output file names we prepend with afimg_sweref99_
. We only want to notify users with the WGS84 output at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point! None
is theoretically a possible name for a product, and then if the message does not contain the product name any product would pass through and give rise to a notification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I have changed so no product name in the message will check for products named "unknown" against the configured product names. You think this is better and sufficient?
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
…"unknown" rather than None Signed-off-by: Adam.Dybbroe <a000680@c22526.ad.smhi.se>
Better now @mraspaud ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR is introducing a requirement on the product name in the incoming messages.
pytest
flake8