-
Notifications
You must be signed in to change notification settings - Fork 0
Document MUSIC_DIR and refactor storage initialization #40
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
base: dev
Are you sure you want to change the base?
Conversation
… end-to-end tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the application's initialization flow by moving storage and router setup from the init() function to main(), improving testability and control over initialization order. The changes introduce explicit helper functions for storage initialization and router creation, and update documentation to clarify how tests can run without AWS credentials.
Key changes:
- Storage and router initialization moved from
init()tomain()for better test control - New
initStorage()andnewRouter()helper functions to separate concerns TestMainadded to provide explicit test setup, replacing implicitinit()behavior
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| main.go | Refactored initialization logic, moving storage and router setup from init() to main(), added initStorage() and newRouter() helper functions, improved S3 initialization logging |
| main_test.go | Added TestMain for explicit test setup, included comment about removed test function |
| README.md | Documented that tests run without AWS credentials using MUSIC_DIR, explained S3 integration testing option |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
… SAM template - Created index.html for the main structure of the music player interface. - Added static/style.css for styling the player, including responsive design and modern UI elements. - Implemented AWS SAM template (template.yaml) for deploying the MusicFunction with necessary configurations.
Enhance documentation for MUSIC_DIR in the README and refactor storage initialization logic to simplify the process. Introduce new helper functions for storage validation and ensure tests can run without AWS credentials by relying on environment variables. Remove unnecessary complexity and improve logging for S3 initialization.