Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
294c844
Initial project setup with branching strategy, license, README, and c…
inntran Nov 6, 2025
261dc06
Add test infrastructure and GitHub Actions workflow
inntran Nov 6, 2025
361822f
Fix formatting issue with black
inntran Nov 6, 2025
d29833d
Reorder import statements for consistency in test files
inntran Nov 6, 2025
54ff731
Add source code to make tests pass
inntran Nov 6, 2025
c5fe13d
Add CertificatesResource and corresponding tests for managing share c…
inntran Nov 6, 2025
f4c286e
Add distributionresource and tests
inntran Nov 6, 2025
a3662b1
Add account historyresource and tests
inntran Nov 6, 2025
9145940
Add partnerresource and tests
inntran Nov 6, 2025
f8872b0
Refactor resource imports and initialization in The Mortgage Office A…
inntran Nov 6, 2025
f761d56
Add types-requests to dev dependencies
inntran Nov 6, 2025
94248f5
Add Pool data models with comprehensive test coverage
inntran Nov 6, 2025
d7e7d4d
Add test coverage for Pool.SysTimeStamp date parsing
inntran Nov 6, 2025
fec8489
Refactor class names to use TMO prefix for brevity
inntran Nov 6, 2025
edca0ed
Break too long lines into shorter ones
inntran Nov 6, 2025
3a3625f
Add comprehensive documentation with mkdocs-material and GitHub Pages…
inntran Nov 6, 2025
b3de14e
Add GitHub Actions workflow for publishing to TestPyPI and PyPI
inntran Nov 6, 2025
6215c1a
Add step to set default alias for missing documentation in develop br…
inntran Nov 6, 2025
da7c9fc
Add version information module and update imports in client tests
inntran Nov 7, 2025
5e17c40
Update TMOClient to accept custom User-Agent
inntran Nov 7, 2025
3cfe4ca
Add TMO API tooling and recent TMO API specs
inntran Nov 7, 2025
1c71d40
Increase raw body length limit in request display to 5000 characters
inntran Nov 7, 2025
94ea6c5
Docs workflow runs only when triggered by others.
inntran Nov 7, 2025
d1336eb
Fix Codecov upload condition and correct file parameter in CI workflow
inntran Nov 7, 2025
ed7c35f
Set package-ecosystem to 'pip' in dependabot config
inntran Nov 7, 2025
d0bea78
Potential fix for code scanning alert no. 2: Workflow does not contai…
inntran Nov 7, 2025
ba55572
Potential fix for code scanning alert no. 1: Workflow does not contai…
inntran Nov 7, 2025
eabf0ac
remove explict credentials for pypi
inntran Nov 8, 2025
882bed3
Create shared base for TMO CLI tools
inntran Nov 8, 2025
82624b4
Fix mypy typing issue, add CLI config tests
inntran Nov 8, 2025
9ade3e5
Complete TMO Mortgage Pool Shares operations
inntran Nov 8, 2025
86ae236
Fix issues found by mypy
inntran Nov 9, 2025
3bffb09
Updated changed names in tests.
inntran Nov 9, 2025
e624c35
Improve code coverage ratio.
inntran Nov 9, 2025
c1af395
Add VScode Python pytest settings
inntran Nov 10, 2025
4b39c3e
feat: Add bumpversion configuration and release process documentation
inntran Nov 11, 2025
3c26769
Bump version: 0.0.1 → 0.1.0
inntran Nov 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[tool.bumpversion]
current_version = "0.1.0"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
ignore_missing_files = false
tag = true
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
message = "Bump version: {current_version} → {new_version}"
commit_args = ""

[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = "version = \"{current_version}\""
replace = "version = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "src/tmo_api/_version.py"
search = "__version__ = \"{current_version}\""
replace = "__version__ = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "docs/changelog.md"
search = "## [Unreleased]"
replace = "## [Unreleased]\n\n## [{new_version}] - {now:%Y-%m-%d}"

[[tool.bumpversion.files]]
filename = "docs/changelog.md"
search = "[{current_version}]: https://github.com/inntran/tmo-api-python/releases/tag/v{current_version}"
replace = "[{new_version}]: https://github.com/inntran/tmo-api-python/releases/tag/v{new_version}\n[{current_version}]: https://github.com/inntran/tmo-api-python/releases/tag/v{current_version}"
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
assets/postman_collection/tmo_api_collection_*.json binary
195 changes: 195 additions & 0 deletions .github/BRANCHING_STRATEGY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
# Git Branching Strategy

This project follows a **Git Flow** branching model for organized development and releases.

## Branch Structure

### Main Branches

- **`main`** - Production-ready code
- Protected branch
- Only accepts merges from `staging` or hotfix branches
- Tagged with version numbers for releases
- Automatically deploys to PyPI (via GitHub Actions)

- **`develop`** - Main development branch
- Integration branch for features
- Default branch for development
- Protected branch (requires PR reviews)
- Base branch for all feature branches

- **`staging`** - Pre-production testing
- Testing branch before production
- Merge from `develop` when ready for release
- Deploy to test PyPI or staging environment
- Merge to `main` after validation

### Supporting Branches

These are temporary branches that should be deleted after merging:

- **`feature/*`** - New features
- Branch from: `develop`
- Merge back to: `develop`
- Naming: `feature/short-description`
- Example: `feature/add-authentication`

- **`bugfix/*`** - Bug fixes during development
- Branch from: `develop`
- Merge back to: `develop`
- Naming: `bugfix/issue-description`
- Example: `bugfix/fix-timeout-error`

- **`hotfix/*`** - Critical production fixes
- Branch from: `main`
- Merge to: `main` AND `develop`
- Naming: `hotfix/critical-issue`
- Example: `hotfix/security-vulnerability`

- **`release/*`** - Release preparation
- Branch from: `develop`
- Merge to: `main` AND `develop`
- Naming: `release/version-number`
- Example: `release/1.0.0`

## Workflow

### Feature Development
```bash
# Create feature branch from develop
git checkout develop
git pull origin develop
git checkout -b feature/my-new-feature

# Work on your feature
git add .
git commit -m "Add new feature"

# Push and create PR to develop
git push -u origin feature/my-new-feature
```

### Bug Fixes
```bash
# Create bugfix branch from develop
git checkout develop
git pull origin develop
git checkout -b bugfix/fix-something

# Fix the bug
git add .
git commit -m "Fix something"

# Push and create PR to develop
git push -u origin bugfix/fix-something
```

### Release Process
```bash
# Create release branch from develop
git checkout develop
git pull origin develop
git checkout -b release/1.0.0

# Update version numbers, changelog
git add .
git commit -m "Prepare release 1.0.0"

# Push to staging for testing
git checkout staging
git merge release/1.0.0
git push origin staging

# After validation, merge to main
git checkout main
git merge release/1.0.0
git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin main --tags

# Merge back to develop
git checkout develop
git merge release/1.0.0
git push origin develop

# Delete release branch
git branch -d release/1.0.0
git push origin --delete release/1.0.0
```

### Hotfix Process
```bash
# Create hotfix branch from main
git checkout main
git pull origin main
git checkout -b hotfix/critical-fix

# Fix the critical issue
git add .
git commit -m "Fix critical issue"

# Merge to main
git checkout main
git merge hotfix/critical-fix
git tag -a v1.0.1 -m "Hotfix 1.0.1"
git push origin main --tags

# Merge to develop
git checkout develop
git merge hotfix/critical-fix
git push origin develop

# Delete hotfix branch
git branch -d hotfix/critical-fix
git push origin --delete hotfix/critical-fix
```

## Branch Protection Rules

Configure these on GitHub (Settings → Branches):

### For `main`:
- ✅ Require pull request reviews before merging
- ✅ Require status checks to pass (tests, linting)
- ✅ Require branches to be up to date before merging
- ✅ Require linear history
- ✅ Do not allow bypassing the above settings
- ✅ Restrict who can push (only maintainers)

### For `develop`:
- ✅ Require pull request reviews before merging
- ✅ Require status checks to pass
- ✅ Allow force pushes by maintainers (for cleanup)

### For `staging`:
- ✅ Require status checks to pass
- ✅ Allow direct pushes from release branches

## Best Practices

1. **Keep commits atomic** - One logical change per commit
2. **Write descriptive commit messages** - Explain why, not just what
3. **Keep branches short-lived** - Merge frequently to avoid conflicts
4. **Delete merged branches** - Keep the repository clean
5. **Never commit directly to main** - Always use PRs
6. **Tag all releases** - Use semantic versioning (v1.0.0)
7. **Update CHANGELOG.md** - Document all changes in releases
8. **Run tests locally** - Before pushing and creating PRs

## Quick Reference

```bash
# Start new feature
git checkout develop && git pull && git checkout -b feature/name

# Update from develop while working
git checkout develop && git pull && git checkout - && git rebase develop

# Finish feature
git push -u origin feature/name # Then create PR on GitHub

# Check what branch you're on
git branch

# See recent commits
git log --oneline --graph --all -10
```
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
91 changes: 91 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Deploy Documentation

on:
workflow_run:
workflows:
- Tests
types:
- completed
workflow_dispatch:

permissions:
contents: write

jobs:
deploy:
if: >
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
(
github.event.workflow_run.head_branch == 'main' ||
github.event.workflow_run.head_branch == 'staging' ||
github.event.workflow_run.head_branch == 'develop' ||
github.event.workflow_run.head_branch == '' ||
github.event.workflow_run.head_branch == null
)
)
runs-on: ubuntu-latest
env:
TARGET_BRANCH: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch || github.ref_name }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all history for mike versioning

- name: Detect tag (workflow_run)
id: tag
if: env.TARGET_BRANCH == ''
run: |
TAG=$(git describe --tags --exact-match 2>/dev/null || true)
echo "value=$TAG" >> "$GITHUB_OUTPUT"

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[docs]"

- name: Deploy documentation (main branch)
if: env.TARGET_BRANCH == 'main'
run: |
mike deploy --push --update-aliases latest stable
mike set-default --push latest

- name: Deploy documentation (staging branch)
if: env.TARGET_BRANCH == 'staging'
run: |
mike deploy --push staging

- name: Deploy documentation (develop branch)
if: env.TARGET_BRANCH == 'develop'
run: |
mike deploy --push dev

- name: Set default alias when missing (develop)
if: env.TARGET_BRANCH == 'develop'
run: |
DEFAULT_ALIAS=$(mike list --remote 2>/dev/null | awk '/^\*/ {print $2}')
if [ -z "$DEFAULT_ALIAS" ]; then
mike set-default --push dev
fi

- name: Deploy documentation (version tag)
if: steps.tag.outputs.value != ''
run: |
VERSION=${{ steps.tag.outputs.value }}
VERSION=${VERSION#v}
mike deploy --push --update-aliases $VERSION stable
mike set-default --push $VERSION
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish
permissions:
contents: read
id-token: write

on:
push:
branches:
- main
- staging
workflow_dispatch:

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"

- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build

- name: Build distributions
run: |
rm -rf dist
python -m build

- name: Publish to TestPyPI
if: github.ref == 'refs/heads/staging'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

- name: Publish to PyPI
if: github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1

Loading