Skip to content

Complete backend onboarding challenge(Tony Zheng): command endpoints, models, and logging#74

Closed
tonyZh-7075 wants to merge 2 commits intoUWOrbital:mainfrom
tonyZh-7075:backend-onboarding
Closed

Complete backend onboarding challenge(Tony Zheng): command endpoints, models, and logging#74
tonyZh-7075 wants to merge 2 commits intoUWOrbital:mainfrom
tonyZh-7075:backend-onboarding

Conversation

@tonyZh-7075
Copy link

Purpose

Completed the required GS backend onboarding tasks

  • I have added my name to the onboarding title
  • I have added a screenshot of the logs printed by the logger middleware
  • I am interested to work on the frontend

New changes:

  • Implemented backend API endpoints for creating, retrieving, and deleting commands
  • Updated backend data models to properly store and return command information
  • Added a logger middleware that records incoming requests, response status codes, and the duration of each request.

Testing

  • Ran the backend server locally using uvicorn
  • Triggered API requests via /docs and /commands endpoints
  • Verified logger middleware output in the terminal (see screenshot i attached)
Screenshot 2026-01-27 at 5 14 34 PM

Copy link

@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.

Pls resolve the requests! :)

logger.error(f"Request failed: {request.method} {request.url} | Error: {e}")
raise

duration = (datetime.now() - start_time).total_seconds()

Choose a reason for hiding this comment

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

set to milliseconds instead of seconds for clarity

Copy link
Author

Choose a reason for hiding this comment

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

fixed!

# TODO: (Member) Implement this method

# valid if both are none
if self.params is None and self.format is None:

Choose a reason for hiding this comment

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

Note that None type is "falsy" in python, so None comparison is not necessary

Copy link
Author

@tonyZh-7075 tonyZh-7075 Jan 31, 2026

Choose a reason for hiding this comment

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

thanks for pointing this out. i've fixed it, thanks!

# TODO:(Member) Implement this endpoint


main_command = db.get(MainCommand, payload.command_type)

Choose a reason for hiding this comment

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

since you are creating a command, its unnecessary to check whether it exists.

Copy link
Author

Choose a reason for hiding this comment

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

fixed,

Copy link

@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.

LGTM!

@tonyZh-7075
Copy link
Author

All requested changes have been addressed. Marking this as ready for re-review — thanks!

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.

2 participants