Skip to content

Expand existing tool format detection - #154

Merged
andrew merged 5 commits into
git-pkgs:mainfrom
abhinavgautam01:issue-144-expand-tool-format-detection
Aug 24, 2026
Merged

Expand existing tool format detection#154
andrew merged 5 commits into
git-pkgs:mainfrom
abhinavgautam01:issue-144-expand-tool-format-detection

Conversation

@abhinavgautam01

Copy link
Copy Markdown
Contributor

Closes #144

Summary

  • add Gradle version-catalog detection for gradle/libs.versions.toml
  • add NuGet central package management detection for Directory.Packages.props and Directory.Build.props
  • add Helm detection for Chart.lock, requirements.yaml and requirements.lock
  • add Yarn Plug'n'Play detection for .pnp.cjs
  • add legacy pnpm lockfile detection for shrinkwrap.yaml
  • add Ansible Galaxy detection for requirements and galaxy metadata files
  • add plain BUILD detection for Bazel
  • introduce exclude_files detection support to distinguish Bazel projects from Pants projects
  • make pants.toml the authoritative Pants project marker
  • replace numeric knowledge-base totals in the generated README with a count-free introduction
  • add focused regression tests for every new format and the Bazel/Pants collision

Testing

  • gofmt
  • go build ./...
  • go test -race ./...
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest run ./...
  • verified the generated README block matches go run ./cmd/brief list -readme tools
  • git diff --check

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Expands Brief’s knowledge-base detection to recognize additional “marker” files for existing tools (and resolve Bazel/Pants ambiguity), while updating the generated README tools introduction to avoid stale numeric totals.

Changes:

  • Added new detection markers for Gradle, NuGet, Helm, Yarn, pnpm, Ansible Galaxy, and Bazel (including exclude_files support and Pants marker tightening).
  • Updated detection engine and KB schema to support exclude_files, plus added regression tests for newly supported markers and the Bazel/Pants collision.
  • Refactored README tools-block generation to output a count-free introduction and added a unit test for it.

Reviewed changes

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

Show a summary per file
File Description
README.md Updates generated tools intro line to a count-free sentence.
knowledge/python/pants.toml Makes pants.toml the sole Pants detection marker (drops BUILD).
knowledge/node/yarn.toml Adds .pnp.cjs as a Yarn detection marker.
knowledge/node/pnpm.toml Adds shrinkwrap.yaml as a legacy pnpm lockfile marker.
knowledge/java/gradle.toml Adds gradle/libs.versions.toml version-catalog marker.
knowledge/csharp/nuget.toml Adds central package management markers (Directory.*.props).
knowledge/_shared/helm.toml Adds Chart.lock + legacy requirements markers.
knowledge/_shared/bazel.toml Adds plain BUILD and introduces exclude_files to avoid Pants collision.
knowledge/_shared/ansible.toml Adds Ansible Galaxy requirements + metadata markers.
kb/kb.go Adds exclude_files field to KB detection schema.
detect/detect.go Implements exclude_files handling in tool matching.
detect/detect_test.go Adds focused regression tests for new markers + Bazel/Pants collision; adds assertToolNotDetected.
cmd/brief/main.go Refactors README tools output into writeToolsReadme(io.Writer, ...).
cmd/brief/list_test.go Adds unit test ensuring README tools intro omits numeric totals.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread knowledge/_shared/helm.toml Outdated
Comment thread knowledge/_shared/ansible.toml Outdated
Comment thread detect/detect_test.go

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two changes are needed:

  • knowledge/_shared/ansible.toml:13: Detection misses valid root-level - name: and - include: Galaxy role requirements shown in the Ansible documentation. Add coverage for these forms while retaining the Helm collision checks.
  • detect/detect.go:476: exclude_files affects detection, but detect/filter.go:293 omits it from changed-file matching. Removing pants.toml from a repository containing BUILD makes Bazel detectable, yet brief diff filters Bazel out. Include exclusion patterns in the filter and test this removal case.

@abhinavgautam01

Copy link
Copy Markdown
Contributor Author

Thanks, fixed both items. Ansible requirements now cover the documented - name: and - include: forms while retaining the Helm collision assertions. Exclusion patterns are also included in changed-file filtering, with a regression test covering removal of pants.toml. Build, race tests and lint all pass.

@andrew
andrew force-pushed the issue-144-expand-tool-format-detection branch from c33a4a9 to 379cd9c Compare August 24, 2026 15:09
@andrew

andrew commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Rebased this branch onto current main and pushed two follow-up fixes. Helm dependency lists now suppress only the ambiguous Ansible requirements signal while explicit Ansible markers still work, and the README tools block is regenerated with a drift test.

@abhinavgautam01

Copy link
Copy Markdown
Contributor Author

Thanks, I pulled in the follow-up commits and fixed the Windows failure by normalizing CRLF line endings before parsing the README markers.

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Helm and Ansible requirements collision is resolved with production-path regression coverage, and the README drift check now handles Windows line endings.

@andrew
andrew merged commit c66e388 into git-pkgs:main Aug 24, 2026
5 checks passed
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.

Expand existing tool format detection

3 participants