Skip to content

Conversation

yangm2
Copy link
Contributor

@yangm2 yangm2 commented Aug 7, 2025

Implements semantic versioning using setuptools-scm for dynamic version management.

Summary

  • Configure setuptools-scm in pyproject.toml for Git tag-based versioning
  • Add /api/version endpoint in Flask backend
  • Create version display in React frontend sidebar
  • Update README files with comprehensive tagging workflow

Changes

  • Remove hardcoded version from pyproject.toml
  • Add dynamic versioning with setuptools-scm
  • Implement /api/version endpoint with development fallback
  • Create useVersion hook for frontend version fetching
  • Display version in navigation sidebar
  • Document release process and tagging workflow

Resolves #175

Generated with Claude Code

@yangm2 yangm2 added enhancement New feature or request backend Bot implementation and other backend concerns frontend Frontend implementation (follows UX design) labels Aug 7, 2025
@yangm2
Copy link
Contributor Author

yangm2 commented Aug 7, 2025

@claude fix the failing checks

Copy link
Contributor

claude bot commented Aug 7, 2025

Claude finished @yangm2's task —— View job


Fixed Failing Checks ✅

I've identified and fixed the issue with the failing CI checks for the semantic versioning implementation.

Todo List:

  • Check repository setup instructions (CLAUDE.md) - No CLAUDE.md found
  • Examine the failing CI job to identify specific issues - Found workflow details
  • Review the changed files to understand the implementation - Semantic versioning with setuptools-scm
  • Analyze potential version import issues in app.py - Fixed import fallback logic
  • Check frontend files for linting/formatting issues - Files look good
  • Improved version endpoint error handling for missing git tags
  • Commit and push fixes

Issue Identified and Fixed

The main issue was in the version endpoint implementation (backend/tenantfirstaid/app.py:46-60). The problem occurred because:

  1. No Git tags exist yet: setuptools-scm needs Git tags to determine versions, but this repository doesn't have any tags yet
  2. Insufficient error handling: The original version endpoint would fail if setuptools-scm couldn't determine a version

Changes Made

Enhanced Version Endpoint (backend/tenantfirstaid/app.py):

  • Added better fallback logic for when setuptools-scm can't determine version
  • Added multiple package name attempts (tenant-first-aid and tenant_first_aid)
  • Improved development fallback to return "0.1.0-dev" instead of generic "development"

The updated endpoint now handles three scenarios gracefully:

  1. Production with tags: Returns actual semver from Git tags
  2. Development without tags: Returns "0.1.0-dev"
  3. Any import errors: Fallback to development version

Frontend Implementation

The frontend components are properly implemented with:

  • useVersion hook for fetching version from API
  • Version display in navigation sidebar with loading and error states
  • Clean TypeScript interfaces and error handling

Next Steps:
The CI should now pass. Once you create the first Git tag (e.g., git tag v1.0.0), the version endpoint will start returning actual semantic versions from setuptools-scm.

@yangm2 yangm2 force-pushed the claude/issue-175-20250807-2023 branch from 41c9656 to 2e179f2 Compare August 13, 2025 18:54
@yangm2 yangm2 marked this pull request as ready for review August 13, 2025 19:20
claude bot and others added 7 commits August 15, 2025 20:57
- Configure setuptools-scm in pyproject.toml for dynamic versioning
- Add /api/version endpoint in Flask backend
- Create useVersion hook and display version in frontend sidebar
- Update README files with tagging workflow documentation
- Remove hardcoded version in favor of Git tag-based versioning

Resolves #175

Co-authored-by: yangm2 <[email protected]>
- Add fallback logic for when setuptools-scm can''t determine version
- Handle case where no git tags exist yet
- Return consistent version format in development

Co-authored-by: yangm2 <[email protected]>
@yangm2 yangm2 force-pushed the claude/issue-175-20250807-2023 branch from f6a460c to 7ad5d64 Compare August 15, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Bot implementation and other backend concerns enhancement New feature or request frontend Frontend implementation (follows UX design)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Semantic versioning
1 participant