crossminer / scava

https://eclipse.org/scava/
Eclipse Public License 2.0
18 stars 13 forks source link

Create project form to validate git URL #358

Open mhow2 opened 4 years ago

mhow2 commented 4 years ago

Please @aabherve , @ambpro . I has discussed this with @creat89 : being a regular git repo URL or github's wiki documentation URL, the system should check if the remote URL is valid. By valid, I mean it should check it is the repo is available and is accessible. All of this before leaving the user starting the project tasks and let him search what is the problem while the task is progressing with no warning at all in the UI.

creat89 commented 4 years ago

I'll check the code in the model and try to propose a solution for checking whether the URL correspond to a valid git.

creat89 commented 4 years ago

Would something like this in GitRepository.java would work?

    @Override
    public VcsRepository setUrl(String url) {
        try
        {
            Git.lsRemoteRepository().setRemote(url).call();
        } catch (GitAPIException e) {
            return null;
        }
        return super.setUrl(url);
    }

However, I don't know what to return to prevent the addition of the project in MongoDB