Skip to content

Conversation

mikeland73
Copy link
Contributor

@mikeland73 mikeland73 commented Oct 6, 2024

Summary

Closes DEV-151

(re) implements something similar to our old "planner" framework but only for python/poetry. It's only opt-in.

Using the --autodetect with init flag generates a devbox.json with any detection results.

Currently the framework only only uses the most relevant detector, but could be modified to use multiple detectors.

How was it tested?

devbox init --autodetect --dry-run

"docker run --rm --mount type=volume,src=devbox-testscripts-amd64,dst=/nix --platform linux/amd64 -e DEVBOX_RUN_FAILING_TESTS -e DEVBOX_RUN_PROJECT_TESTS -e DEVBOX_DEBUG $image \"$@\"",
],
},
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

no concerns with the change. Seems a no-op, right?
Is there a setting or something that we can all use to align our tools?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

devbox does this automatically if I ever run any devbox command that mutates the config. I guess we haven't done that in a while in this repo.

import "context"

type Detector interface {
IsRelevant(path string) (float64, error)
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we rename IsRelevant to Score, or if you'd like RelevancyScore ?

EDIT: Relevance() (float64, error) also seems good

},
}

command.Flags().BoolVar(&flags.autoDetect, "autodetect", false, "Automatically detect packages to add")
Copy link
Collaborator

Choose a reason for hiding this comment

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

thoughts on just auto?

Copy link

vercel bot commented Oct 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 7, 2024 8:46pm

@mikeland73 mikeland73 merged commit 834147a into main Oct 7, 2024
31 checks passed
@mikeland73 mikeland73 deleted the landau/autodetect branch October 7, 2024 22:27
mikeland73 added a commit that referenced this pull request Oct 7, 2024
## Summary

closes DEV-153

Stacked on #2325

## How was it tested?
maxcharm093 added a commit to maxcharm093/devbox that referenced this pull request Aug 24, 2025
## Summary

closes DEV-153

Stacked on jetify-com/devbox#2325

## How was it tested?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants