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

fix: fetch only alerts for unacknowledged events #107

Merged
merged 5 commits into from
Jul 30, 2023
Merged

Conversation

blenzi
Copy link
Contributor

@blenzi blenzi commented Jul 29, 2023

Following pyronear/pyro-api#268, this PR fixes the retrieval of alerts by fetching the alerts associated with unacknowledged events. In addition:

  • increase the number of maximum events from 5 to 10
  • add call_api method and use to avoid code repetition
  • protection against undefined variables (raise ValueError)

Bruno Lenzi added 2 commits July 29, 2023 09:01
- add `call_api` method to _utils.py
- protection against undefined variables (raise ValueError)
MateoLostanlen
MateoLostanlen previously approved these changes Jul 30, 2023
Copy link
Member

@MateoLostanlen MateoLostanlen left a comment

Choose a reason for hiding this comment

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

Love this PR, thanks a lot @blenzi

Copy link
Collaborator

@Akilditu Akilditu left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the PR.

In addition to the comments, please bear in mind that the new get_alerts_for_event() should be in production before merging this.

app/utils/_utils.py Outdated Show resolved Hide resolved
app/main.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Akilditu Akilditu left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the changes.

Can you confirme then production API is up to date and then we merge.

@blenzi blenzi merged commit 8993fdb into main Jul 30, 2023
8 checks passed
@blenzi blenzi deleted the alerts-for-events branch July 30, 2023 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants