Skip to content

[AVC] Add Duplicate Line ID audit to APIView Metrics#15490

Open
tjprescott wants to merge 4 commits intomainfrom
apiview/AuditDuplicateLineIds
Open

[AVC] Add Duplicate Line ID audit to APIView Metrics#15490
tjprescott wants to merge 4 commits intomainfrom
apiview/AuditDuplicateLineIds

Conversation

@tjprescott
Copy link
Copy Markdown
Member

@tjprescott tjprescott commented May 5, 2026

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-metrics command 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".

Copilot AI review requested due to automatic review settings May 5, 2026 17:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.LineId values (tree-recursive).
  • Populated a new HasDuplicateLineIds field on API revisions during create/update flows.
  • Added a new duplicate_line_ids metrics bucket (JSON output + optional chart + docs/skill updates) in apiview-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.

Comment thread packages/python-packages/apiview-copilot/src/_apiview_metrics.py Outdated
Comment thread packages/python-packages/apiview-copilot/src/_apiview_metrics.py Outdated
Comment thread packages/python-packages/apiview-copilot/src/_apiview_metrics.py
Comment thread packages/python-packages/apiview-copilot/src/_apiview_metrics.py
Comment thread packages/python-packages/apiview-copilot/cli.py Outdated
Comment thread src/dotnet/APIView/APIViewWeb/LeanModels/ReviewListModels.cs Outdated
@tjprescott tjprescott force-pushed the apiview/AuditDuplicateLineIds branch 2 times, most recently from 4d359eb to 565b596 Compare May 5, 2026 18:32
@tjprescott tjprescott force-pushed the apiview/AuditDuplicateLineIds branch from 565b596 to e654966 Compare May 5, 2026 19:51
@tjprescott tjprescott requested a review from Copilot May 5, 2026 19:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Comment thread src/dotnet/APIView/APIViewWeb/LeanControllers/ReviewsController.cs Outdated
Comment thread src/dotnet/APIView/APIViewWeb/Helpers/PageModelHelpers.cs
Comment thread packages/python-packages/apiview-copilot/src/_apiview_metrics.py Outdated
Comment thread src/dotnet/APIView/APIViewWeb/Managers/CodeFileManager.cs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Comment thread packages/python-packages/apiview-copilot/src/_apiview_metrics.py Outdated
Comment thread packages/python-packages/apiview-copilot/src/_apiview_metrics.py Outdated
Comment thread src/dotnet/APIView/APIViewUnitTests/ReviewsControllerTests.cs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Comment thread src/dotnet/APIView/APIViewWeb/Extensions/APIRevisionExtensions.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[APIView] Create metrics script to monitor progress toward 100% no-duplicate line ID compliance

2 participants