Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to identify backends not part of the pants distribution. #20548

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kaos
Copy link
Member

@kaos kaos commented Feb 14, 2024

These mistakes are done over and over again, and goes undetected for too long.

As a follow up, we could add a check mode and run during CI to catch early. For now, it's merely a conveniency that can be run manually.

Example output (pre #20529):

❯ ./build-support/bin/check_orphaned_plugins.py
These are discovered backends, which are not included in the pantsbuild.pants distribution:
  *   (internal_plugins.releases - intentionally excluded)
  *   (internal_plugins.test_lockfile_fixtures - intentionally excluded)
  * pants.backend.build_files.fmt.ruff
  * pants.backend.experimental.typescript
  *   (pants_explorer.server - intentionally excluded)

@kaos kaos added the category:internal CI, fixes for not-yet-released features, etc. label Feb 14, 2024
@kaos kaos requested a review from benjyw February 14, 2024 20:01
@huonw
Copy link
Contributor

huonw commented Feb 14, 2024

Nice! Is this something we can execute as a Pants test, so it gets run in CI automatically? One idea: a codegen target that exposes the output of peek, that a normal old pytest (or whatever) test could then depend on.

@kaos
Copy link
Member Author

kaos commented Feb 15, 2024

Interesting idea to have this as a test. I'll look into it!

@benjyw
Copy link
Sponsor Contributor

benjyw commented Feb 16, 2024

This is a great idea, and having it run as a test would be good.

@huonw
Copy link
Contributor

huonw commented Feb 21, 2024

My idea of a peek goal target is potentially too hard in the immediate term (although might be nice for users too)... an alternative that lets us start seeing the benefit sooner could be a test that runs outside the sandbox (that is, https://www.pantsbuild.org/2.19/reference/targets/python_test#run_goal_use_sandbox), and so can do things like directly globbing the filesystem for register.py files and/or parsing the relevant BUILD file (since help-all output might not be available either?).

@kaos
Copy link
Member Author

kaos commented Feb 22, 2024

I have this working, down to that I failed to run pants on the repo using adhoc_tool to get the output as a test resource, the issue being that I want to run it in-repo rather than in a sandbox (because that caused issues for some reason, iirc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants