Skip to content

Merge dev into main - v0.26.8 release#146

Merged
djm81 merged 5 commits intomainfrom
merge/dev-to-main-20260127
Jan 27, 2026
Merged

Merge dev into main - v0.26.8 release#146
djm81 merged 5 commits intomainfrom
merge/dev-to-main-20260127

Conversation

@djm81
Copy link
Copy Markdown
Collaborator

@djm81 djm81 commented Jan 27, 2026

Description

This PR merges the latest changes from dev branch into main, bringing v0.26.8 release to production. The merge includes bug fixes for ADO field mappings, new interactive field mapping features, performance optimizations, and comprehensive documentation updates.

Fixes #144, #145

New Features

  • Interactive field mapping command (specfact backlog map-fields)
  • Template initialization in specfact init command
  • Performance optimizations for startup

Contract References:

  • src/specfact_cli/backlog/mappers/ado_mapper.py: Enhanced _extract_field() with multiple field alternatives
  • src/specfact_cli/backlog/converter.py: Improved assignee extraction with contract validation
  • src/specfact_cli/commands/backlog_commands.py: New interactive mapping command with input validation
  • src/specfact_cli/commands/init.py: Template copying with file system contracts

Type of Change

Please check all that apply:

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔒 Contract enforcement (adding/updating @icontract decorators)
  • 🧪 Test enhancement (scenario tests, property-based tests)
  • 🔧 Refactoring (code improvement without functionality change)

Contract-First Testing Evidence

Required for all changes affecting CLI commands or public APIs:

Contract Validation

  • Runtime contracts added/updated (@icontract decorators on public APIs)
  • Type checking enforced (@beartype decorators applied)
  • CrossHair exploration completed: hatch run contract-test-exploration
  • Contract violations reviewed and addressed

Test Execution

  • Contract validation: hatch run contract-test-contracts
  • Contract exploration: hatch run contract-test-exploration
  • Scenario tests: hatch run contract-test-scenarios
  • Full test suite: hatch run contract-test-full

Test Quality

  • CLI commands tested with typer test client
  • Edge cases covered with Hypothesis property tests
  • Error handling tested with invalid inputs
  • Rich console output verified manually or with snapshots

How Has This Been Tested?

Contract-First Approach: All changes validated through contracts and comprehensive scenario tests.

Manual Testing

  • Tested CLI commands manually
  • Verified rich console output
  • Tested with different input scenarios
  • Checked error messages for clarity

Automated Testing

  • Contract validation passes
  • Property-based tests cover edge cases
  • Scenario tests cover user workflows
  • All existing tests still pass

Test Environment

  • Python version: 3.11+
  • OS: Linux (Ubuntu), macOS, Windows

Checklist

  • My code follows the style guidelines (PEP 8, ruff format, isort)
  • I have performed a self-review of my code
  • I have added/updated contracts (@icontract, @beartype)
  • I have added/updated docstrings (Google style)
  • I have made corresponding changes to documentation
  • My changes generate no new warnings (basedpyright, ruff, pylint)
  • All tests pass locally
  • I have added tests that prove my fix/feature works
  • Any dependent changes have been merged

Quality Gates Status

  • Type checking ✅ (hatch run type-check)
  • Linting ✅ (hatch run lint)
  • Contract validation ✅ (hatch run contract-test-contracts)
  • Contract exploration ✅ (hatch run contract-test-exploration)
  • Scenario tests ✅ (hatch run contract-test-scenarios)

Summary of Changes

Bug Fixes

  • ADO Field Mapping - Acceptance Criteria: Fixed missing Acceptance Criteria field by adding Microsoft.VSTS.Common.AcceptanceCriteria as alternative mapping
  • ADO Field Mapping - Assignee Display: Fixed missing assignee information in backlog refinement preview output
  • ADO Assignee Extraction: Improved extraction from ADO System.AssignedTo object with support for displayName, uniqueName, and mail fields

New Features

  • Interactive Field Mapping Command: Added specfact backlog map-fields for guided ADO field mapping
  • Template Initialization: Extended specfact init to copy backlog field mapping templates

Performance

  • Startup Performance: Optimized with metadata tracking and update command improvements

Documentation

  • Extensively updated custom field mapping guide
  • Enhanced backlog refinement guide
  • Added troubleshooting documentation
  • Updated authentication and commands reference

Testing

  • Added comprehensive unit tests for all new functionality
  • Maintained ≥80% test coverage
  • Added E2E tests for init command
  • Enhanced backlog filtering tests

Files Changed

34 files changed, 2535 insertions(+), 137 deletions(-)

Key files:

  • src/specfact_cli/backlog/mappers/ado_mapper.py - Enhanced field extraction
  • src/specfact_cli/backlog/converter.py - Improved assignee extraction
  • src/specfact_cli/commands/backlog_commands.py - New interactive mapping command
  • src/specfact_cli/commands/init.py - Template initialization
  • Comprehensive test coverage in tests/unit/commands/ and tests/e2e/

Screenshots/Recordings (if applicable)

N/A - CLI command improvements with rich console output verified manually.

djm81 and others added 4 commits January 27, 2026 01:27
…command (#142)

* feat: implement backlog field mapping and refinement improvements

- Add FieldMapper abstract base class with canonical field names
- Implement GitHubFieldMapper and AdoFieldMapper
- Add custom field mapping support with YAML templates
- Add field validation in refinement (story_points, business_value, priority)
- Add comprehensive unit and integration tests (42 tests)
- Add custom field mapping documentation
- Fix custom_field_mapping parameter connection
- Add early validation for custom mapping files

Implements OpenSpec change: improve-backlog-field-mapping-and-refinement

* perf: optimize startup performance with metadata tracking and update command

- Add metadata management module for tracking version and check timestamps
- Optimize startup checks to only run when needed:
  - Template checks: Only after version changes detected
  - Version checks: Limited to once per day (24h threshold)
- Add --skip-checks flag for CI/CD environments
- Add new 'specfact update' command for manual update checking and installation
- Add comprehensive unit and integration tests (35 tests, all passing)
- Update startup_checks to use metadata for conditional execution
- Ensure backward compatibility (first-time users still get all checks)

Performance Impact:
- Startup time: Reduced from several seconds to < 1-2 seconds
- Network requests: Reduced from every startup to once per day
- File system operations: Reduced from every startup to only after version changes

Fixes #140
Implements OpenSpec change: optimize-startup-performance

* feat: request offline_access scope for Azure DevOps refresh tokens

- Add offline_access scope to Azure DevOps OAuth requests
- Refresh tokens now last 90 days (vs 1 hour for access tokens)
- Automatic token refresh via persistent cache (no re-authentication needed)
- Update documentation to reflect 90-day refresh token lifetime

This addresses the issue where tokens were expiring too quickly.
Refresh tokens obtained via offline_access scope enable automatic
token renewal for 90 days without user interaction.

Fixes token lifetime limitation issue

* feat: improve CLI UX with banner control and upgrade command

- Change banner to hidden by default, shown on first run or with --banner flag
- Add simple version line (SpecFact CLI - vXYZ) for regular use
- Rename 'update' command to 'upgrade' to avoid confusion
- Update documentation for new banner behavior and upgrade command
- Update startup checks message to reference 'specfact upgrade'

* fix: suppress version line in test mode and fix field mapping issues

- Suppress version line output in test mode and for help/version commands to prevent test failures
- Fix ADO custom field mapping to honor --custom-field-mapping on writeback
- Fix GitHub issue body updates to prevent duplicate sections
- Ensure proper type handling for story points and business value calculations

* Fix failed tests

* chore: bump version to 0.26.7 and update changelog

- Fixed adapter token validation tests (ADO and GitHub)
- Resolved test timeout issues (commit history, AST parsing, Semgrep)
- Improved test file discovery to exclude virtual environments
- Added file size limits for AST parsing to prevent timeouts

---------

Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com>
* fix: add missing ADO field mappings and assignee display

- Add Microsoft.VSTS.Common.AcceptanceCriteria to default field mappings
- Update AdoFieldMapper to support multiple field name alternatives
- Fix assignee extraction to include displayName, uniqueName, and mail
- Add assignee display in preview output
- Add interactive template mapping command (specfact backlog map-fields)
- Update specfact init to copy backlog field mapping templates
- Extend documentation with step-by-step guides

Fixes #144

* test: add unit tests for ADO field mapping and assignee fixes

- Add tests for Microsoft.VSTS.Common.AcceptanceCriteria field extraction
- Add tests for multiple field name alternatives
- Add tests for assignee extraction with displayName, uniqueName, mail
- Add tests for assignee filtering with multiple identifiers
- Add tests for assignee display in preview output
- Add tests for interactive mapping command
- Add tests for template copying in init command
- Update existing tests to match new assignee extraction behavior

* docs: update init command docstring to mention template copying

* docs: update documentation for ADO field mapping and interactive mapping features

- Update authentication guide with ADO token resolution priority
- Update custom field mapping guide with interactive mapping details
- Update backlog refinement guide with progress indicators and required field display
- Update Azure DevOps adapter guide with field mapping improvements
- Update command reference with map-fields command documentation
- Update troubleshooting guide with ADO-specific issues
- Update README files with new features
- Update getting started guide with template initialization

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: address review findings for ADO field mapping

- Prefer System.* fields over Microsoft.VSTS.Common.* when writing updates
  (fixes issue where PATCH requests could fail for Scrum templates)
- Preserve existing work_item_type_mappings when saving field mappings
  (prevents silent erasure of custom work item type mappings)

Fixes review comments:
- P1: Prefer System.AcceptanceCriteria when writing updates
- P2: Preserve existing work_item_type_mappings on save

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Dominikus Nold <djm81@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@djm81 djm81 self-assigned this Jan 27, 2026
@djm81 djm81 added bug Something isn't working enhancement New feature or request labels Jan 27, 2026
@djm81 djm81 moved this from Todo to In Progress in SpecFact CLI Jan 27, 2026
@djm81 djm81 linked an issue Jan 27, 2026 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown
Contributor

SpecFact CLI Validation Report

All validations passed!
Duration: 42.46s
Checks: 4 total (4 passed)

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9112a106fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/specfact_cli/backlog/mappers/ado_mapper.py
@djm81 djm81 closed this Jan 27, 2026
@github-project-automation github-project-automation bot moved this from In Progress to Done in SpecFact CLI Jan 27, 2026
@djm81 djm81 reopened this Jan 27, 2026
@djm81 djm81 merged commit c2a02ea into main Jan 27, 2026
4 of 5 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

SpecFact CLI Validation Report

All validations passed!
Duration: 41.54s
Checks: 4 total (4 passed)

@github-actions
Copy link
Copy Markdown
Contributor

SpecFact CLI Validation Report

All validations passed!
Duration: 42.18s
Checks: 4 total (4 passed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug] Field mapping incorrect, some fields missing on backlog refinement

1 participant