Get repository content with sbt - scala

I guess, the following is a basic question. However, I have failed to google it.
There is an URL list of repositories in the file .sbt\repositories. Is there a common approach to explore these repos, to get list of libraries in them.

Related

Fetch dependencies from a project in Github using CLI

I would like to know -
Are there any commands for GitHub, allowing me to fetch the dependencies of a project in github?
At Github, under 'Insights' tab, I may look for the dependencies, by pressing the 'Dependencies Graph' button, and that displays all the dependencies for this project.
My qustion is -
Can I write a scrypt, to fetch these dependencies?
I tried to navigate in postam and make a GET request to the url
'https://github.com/-User-/-Project-/network/dependencies'
and I recive an 404 response.
But when I put the same url in chrome, I can see the Dependencies Graph for that project.
You can’t. There are now API calls available for this information at the moment. I’ve been wanting to get that information myself as well 😕.

SageMaker MLOps Project Using Third-party Git Repos - Error in building

I'm doing some tutorials using the MLOps templates, to create a Sagemaker Project to build, train and deploy with third-party Git repositories using CodePipeline. Following this documentation: https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-projects-walkthrough-3rdgit.html#sagemaker-proejcts-walkthrough-create-3rdgit.
I have created the connection in CodeCommit settings, and selected my two repositories created in Github, one for modelbuild and one for modeldeploy. When creating the project, I put the urls from github, the name of the repos (in my case, it is organization/modelbuild-repo) and I use the arn of the connection.
However, in the building process, in the seedcodecheckin, I get the following errors:
[GitRepositorySeedCodeBootStrapper.main()] ERROR GitRepositorySeedCodeBootStrapper - Seedcode checkin failed: Invalid remote: origin
I also get the following exceptions:
Caused by: org.eclipse.jgit.errors.NoRemoteRepositoryException: https://codestar-connections.eu-west-1.amazonaws.com/git-http/XXXXXXXXXXX/eu-west-1/ff5bf7e3-bee9-4dad-a63d-0374c4a96297/ORGANIZATION/sagemaker-tutorial-3-modelbuild.git: https://codestar-connections.eu-west-1.amazonaws.com/git-http/XXXXXXXXXXX/eu-west-1/ff5bf7e3-bee9-4dad-a63d-0374c4a96297/ORGANIZATION/sagemaker-tutorial-3-modelbuild.git/info/refs?service=git-upload-pack not found: Not Found
These errors are from the build logs from git-seedcodecheckin.
Which I believe it has to do with trying to populate the repository with the modelbuild code.
Anyone has an idea what might be the error?
I have seen similar questions to this, related to policies and the need for them, but I beleive I have the correct ones attached.
It looks like the repository either does not exist or you are not passing in the right name.
You can follow the guidelines in this blog - https://aws.amazon.com/blogs/machine-learning/create-amazon-sagemaker-projects-using-third-party-source-control-and-jenkins/

what is the best way to get list of NPM packages from GitHub Repositories

I would like to list all NPM packages available in a repository on GitHub and use code parsing to get just needed information of the packages using PowerShell.
How do I identify these packages?. if they are in packages.json file, there seems to be many of the "packages.json" file name in some repos.
You can see multiple package.json files are part of nested dependencies, as seen here.
If you somehow had to see those dependencies (direct and indirect) as one package.json, that is what json-merge or package-merge are for.

Downloading TeamCity artifact dependencies using REST

We've got a TeamCity (9.1) build configuration which is based on several snapshot dependencies to build correctly. I'm looking for a convenient way to provide each developer with a way to set up a proper build environment on their desktops. For this, I would like to download all the snapshot dependencies for a given build configuration from the TeamCity server onto the developer's desktop using the REST api.
I'm aware of how to access artifacts using REST. But this would address the artifacts created by a specific build configuration. I'm looking for a way to download all artifacts used by a given configuration specified by the dependencies.
There isn't an easy way to do this, however, it's not impossible. My answer is provided below followed by a possible alternate solution.
Answer:
The artifacts used by your target build are really just the artifacts that were created by its dependencies right?
I think what you are looking for is referenced here where you can query a build for all of its Snapshot Dependencies.
Once you have a list of the dependencies you would then need to query each of them for the artifacts they generated and then you could proceed to download them.
It's not the most straightforward thing and would require some slick Powershell or Python or whatever, but it is doable.
Another Idea:
Have you looked into something like Artifactory? It sounds like what you really need is a binary repository of sorts to track artifacts used, and artifacts created.
Or for small projects, you could probably get a way with just using a file share on the network where the build could "copy" to the share organizing files into "build" directories of some sort and then developers could "read" from the share.

Can sbt be used to access a none-scala github repo to read into a scala project?

I'm dealing with two repos:
- A github repo that contains a bunch of text files.
- A scala project that would like to read those text files.
I would like to use SBT to download the contents of the github repo as a build dependency.
I wouldn't mind if SBT supplied either a path (into the ivy repo?) for the project to use or build them into the projects available resources - or any other way that will just work. I'm aiming for something automatic; clearly there are ways I could do this manually.
If you talk about a bunch of text files like *.property for example that used as dependency for your project (do you really want download them every time?) you may use sbt.IO.download(url: URL, to: File). Just create task and add to project definition compile <<= (compile in Compile) dependsOn myDownloadTask After that you may process them as regular local files ;-).
IMHO you understand that you may add custom logic like caching or page parsing or REST request to GitHub to your project definition. At last you may create your own SBT plugin - there are few video tutorials "How to create SBT plugin in 5 minutes" on YouTube.