Skip to content

Releases: pyronear/pyro-api

v0.1.2: Stabilized API for production services

01 Jul 15:22
3bb7890
Compare
Choose a tag to compare

This patch release stabilizes the package environment & the tables for production.

Note: the backend mainly requires FastAPI 0.78.0, while the client only requires requests.

Highlights

⚙️ Package management

For development purposes, it is normal to have loose version specifiers. However for production, each version update needs to be inspected carefully. For this reason, we transitioned from loose requirements.txt version specifiers to Poetry (#198).

Poetry is a package management tool that will "lock" our dependencies to a fixed environment by resolving all parent packages. This produces a poetry.lock file that has fixed versions, which can be inspected by the Dependabot for security alerts.

🎨 Client documentation

For clarity, the previous documentation of the API client was changed from Read the Docs to Furo (#193).

image

This also comes with new features: dark mode, edit button, etc.

🎼 Code quality

Significant improvements to the codebase have been made in this release (#189, #193):

  • quality tools: added isort, mypy and black
  • test tools: switched from unittests to pytest
  • contribution tools: added Makefile
  • other: added header verification, and PR label verification

✨ New tables & routes

Routes

  • devices: get_my_device, update_device_hash (#151)
  • events: fetch_past_events (#116)
  • sites: create_noalert_site (#130)

Tables

  • alerts: added azimuth (#129)
  • devices: added angle_of_view (#134) software_hash (#137)
  • events: added is_acknowledged (#170)
  • groups: created (#137)
  • installation: added is_trustworth (#127)
  • sites: added "no_alert" as possible value of type (#130)
  • webhooks: created (#152)

Breaking changes

Deprecated routes

The following routes were deprecated:

  • alerts: update_alert, link_media (#208)
  • media: update_media (#208)

Table modifications

The following tables were modified:

  • alerts: removed type (#142), is_acknowledged (#170), made device_id & media_id mandatory and non-nullable (#208)
  • accesses: made group_id mandatory (#153)
  • devices: modified value range of yaw (#185)
  • installation: removed lat, lon, elevation, yaw, pitch (#143)

What's Changed

Breaking Changes 🛠

  • refactored: Removed alert type field by @frgfm in #142
  • refactor: Removed location fields from the installation table by @frgfm in #143
  • refactor: Make group_id mandatory by @florianriche in #153
  • refactor: Moved is_acknowledged from alert to event table by @frgfm in #170
  • refactor: Moved azimuth angle from (-180, +180) to (0, 360) by @frgfm in #185
  • feat: Added max request response size for fetch routes by @frgfm in #190
  • fix: Fixed route update mechanism by @frgfm in #208

New Features 🚀

  • chore: Updated license from GPLv3 to Apache 2.0 by @frgfm in #111
  • feat: Added route to fetch past fires by @frgfm in #116
  • feat: Added is_trustworthy boolean field to installation table by @frgfm in #127
  • feat: Added azimuth float field to alert table by @frgfm in #129
  • feat: Added no_alert type to Sites by @frgfm in #130
  • [Client][Site] add no alert site in client by @florianriche in #133
  • feat: Added angle_of_view to the device table by @frgfm in #134
  • Database migration with alembic by @jean-pasquier in #112
  • feat: add group object by @florianriche in #137
  • feat: Added event existence check upon alert creation by @frgfm in #149
  • feat: Added webhook system and alert notifications to third-parties by @frgfm in #152
  • feat: Added software_hash for device update check by @frgfm in #151
  • chore: Added a job to push docker to DockerHub by @frgfm in #155
  • feat: Added nginx configuration in docker orchestration by @frgfm in #174
  • Code of conduct by @fe51 in #188

Bug Fixes 🐛

Improvements

  • Crud refactoring & db transactions by @jean-pasquier in #90
  • docs: Added detailed examples in client documentation by @frgfm in #115
  • feat: Added admin scopes to alert routes by @frgfm in #122
  • feat: Added admin scopes to device routes by @frgfm in #121
  • feat: Added admin scopes to installation routes by @frgfm in #120
  • feat: Added proper scopes to media routes by @frgfm in #118
  • Add security admin scope requirement on accesses routes by @jean-pasquier in #104
  • Align devices update by @jean-pasquier in #113
  • test: Fixed unittests scoping issues by @frgfm in #138
  • refactor: Removed the "me" scope and replace it with "user" by @frgfm in #141
  • feat: Added group_id to access table by @frgfm in #144
  • feat: add missing link between site and group by @florianriche in #147
  • Add function to check for group by @florianriche in #148
  • Client: Add azimuth in alerts functions by @florianriche in #157
  • Refactor: Use SQLAlchemy models instead of Table Declaration by @florianriche in #156
  • Refactor: Use SQLAlchemy models instead of Table Declaration (after fix) by @florianriche in #162
  • chore: Reduced python version of the client to 3.6 by @florianriche in #163
  • [Groups] Add group logic to remaining routes by @florianriche in #167
  • feat: Added console log to notify that Sentry is enabled by @frgfm in #172
  • test: Extended client unittests by @frgfm in #175
  • fix: Fixed schemas typing by @frgfm in #178
  • feat: Added token refresh method to client by @frgfm in #180
  • feat: Specified HTTP status code and error messages by @frgfm in #182
  • refactor: Cleaned codebase and improve code quality by @frgfm in #189
  • ci: Optimized CI cache by @frgfm in #191
  • ci: Updated funding from OpenCollective to Github by @frgfm in #192
  • refactor: Cleaned docker orchestration and code style by @frgfm in #193
  • chore: Pinned versions using poetry by @frgfm in #198
  • ci: Removed version update for dependabot by @frgfm in #206
  • fix: Fixed media duplication by @frgfm in #207
  • docs: Fixes README badge and client documentation by @frgfm in #209

Full Changelog: v0.1.1...v0.1.2

End-to-end API & client support

23 Dec 23:09
0edaf2d
Compare
Choose a tag to compare

This release extends considerably the support of the API by the client, and introduces media upload and download efficiently from cloud storage.

Note: pyroapi 0.1.1 mainly requires fastapi, uvicorn and sqlalchemy, while the client only requires requests.

Highlights

Routers

Core API server implementation
New

  • Alerts: added alert acknowledgement route (#82)
  • Devices: added a route to register the user's own device (#80)

Improvements

  • Alerts: added media existence check (#77), and updated scopes (#99)
  • Events: updates scopes of existing routes (#59, #99)
  • Installations: changed method type of device listing route (#72), and updated scopes (#99)
  • Media: added proper exceptions when upload fails (#96), updated media naming (#98, #100), updated scopes (#99), added integrity check of content transfer (#102)
  • Sites: updated scopes of existing routes (#58), updated scopes (#99)

Fixes

  • Events: fixed scope checks in creation and update routes (#85)
  • Installations: fixed active devices listing route (#69, #81)
  • Devices: added access deletion (#76), checked login consistency with access table (#83)
  • Media: fixed upload route (#95)
  • Users: added access deletion (#76), checked login consistency with access table (#83)

Database

SQL server running to get persistence over API data
New

  • Added field for acknowledgement state of alerts (#82)

Improvements

  • Made access login unique (#76)

Tests

Unittests for the core API
New

  • Added end-to-end script CI job (#89)

Improvements

  • Added full postgre-SQL DB testing (#68, #70)

Services

Third-party services enabled in the API
New

  • Added Qarnot storage integration (#87)

Documentation

The documentation of the API server
Improvements

  • Added route summary and descriptions (#78)

Client

The python client package for easier usage of the API
New

  • Added integration of event creation, alert & media creation from device, media upload (#77), alert acknowledgement (#93)
  • Added unittests for client methods (#74)

Improvements

  • Added typing to all methods (#74)

Fixes

  • Fixed route mapping of devices (#86)

Others

  • Separated production and dev requirements (#73)
  • Added sentry integration (#71)
  • Added funding option

Alert management API & client

26 Nov 16:33
d0952ad
Compare
Choose a tag to compare

This first release introduces basic operations on the background database, as well as a python API client for easier usage.

Note: pyroclient 0.1.0 mainly requires fastapi, uvicorn and sqlalchemy, while the client only requires requests.

Highlights

Routers

Core API server implementation
New

Database

SQL server running to get persistence over API data
New

Tests

Unittests for the core API
New

Services

Third-party services enabled in the API
New

  • Added storage service connection (#20, #62)

Documentation

The documentation of the API server
New

Client

The python client package for easier usage of the API
New

  • Created a Python client for device interactions (#43), and web-platform interactions (#62)
  • Added sphinx-built documentation (#48)

Others

New

  • Added Docker build (#2, #7, #27)
  • Added automatic deployment on Heroku (#4)