eclipse-researchlabs / scava

Eclipse Public License 2.0
7 stars 1 forks source link

Create project form to validate git URL #51

Open davidediruscio opened 4 years ago

davidediruscio 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.

davidediruscio 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.

davidediruscio 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