Skip to content

feat(ci): enforce shared path utilities in new and changed production and test code #948

Backlog

Description

@akrock

Problem

AppSurface has shared helpers for constructing a path beneath a known root. Today the repository check scans test sources and looks for certain names in dynamic arguments. A production call, a fixture with a generated filename, or an assertion using Path.Combine(root, "docs", "README.md") can pass CI. Reviewers have to catch the same pattern repeatedly. See #452 for the original test-helper work and #935 for the filesystem path policy.

Acceptance criteria

  • Pull-request CI fails on new or modified C# calls to System.IO.Path.Combine and System.IO.Path.Join in both production and test code, including literal-only arguments, generated values, and expected paths in assertions. Detect the actual APIs across multiline calls, fully qualified names, and aliases.
  • Compare against the PR merge base at the expression level. Changing a child argument on a different line from the method name triggers the check. Editing an unrelated line in the same file or shifting an existing call down the file leaves untouched legacy calls alone.
  • Cover equivalent under-root construction with Path.GetFullPath(child, root) and unambiguous filesystem path interpolation or concatenation. Ordinary filename extraction, temp-root lookup, arbitrary destination normalization, and non-filesystem strings remain valid.
  • Report the file, line, and appropriate replacement. For full paths use PathUtils.PathUnder in production and TestPathUtils.PathUnder in fixtures and assertions, preserving every child segment. For validated relative fixture strings use TestPathUtils.RelativePath.
  • Support narrow, reasoned exceptions for helper internals or intentional platform semantics. Preserve the existing test policy’s coverage and exception validation.
  • Exercise the CI entry point with passing and failing PR diffs. Include both methods with literal children in both production and tests, a changed multiline argument, helper-based replacements, an approved exception, and an unchanged legacy call beside an unrelated edit. Document how contributors run the check locally.

Activity

  1. added
    enhancement
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions