I realized it won't take much work to prepare a dedicated endpoint for setting a GitHub repository for a project. This will make the overall implementation more solid.
I have added a dedicated endpoint to serve this purpose:
/projects/{id}/github-repository (singular, as you can only set one repository)
The service calls a GitHub client that verifies your access to the specified GitHub repository (and that the repository actually exists). This is another step towards the GitHub refactoring.
The final step will be to create a separate table for GitHub repositories. For now, I have added the fields to the project service model.
I have also kept the current project.GithubRepositoryURL field. I will remove it in a subsequent PR once this one is merged to keep the PR size manageable.
The flow is as follows:
You create your project (without entering github repo url); the transport project model does not contain the GitHub repository URL.
You have a dedicated endpoint for setting the connection to the GitHub repository.
I have implemented only the POST endpoint. If you agree with the implementation, I will also add the GET endpoint.
Once this PR is merged, I will also update github client functions (such as reading git tags, creating github release etc.) to accept svcmodel.GithubRepo instead of repoURL.
I realized it won't take much work to prepare a dedicated endpoint for setting a GitHub repository for a project. This will make the overall implementation more solid.
I have added a dedicated endpoint to serve this purpose:
/projects/{id}/github-repository
(singular, as you can only set one repository)The service calls a GitHub client that verifies your access to the specified GitHub repository (and that the repository actually exists). This is another step towards the GitHub refactoring.
The final step will be to create a separate table for GitHub repositories. For now, I have added the fields to the project service model.
I have also kept the current
project.GithubRepositoryURL
field. I will remove it in a subsequent PR once this one is merged to keep the PR size manageable.The flow is as follows:
Once this PR is merged, I will also update github client functions (such as reading git tags, creating github release etc.) to accept
svcmodel.GithubRepo
instead of repoURL.If you approve, I wll also add tests.