* Added initial scaffolding for weather support. * Code cleanup and refactor around SecurityManager accesses. * Added initial pass for an internal, unified weather data model. * Added display unit conversions and UI testing page for weather app. * Added template scaffolding and initial data model for weather. * Finished templates and test data scaffolding for weather views. * Added user setting for geo location (lat/long). * WIP for weather monitors and NWS API integration. * Beter factoring and parsing for NWS weather data source. * Added WMO units and unit test for it. WIP for NWS weather source. * Added unit tests for weather app (transient) models. * Added unit test for NWS weather source observation parsing. * Renamed a bunch of mixin file names for pluralization consistency. * Straggler (missed) mixin file name change from previous commit. * Added folding in of updated weath data into WeatherManager. * Fixed some bug around fetching NWS data for the first time. * Added WeatherStation to data model. WIP * Finished adding new WeatherStation to weather data model. * Added weather stations to UI. * Added fetching NWS forecast data (hourly and 12 hour). * Added three-valued parsing for NWS data: min, ave, max * Updated weather synthetic data for recent model tweaks. * Some variable/class renaming. Prep for forecast data model changes. * Added StatisticDataPoint for min/max/ave values. * Some minor refactoring to improve class naming and structures. * Saving WIP for weather data aggregation class and data structures. * Added improvement to dev docs. * From strudel...more weather work. * Removed redundant "elevation" model fields. * Completed initial weather integrations w/Claude Code. * Implement auto-discovery weather source configuration system * Fix weather module unit test failures and improve WMO units handling * Add git commit message guidelines to CLAUDE.md * Expand testing infrastructure documentation with comprehensive high-value testing patterns and system architecture insights * Fixed a few weather app bugs. * Weather data inspection script and weather app bug fixes. * More weather bug fixes and unit tests. * More testing and fixing of initial weather app. * Added sunrise-sunset.org integration. Fixed boolean config bug. * Fixed astronomical data integration. * Added future astronomical data frim sunrise-sunset.org API. * Added USNO API data for sun and moon. * Added weather alert data from NWS. Still need to map to Alarms. * Added mapping weather alerts to system Alarms. * Added tracking min/max daily temperatures. * Tweaks and refinements for weather alerts. * Last weather app tweaks before declaring first version done. * Moved console context processor to more logical location. * Fixed and updates some unit tests. * Coding style fixes for weather module. * Updated dev workflow doc. * Fixed a bunch of code formatting. * A few more code style fixes. * Added missing import.
4.7 KiB
Development Workflow
- See the Contributing Page for general information about contributing.
- See the Development Page for how to set up your development environment.
- See the Development Guidelines Page for the projects best practices for development.
Branching Strategy
- Main Branch (
master): Stable, production-ready code. Only updated by the project maintainers. - Development Branch (
staging): Active development happens here. Pull requests target this branch, with maintainers controlling merges. - Feature Branches: Contributors will fork the repo and branch off
stagingbranch for their work. Anyone can fork the repository, create a feature branch and submit PRs against thestagingbranch.
Making Changes - Overview
- Always work off the latest
stagingbranch to avoid merge conflicts. - Create an issue and a branch (issues highly encouraged for most PRs).
- Do your thing and add to and/or change the code: use clear commit messages.
- Create a PR: should be focused on a single feature or fix.
Ensure Your Code is in Sync
Switch to your local copy of staging branch:
git checkout staging
Fetch the latest changes from upstream:
git fetch upstream
Merge upstream changes into your fork's dev branch:
git merge upstream/staging
Push the updated dev branch to your fork:
git push origin staging
Ensure New Dependencies in Sync
You should also ensure you are in sync with with any packages or database schema changes before beginning work.
cd $PROJ_DIR
cd src
pip install -r hi/requirements/development.txt
./manage.py migrate
Create an Issue and Branch
All PRs are encouraged to be associated with an issue and the branch should use the issue number in its name. For minor fixes, or test-only changes, skipping an issue is OK, but anything more substantial should have an issue for discussions and reference.
Issues (and hence branches) come in a few flavors with associated conventions. In general, a branch will have both the issue number and a user-chosen, short mnemonic to be slightly more descriptive. Here are the conventions:
| Type | Issue? | Branch | Notes |
|---|---|---|---|
| feature | YES | feature/$(ISSUE_NUM}-${MNEMONIC} | New Development |
| bugfix | YES | bugfix/$(ISSUE_NUM}-${MNEMONIC} | Bug Fixes |
| docs | YES | docs/$(ISSUE_NUM}-${MNEMONIC} | Documentation |
| ops | YES | ops/$(ISSUE_NUM}-${MNEMONIC} | Non-app, deployment, etc. |
| tests | NO | tests/${MNEMONIC} | For test-only changes |
| refactor | YES | refactor/$(ISSUE_NUM}-${MNEMONIC} | Only if no new behaviors |
| tweak | NO | tweak/${MNEMONIC} | For small, obvious PRs |
If you are contributing something new, without an existing issue, please create an issue first using the appropriate template: feature, bugfix, etc.. It is generally always better to think about what you are about to do before doing it. Creating an issue is a forcing function for thinking through and communicating your plans.
Once your code is up-to-date, an issue number exists and a mnemonic chosen, you can create your local branch off the current staging branch:
git checkout -b feature/$(ISSUE_NUM}-${MNEMONIC} upstream/staging
Do Your Thing
- Make your changes to the code.
- Test your changes locally (and add unit tests).
- Stage changes:
git add . - Commit changes:
git commit -m "Add feature: [brief description]" - Push branch to your fork:
git push origin feature/$(ISSUE_NUM}-${MNEMONIC}
Submit a Pull Request (PR)
- Go to your fork on GitHub: https://github.com/${YOURUSERNAME}/home-information
- Click the "Compare & pull request" button that appears after your push.
- Ensure the base repository is set to
cassandra/home-information -> staging - Ensure the compare branch is set to:
${YOURUSERNAME}/home-information -> feature/${YOUR_FEATURE_NAME} - Fill out the PR template (describe what your change does).
- If applicable, add a line that says which ticket it closes. i.e., "Closes #39"
- Submit the PR and wait for review!
PR Reviews
During PR review, a decision will be made on whether to squash or rebase:
- Squash and Merge (default): For most PRs
- Rebase and Merge: for well-structured PRs that need commit history
Post-PR Cleanup
- After merging, you should consider deleting the branch to keep your forked repository clean.
- Get your local and forked
stagingbranch up to date with the upstream changes (see above).