Create testing framework for Add-in Project - #45
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
There are a few correctness/UX issues (solution build mapping, UI label typo, and multi-select “Add New” eligibility vs change status) that should be addressed before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR establishes a dependency-free “review rules” core (plus xUnit tests) so deterministic UTRANS change-review behavior can be validated in GitHub Actions without requiring the ArcGIS Pro SDK, and updates the ArcGIS Pro add-in to consume that core where appropriate.
Changes:
- Added
UGRC.UtransTools.Core(net8.0) andUGRC.UtransTools.Core.Testswith initial rule/payload/save-plan coverage. - Refactored add-in save/new-road logic and editor state to use core rule helpers, including updated Change Status UX.
- Updated CI to run CSharpier across the add-in folder and execute core tests with coverage on Ubuntu.
File summaries
| File | Description |
|---|---|
| UGRC.UtransTools.sln | Adds core + test projects and new solution configurations. |
| docs/agents/triage-labels.md | Documents label mapping for agent triage roles. |
| docs/agents/issue-tracker.md | Documents GitHub issue-tracker conventions for agents. |
| docs/agents/domain.md | Documents how agents should consume repo domain docs. |
| CONTEXT.md | Introduces canonical domain vocabulary for UTRANS change review. |
| AGENTS.md | Adds entrypoint pointers for agent documentation. |
| add-in/UGRC.UtransTools/UtransEditorDockpaneViewModel.cs | Updates editor state/commands to support Change Status edits and saving without a linked road, and to gate “repair” UX. |
| add-in/UGRC.UtransTools/UtransEditorDockpaneView.xaml | Wires XAML to new view-model properties (Change Status, Save visibility, repair enablement). |
| add-in/UGRC.UtransTools/UGRC.UtransTools.csproj | References the new Core project from the add-in. |
| add-in/UGRC.UtransTools/Services/UtransEditService.cs | Uses core ReviewRules for eligibility, payload building, and save planning. |
| add-in/UGRC.UtransTools/Services/DfcSelectionService.cs | Adds selection helper for “exactly one UTRANS road selected”. |
| add-in/UGRC.UtransTools/Models/EditorReviewState.cs | Renames and implements ChangeStatus, and moves edited-value normalization into core rules. |
| add-in/UGRC.UtransTools/Models/DfcSelectionSnapshot.cs | Uses core DfcResultReview to identify unlinked new records. |
| add-in/UGRC.UtransTools/Models/DfcDisposition.cs | Removes the old enum in favor of Change Status handling. |
| add-in/UGRC.UtransTools/Configuration/UtransEditorConfiguration.cs | Renames the “disposition” field constant to “change status”. |
| add-in/UGRC.UtransTools/Config.daml | Bumps add-in version metadata. |
| add-in/UGRC.UtransTools.Core/UGRC.UtransTools.Core.csproj | New dependency-free core library project (net8.0). |
| add-in/UGRC.UtransTools.Core/ReviewRules.cs | Implements core deterministic rules: address-range validation, normalization, payload building, and save planning. |
| add-in/UGRC.UtransTools.Core.Tests/UGRC.UtransTools.Core.Tests.csproj | New xUnit test project with coverlet collector. |
| add-in/UGRC.UtransTools.Core.Tests/ReviewRulesTests.cs | Adds unit tests covering rule behaviors and payload/save-plan outcomes. |
| add-in/README.md | Updates usage docs for Change Status and Save vs Add New behavior. |
| .vscode/settings.json | Updates approved command patterns for tooling/tasks. |
| .github/workflows/pull_request.add_in.yml | Expands formatting scope and adds Ubuntu test job for core with coverage. |
Review details
- Files reviewed: 23/23 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
338ac16 to
e012a8f
Compare
743ba46 to
c4c1b5c
Compare
There was a problem hiding this comment.
🟡 Changes recommended
There are a couple of correctness/maintainability issues in newly introduced/modified logic that should be addressed before merging (see PR comments).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 24/24 changed files
- Comments generated: 2
- Review effort level: Lite
This allows for ignoring features that we don't want to pull into UTRANS.
…rite the dropdown value to UTRANS on save
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…tribute rule take care of it
583694e to
d95eeff
Compare
Co-authored-by: stdavis <1326248+stdavis@users.noreply.github.com>
Head branch was pushed to by a user without write access
We can't test everything since we don't have access to the ArcGIS Pro SDK in GitHub Actions. But we were able to pull out some logic into a separate .NET project and write tests for that.
Closes #37