[AVC] Add Duplicate Line ID audit to APIView Metrics#15490
Open
tjprescott wants to merge 4 commits intomainfrom
Open
[AVC] Add Duplicate Line ID audit to APIView Metrics#15490tjprescott wants to merge 4 commits intomainfrom
tjprescott wants to merge 4 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends APIView’s revision data and the avc report apiview-metrics command to track duplicate LineId occurrences over time, enabling trend monitoring toward “no duplicate line IDs” compliance across languages.
Changes:
- Added a CodeFile audit helper to detect duplicate
ReviewLine.LineIdvalues (tree-recursive). - Populated a new
HasDuplicateLineIdsfield on API revisions during create/update flows. - Added a new
duplicate_line_idsmetrics bucket (JSON output + optional chart + docs/skill updates) inapiview-copilot.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/dotnet/APIView/APIViewWeb/Managers/CodeFileManager.cs | Adds duplicate line ID detection helper for parsed CodeFiles. |
| src/dotnet/APIView/APIViewWeb/Managers/APIRevisionsManager.cs | Sets HasDuplicateLineIds during revision creation/update paths. |
| src/dotnet/APIView/APIViewWeb/LeanModels/ReviewListModels.cs | Adds HasDuplicateLineIds field to the revision model persisted to Cosmos. |
| packages/python-packages/apiview-copilot/src/_apiview_metrics.py | Implements duplicate-line-id monthly reporting + chart + terminal summary. |
| packages/python-packages/apiview-copilot/cli.py | Wires the new report into avc report apiview-metrics output/chart/summary. |
| packages/python-packages/apiview-copilot/docs/metrics.md | Documents the new duplicate_line_ids bucket. |
| packages/python-packages/apiview-copilot/AGENTS.md | Updates agent-facing description of the metrics command. |
| packages/python-packages/apiview-copilot/.github/skills/report-apiview-metrics/SKILL.md | Updates skill metadata and instructions to include the new bucket/chart. |
4d359eb to
565b596
Compare
565b596 to
e654966
Compare
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.
Closes #15345.
Adds a "HasDuplicateLineIds" property to revisions. Runs a check when a CodeFile is parsed and sets this value (non-blocking, non-throwing) so the
avc report apiview-metricscommand can track trends on this issue.Once compliance is at 100% we can just make this check blocking.
We will run a self-healing check when revisions are opened, but we will not perform a wholesale migration and thus this will become a more forward-looking metric. Revisions with no data will be reported as "unknown".