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 extract manifests command #2

Open
mjpitz opened this issue Aug 5, 2020 · 5 comments
Open

Add extract manifests command #2

mjpitz opened this issue Aug 5, 2020 · 5 comments
Assignees
Labels
effort: 2 good first issue Good for newcomers. help type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects

Comments

@mjpitz
Copy link
Member

mjpitz commented Aug 5, 2020

The idea here would be to take the extraction logic from the indexer process and port it to the CLI as a dedicated command.

  1. walk the file system and create a match request using the file names
  2. call extractor.match
  3. using the returned matches, read the contents from disk and construct an extract requests
  4. call extractor.extract
  5. output the result to the command line
@mjpitz mjpitz changed the title Add command to walk local file system and extract dependency information Add extract command Aug 5, 2020
@kendallm kendallm self-assigned this Aug 5, 2020
@kendallm
Copy link
Collaborator

It seems like the extractor requires a repo url to extract dependencies.

Reading through the code for that though, it doesn't seem like the URL is actually used. Is there a reason why the repo URL is passed here?

With this functionality it seems like we wont have a repo URL as it will be run from a repo's root dir. Is it okay that the URL is not set or will that break something planned for the future?

@mjpitz
Copy link
Member Author

mjpitz commented Aug 16, 2020

The URL used to be / is used to infer a module name. I didn't persist this model in the v1beta model: https://github.com/depscloud/api/pull/70/files#diff-2d509e895e6903a5a290a5f41c6fba49R50-R53

@mjpitz
Copy link
Member Author

mjpitz commented Aug 17, 2020

You could pull the url from a .git/config file.

@mjpitz mjpitz transferred this issue from another repository Aug 22, 2020
@mjpitz mjpitz added effort: 1 good first issue Good for newcomers. help type: feature Brand new functionality, features, pages, workflows, endpoints, etc. effort: 2 and removed effort: 1 labels Aug 27, 2020
@mjpitz mjpitz changed the title Add extract command Add extract manifests command Sep 11, 2020
@kendallm kendallm removed their assignment Sep 30, 2020
@abitrolly
Copy link

I guess there is no way to make it a deps subcommand, because deps is written in Go and all extraction logic is in JavaScript https://github.com/depscloud/depscloud/tree/main/services/extractor

Still is there any way to extract dependencies standalone from command line?

@mjpitz
Copy link
Member Author

mjpitz commented Aug 25, 2021

The extraction logic is a gRPC service so calling it from Go should be doable. Most of the logic is already implemented in the indexer process. Here's the related block of code: https://github.com/depscloud/depscloud/blob/main/services/indexer/internal/consumer/consumer.go#L155-L192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: 2 good first issue Good for newcomers. help type: feature Brand new functionality, features, pages, workflows, endpoints, etc.
Projects
deps.cloud
  
In Progress
Development

No branches or pull requests

3 participants