-
Notifications
You must be signed in to change notification settings - Fork 126
Conversation
This is great! Agreed that soon we should focus on common code across collaboration platforms (perhaps a |
Could you also add some docs on how to use it? Something like this https://github.com/NuKeeperDotNet/NuKeeper/pull/720/files#diff-32cb44efbeb7ab3bf9cf2edef28be295R69 Its just to show other people how it works. There is a |
The bitbucket explanation is probably a better startpoint: https://github.com/NuKeeperDotNet/NuKeeper/pull/724/files#diff-dce3466c4d63c7bf1684bbfa5a2e235f |
@MarcBruins Thanks for the startpoint! Following points are also finished:
so automatically forking from an existing repository also works from now on |
@MarcBruins |
The default is (or should be) |
when there is no nukeeper.settings.json-config file (which i has to create manuelly, by the way) or a nukeeper.settings.json-config without ForkMode defined, ForkMode might be null since its explicitly declared as a nullable type in FileSettings
In CollaborationFactory.ValidateSettings() ForkMode will be checked
However when a nukeeper.settings.json is available with ForkMode defined everything works as expected |
client.DefaultRequestHeaders.Accept.Add( | ||
new MediaTypeWithQualityHeaderValue("application/json")); | ||
|
||
HttpResponseMessage response = client.GetAsync($"swagger.v1.json").Result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please no .Result
. This will block the code untill it's complete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue here was CanRead() is no Task. So I had to go the sync way
Any recommandations how to solve this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the only way to know if it's a gitea server is to call the swagger api? There is no convention whatsoever that must be used? If not, i think we should have an extra parameter which specifies that it's the desired platform: --platform gitea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we discuss this approach earlier on gitter or somewhere else.. I don't want to make this a blocker, would be nice if we could add it but it doesn't have to be in this PR. I could be a new upforgrabs feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CanRead
- does only provide the repo-uri. Since gitea is most of the time self hosted, the repo uri looks like this
https://localhost:12345/{username}/{projectname}.git
So trying to get the json from https://yourgitea/swagger.v1.json (maybe even trying to validate this json, since there are gitea-version, etc stored) was somehow the safest way.
I think if nukeeper wants to support self hostet github or vsts services, this issue will appear again sooner or later.
a desired platform-parameter would solve this issue however
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the --platform
option already. See https://github.com/NuKeeperDotNet/NuKeeper/wiki/Configuration
As the docs say:
This is typicaly infered from the api url structure, but since this does not always work, it can be specified here if neccessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AnthonySteele so when using --platform
, the CanRead(uri) will be skipped
Can you make |
client.DefaultRequestHeaders.Accept.Add( | ||
new MediaTypeWithQualityHeaderValue("application/json")); | ||
|
||
HttpResponseMessage response = client.GetAsync($"swagger.v1.json").Result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the only way to know if it's a gitea server is to call the swagger api? There is no convention whatsoever that must be used? If not, i think we should have an extra parameter which specifies that it's the desired platform: --platform gitea
client.DefaultRequestHeaders.Accept.Add( | ||
new MediaTypeWithQualityHeaderValue("application/json")); | ||
|
||
HttpResponseMessage response = client.GetAsync($"swagger.v1.json").Result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we discuss this approach earlier on gitter or somewhere else.. I don't want to make this a blocker, would be nice if we could add it but it doesn't have to be in this PR. I could be a new upforgrabs feature.
I think I'll create an additioanl issue for this |
Started to work on Gitea(issue #710 ) support for NuKeeper based on https://try.gitea.io/api/swagger# and https://docs.gitea.io/en-us/
What's already there:
Implementation of settings reader + some tiny unit tests
Basic implementation of gitea rest client and token authentication including:
At the end a lot of code in the restclient is similar to GitHub/Gitlab. Maybe a common base class would remove this redundant code.
TODO:
GiteaPlattform.GetRepositoriesForOrganisation (and REST)Enhance GiteaRepositoryDiscovery.GetRepositories for ServerScope.Global and ServerScope.OrganisationGiteaForkFinder implement other functionality than ForkMode.SingleRepositoryOnlyUnit tests