Skip to content

Conversation

@Jiatao7
Copy link
Contributor

@Jiatao7 Jiatao7 commented Nov 26, 2025

Purpose

Closes #349.
Add GET endpoint for ARO requests.

New Changes

  • Add a GET endpoint to return ARO requests (parameters are count, offset, and filters)
  • Add test cases

Testing

Explain tests that you ran to verify code functionality.

  • I have unit-tested this PR. Otherwise, explain why it cannot be unit-tested.
  • I have tested this PR on a board if the code will run on a board (Only required for firmware developers).
  • I have tested this PR by running the ARO website (Only required if the code will impact the ARO website).
  • I have tested this PR by running the MCC website (Only required if the code will impact the MCC website).
  • I have included screenshots of the tests performed below.

Outstanding Changes

If there are non-critical changes (i.e. additional features) that can be made to this feature in the future, indicate them here.

@github-actions
Copy link

Pull reviewers stats

Stats of the last 120 days for UWOrbital:

User Total reviews Time to review Total comments
Adityya-K
🥇
59
▀▀▀▀▀
1d 14h 37m
187
▀▀▀▀
camspec
🥈
42
▀▀▀
2d 2h 29m
254
▀▀▀▀▀
kepler452b123
🥉
13
3d 15h 51m
31
proprogrammer504
7
7d 1h 31m
▀▀
28
sunray4
3
4d 21h 20m
19
Syzygicality
3
5d 1h 8m
1
c4bae
1
13d 1h 35m
▀▀▀
2

⚡️ Pull request stats

Copy link
Contributor

@Syzygicality Syzygicality left a comment

Choose a reason for hiding this comment

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

just some minor refactoring :)

:param filters: List of request statuses to filter by. If empty, no filtering is applied
:return: ARO requests matching the criteria
"""
with get_db_session() as session:
Copy link
Contributor

Choose a reason for hiding this comment

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

please use ARORequestWrapper found in wrappers.py to do database querying

"gs.backend.data.data_wrappers.mcc_wrappers.packet_telemetry_wrapper",
"gs.backend.data.data_wrappers.mcc_wrappers.packet_wrapper",
"gs.backend.data.data_wrappers.mcc_wrappers.telemetry_wrapper",
"gs.backend.api.v1.mcc.endpoints.aro_requests",
Copy link
Contributor

Choose a reason for hiding this comment

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

When refactoring to use the ARORequestWrapper, pls remove from this from conftest

@@ -0,0 +1,137 @@
from datetime import datetime
Copy link
Contributor

Choose a reason for hiding this comment

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

pls adjust if necessary to accommodate the refactoring

@Syzygicality
Copy link
Contributor

also pls resolve failing pytest check

from fastapi import APIRouter, Query

from gs.backend.api.v1.mcc.models.responses import ARORequestsResponse
from gs.backend.data.data_wrappers.aro_wrapper.aro_request_wrapper import get_all_requests
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the abstracted wrappers which eddie created



@aro_requests_router.get("/", response_model=ARORequestsResponse)
async def get_aro_requests(
Copy link
Contributor

Choose a reason for hiding this comment

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

You should also define a requests base model which you pass in like this. I believe that tells fastapi to look for an incoming json object with the params defined in the base model.
image
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am using query parameters to pass in the parameters currently. Does that work or should I switch to a request model?

:param filters: List of request statuses to filter by. If empty, no filtering is applied
:return: ARO requests matching the criteria
"""
requests = get_all_requests(count, offset, filters)
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure to refer to eddies wrappers!

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh also forgot to mention, but if functionality of eddies wrappers are incomplete, please fill in the functionality by defining a method for said wrapper like
image

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.

Create endpdoints for MCC ARO requests

3 participants