All changes must be developed on feature branches and merged via Pull Requests.
feat/description- New featuresfix/description- Bug fixesdocs/description- Documentation updateschore/description- Maintenance tasksrefactor/description- Code refactoring
-
Create a feature branch:
git checkout -b feat/your-feature-name
-
Make your changes and commit using Conventional Commits:
git commit -m "feat: add new feature" git commit -m "fix: resolve bug in core logic" git commit -m "docs: update README"
-
Push your branch:
git push origin feat/your-feature-name
-
Create a Pull Request on GitHub targeting
main. -
Wait for CI checks to pass (tests, lint, typecheck).
-
Merge the PR (squash and merge recommended).
-
Automated versioning will trigger on merge to
main(see below).
Use semantic commit messages to enable automated versioning:
feat:- Triggers a minor version bump (0.x.0)fix:- Triggers a patch version bump (0.0.x)BREAKING CHANGE:in footer - Triggers a major version bump (x.0.0)chore:,docs:, etc. - No version bump
Example:
feat: add support for custom labels
Add --label flag to filter resources by labels.
Closes #123
-
Clone your fork:
git clone https://github.com/your-org/gcpath.git cd gcpath -
Install dependencies using
uv:uv sync
-
Authenticate with GCP:
gcloud auth application-default login
Run the full test suite:
uv run pytest tests/ -vRun specific tests:
uv run pytest tests/test_cli.py::test_ls_command -vRun with coverage:
uv run pytest tests/ --cov=gcpath --cov-report=term-missinggcpath supports two APIs: Cloud Asset API (default) and Resource Manager API. Both should be tested:
Test with Cloud Asset API (default):
uv run gcpath ls
uv run gcpath treeTest with Resource Manager API:
uv run gcpath ls --no-use-asset-api
uv run gcpath tree -UAutomated tests mock both API modes, so running pytest tests both implementations.
Before submitting a PR, ensure your code passes all checks:
# Run linter
make lint
# or: uv run ruff check src/ tests/
# Run type checker
make typecheck
# or: uv run mypy src/
# Run all tests
make test
# or: uv run pytest tests/All three must pass before merging.
We use Python Semantic Release to automate:
- Version bumping based on commit messages
- CHANGELOG generation
- Git tag creation
- GitHub Release creation
- PyPI publishing
This runs automatically on every push to main via GitHub Actions (.github/workflows/release.yml).