Conversation
…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>
SpecFact CLI Validation Report✅ All validations passed! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 700c360450
ℹ️ 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".
| for ado_field, canonical in field_mappings.items(): | ||
| if canonical == canonical_field: | ||
| value = fields_dict.get(ado_field) | ||
| if value is not None: | ||
| return str(value).strip() if isinstance(value, str) else str(value) |
There was a problem hiding this comment.
Prefer custom ADO mappings over defaults during extraction
Custom field mappings are documented as overriding defaults, but _extract_field walks field_mappings in insertion order, and _get_field_mappings builds the dict by copying defaults then appending custom mappings. This means if a work item contains both a default field and a custom field for the same canonical value (common when templates add custom fields but the defaults remain populated, e.g., story points = 0), the default value is returned first and the custom mapping is ignored. In ADO setups with custom fields, this causes the mapper to silently read the wrong value. Consider prioritizing custom mappings when extracting or removing default entries for canonical fields that are custom-mapped.
Useful? React with 👍 / 👎.
| @@ -179,6 +200,21 @@ def convert_ado_work_item_to_backlog_item(item_data: dict[str, Any], provider: s | |||
| body_markdown = fields.get("System.Description", "") or "" | |||
There was a problem hiding this comment.
Use custom-mapped description for ADO body content
The converter always sets body_markdown from System.Description. With the new custom field mapping support, ADO instances that store descriptions in a different field (e.g., Custom.Description) will produce empty body_markdown even though AdoFieldMapper can extract the description. This breaks template detection/refinement for those users because the backlog item body is blank. Consider populating body_markdown from the mapper’s extracted description (or falling back to it when System.Description is missing).
Useful? React with 👍 / 👎.
Description
This PR merges the latest changes from `dev` to `main`, including version bump to 0.26.7 and performance optimizations.
Fixes #142
New Features
Contract References:
Type of Change
Please check all that apply:
Contract-First Testing Evidence
Required for all changes affecting CLI commands or public APIs:
Contract Validation
Test Execution
Test Quality
How Has This Been Tested?
Contract-First Approach: All changes validated through contracts and comprehensive test suite.
Manual Testing
Automated Testing
Test Environment
Checklist
Quality Gates Status
Key Changes Summary
Version: 0.26.6 → 0.26.7
Major Features:
Files Changed: 47 files, +4196 insertions, -178 deletions
See CHANGELOG.md for complete details.