Skip to content

feat: Add endpoint for serial logs#5627

Merged
steverydz merged 1 commit intomainfrom
WD-35107-add-endpoint-for-serial-logs
Mar 24, 2026
Merged

feat: Add endpoint for serial logs#5627
steverydz merged 1 commit intomainfrom
WD-35107-add-endpoint-for-serial-logs

Conversation

@steverydz
Copy link
Copy Markdown
Contributor

@steverydz steverydz commented Mar 23, 2026

Done

Adds an endpoint to get the serial log for a model

How to QA

Testing

  • This PR has tests
  • No testing required (explain why):

Security

  • Security considerations for review (list them):
    • Examples:
    • Access control: users can only access their own data
    • Input: user input is validated and sanitised
    • Sensitive data: secret or private data is not exposed in any way
    • ...
  • This PR has no security considerations (explain why): Read only endpoint

Issue / Card

Fixes https://warthogs.atlassian.net/browse/WD-35107

Screenshots

n/a

UX Approval

  • This PR does not require UX approval
  • This PR does require UX approval (add context):

Copilot AI review requested due to automatic review settings March 23, 2026 16:07
@webteam-app
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Flask API endpoint in the model service to fetch serial logs for a given store model, backed by the canonicalwebteam.store-api publisher gateway, with accompanying endpoint tests and a dependency bump to a newer store-api version.

Changes:

  • Add GET /api/store/<store_id>/models/<model_name>/serial-log endpoint that returns items from get_store_model_serial_log.
  • Add unittest coverage for success/empty/error scenarios for the new endpoint.
  • Bump canonicalwebteam.store-api dependency from 7.3.10 to 7.4.10.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
webapp/endpoints/models.py Adds the new serial-log route and error handling logic.
tests/endpoints/tests_models.py Adds tests for the new endpoint behavior.
requirements.txt Updates store-api dependency version to support the new gateway method.

Comment thread webapp/endpoints/models.py
Comment thread webapp/endpoints/models.py
@steverydz steverydz force-pushed the WD-35107-add-endpoint-for-serial-logs branch from 8b28457 to 95dcaef Compare March 23, 2026 16:17
res["success"] = True
response = make_response(res, 200)
except StoreApiResponseErrorList as error_list:
error_messages = [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nitpick: I wonder if this logic would be useful for other endpoints as well. It would be nice if we can create a function. but not a blocker.

@ilayda-cp
Copy link
Copy Markdown
Contributor

Im getting {"message":"Missing required permission: read-serial-log","success":false} for "https://snapcraft-io-5627.demos.haus/api/store/ahnuP3quahti9vis8aiw/models/test-superalpaca-00/serial-log" I guess i dont have permission

@steverydz steverydz merged commit 4b690c0 into main Mar 24, 2026
14 checks passed
@steverydz steverydz deleted the WD-35107-add-endpoint-for-serial-logs branch March 24, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants