Development Flow¶
This page describes the recommended day-to-day development workflow for
oqtopus-client.
The examples below assume a two-branch model:
mainis the release branchdevelopis the day-to-day integration branch
Branch Strategy¶
Create short-lived topic branches from develop, then merge them back through
a pull request. Releases are promoted from develop to main.
gitGraph LR:
commit tag:"release-v1.0.0"
branch develop
commit
branch feature/sdk-helper
commit
commit
checkout develop
branch bugfix/error-payload
commit
checkout develop
merge bugfix/error-payload
checkout feature/sdk-helper
commit
checkout develop
merge feature/sdk-helper
checkout main
merge develop tag:"release-v1.1.0"
checkout develop
branch hotfix/urgent-fix
commit
checkout develop
merge hotfix/urgent-fix
checkout main
merge develop tag:"release-v1.1.1"
Branch Naming¶
Recommended naming:
feature/<name>for new featuresbugfix/<name>for bug fixeshotfix/<name>for urgent fixesdocs/<name>for documentation-only workrefactor/<name>for internal cleanups without behavior changes
Examples:
feature/generated-api-referencebugfix/retry-status-codesdocs/setup-guide-refresh
Recommended Workflow¶
For most changes, the following flow keeps diffs small and reviewable.
- Update your local
develop. - Create a focused branch.
- Implement the change.
- Run the minimum relevant checks.
- Update docs and generated outputs when needed.
- Open a pull request with enough context for reviewers.
Example:
git switch develop
git pull --ff-only
git switch -c feature/generated-api-reference
uv sync --all-extras
make check
make docs
Change Types¶
Regular Python Changes¶
For changes under src/oqtopus_client/services/, tests/, examples/, or
docs:
- keep the change focused on one behavior or one contributor task
- add or update tests for behavior changes
- update usage docs when the public API changes
- run
make checkbefore opening the PR
OpenAPI-Generated Client Changes¶
The generated client under src/oqtopus_client/rest/ should never be edited by
hand.
When generated code must change:
- update the source OpenAPI definition
- regenerate the client
- review the generated diff carefully
- include the generation command in the PR description
Typical flow:
make download-oas
make generate-models
make check
make docs
If you need to point at a different OpenAPI source during development:
make -C spec download-oas \
OAS_URL=https://raw.githubusercontent.com/oqtopus-team/oqtopus-cloud/main/backend/oas/user/openapi.yaml
make -C spec generate-models \
OAS_FILE=openapi.yaml \
MODEL_OUTPUT_DIR=../src/oqtopus_client/rest
When generated code changes, reviewers should be able to tell:
- why the source API changed
- which command regenerated the client
- whether any hand-written wrappers or tests were updated to match
Validation Before PR¶
Run the smallest meaningful set of checks, but prefer the full set before requesting review.
Core checks¶
make lint
make typecheck
make test
Combined check¶
make check
Documentation checks¶
make docs
make docs-serve
Use make docs when changing docs, API reference generation, docstrings, or
MkDocs configuration. It runs strict validation and catches broken links and
navigation issues.
Commit Messages¶
Use Conventional Commits when possible.
Recommended prefixes:
feat:new featurefix:bug fixdocs:documentation changesrefactor:internal refactor without behavior changetest:new or updated testsci:CI or automation changeschore:maintenance work
Examples:
feat: add generated openapi reference landing pagesfix: stop retrying 5xx responses by defaultdocs: expand development flow guidetest: cover device_info json parsing
Optional local commit template¶
This repository includes a .gitmessage template. To enable it locally:
git config --local commit.template .gitmessage
After that, git commit opens a ready-to-edit template in your editor.
Pull Requests¶
Keep pull requests focused and easy to review.
Recommended PR contents:
- related ticket or issue, if any
- short summary of what changed
- validation results such as
make checkormake docs - related PRs, especially when the change depends on OAS updates elsewhere
For oqtopus-client, also call out the following when relevant:
- public API changes
- renamed helpers or breaking changes
- generated code updates under
src/oqtopus_client/rest/ - documentation updates for examples, setup, or API reference
PR Checklist¶
- the branch is scoped to one topic
- tests were added or updated for behavior changes
- docs were updated for user-facing changes
- generated files were regenerated instead of manually edited
make checkpassed, or any skipped checks are explainedmake docspassed for doc or docstring changes
Merge Policy¶
Prefer a clean history on both develop and main.
- Use
Squash and mergefor mostdevelop<- topic branch PRs. - Use a regular merge commit for
main<-developrelease promotions. - Keep the PR title or squash commit message in Conventional Commits style.
- Avoid mixing unrelated generated diffs and hand-written refactors in one PR.
Release¶
Before a release, update the package version in pyproject.toml and run the
release checks:
make check
make docs
rm -rf build dist src/*.egg-info
uv build
uvx twine check dist/*
After promoting develop to main, create a vX.Y.Z tag and publish a
GitHub Release. Publishing the GitHub Release triggers
.github/workflows/python-publish.yaml, which builds the package and publishes
it to PyPI with Trusted Publishing.
Review Tips for Generated Diffs¶
Generated diffs can be noisy, so review them separately from hand-written code when possible.
A practical pattern is:
- review
spec/or the upstream OAS source change first - review generated code under
src/oqtopus_client/rest/ - review wrapper logic under
src/oqtopus_client/services/ - review tests, examples, and docs last
This makes it much easier to see whether the generated client and the hand-written SDK layer still match.