fix: forward ticket_detection_config from GitAnalyzer to TicketExtractor#50
Merged
bobmatnyc merged 1 commit intoApr 27, 2026
Conversation
GitAnalyzer.__init__ silently dropped the user's ticket_detection settings
when building its in-memory TicketExtractor. The analyze-stage re-extraction
("Analyzing commits for tickets") therefore fell back to hard-coded default
platform patterns (jira/github/clickup/linear), ignoring any
analysis.ticket_detection.patterns / exclude_patterns / position from
the config.
GitDataFetcher already forwards this config correctly, so the bug only
surfaced on cache-hit re-runs where the data-fetch step is skipped and
the in-memory extractor's defaults take over. Coverage numbers and
platform attribution between fresh fetches and cached runs diverged for
any user with custom patterns.
Fix: thread ticket_detection_config through GitAnalyzer.__init__ to
build_ticket_extractor(), matching the existing pattern in
GitDataFetcher. Update all five callers (pipeline_report,
cli_analysis_orchestrator, cli_identity_commands x2, training.pipeline)
to pass it.
Adds a regression test that fails on unfixed code with TypeError and
verifies that custom patterns actually reach the extractor when supplied.
bobmatnyc
approved these changes
Apr 27, 2026
Owner
bobmatnyc
left a comment
There was a problem hiding this comment.
Clean fix. The bug is real — TicketExtractor in GitAnalyzer was silently falling back to defaults on cached re-runs while GitDataFetcher already forwarded the config correctly. The fix is surgical and consistent with the existing pattern. Tests cover both the regression case and backward compatibility. LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GitAnalyzer.__init__builds its in-memoryTicketExtractorwithout forwardingticket_detection_config. As a result the analyze-stage re-extraction (theAnalyzing commits for ticketspass) silently falls back to the hard-coded default platform patterns (jira/github/clickup/linear), ignoring whatever the user supplied underanalysis.ticket_detection.patterns,exclude_patterns, orpositionin the YAML config.GitDataFetcheralready forwards the config correctly (core/data_fetcher.py:84), so the bug only surfaces on cache-hit re-runs where data fetching is skipped and the in-memory extractor's defaults take over. Coverage numbers and platform attribution between a fresh fetch and a cached re-run diverge for any user with custom patterns.Buggy call site
src/gitflow_analytics/core/analyzer.py:63-68:```python
self.ticket_extractor = build_ticket_extractor(
allowed_platforms=allowed_ticket_platforms,
ml_config=ml_categorization_config,
llm_config=llm_config,
cache_dir=cache.cache_dir / "ml_predictions",
# ticket_detection_config is missing here
)
```
Real-world impact
Analyzing a 26-repo Azure DevOps codebase with custom `AB#NNNN` / `NNNNNN-` patterns, the official report shows 39.8% ticket coverage, but a direct call to `TicketExtractor` instantiated from the same config produces 60.7%. The user-supplied config is silently ignored on every cached run.
Reproduction
Fix
Test plan
Notes
The bug only surfaces on cache-hit re-runs because `GitDataFetcher` (which runs on cache miss) already forwards the config correctly. First-time analyses see correct coverage; the divergence appears on the second run unless `--clear-cache` is used. This makes the bug easy to miss in development but consistently misleading in long-lived deployments.