sociomantic-tsunami / neptune

Sociomantic library versioning definitions, guides, and tools
Boost Software License 1.0
1 stars 15 forks source link

Add GitLab support #217

Closed leandro-lucarella-sociomantic closed 5 years ago

leandro-lucarella-sociomantic commented 6 years ago

We are probably going to migrate to GitLab in the short/mid-term, so we need to prepare neptune to work with both GitHub and GitLab to support a smooth migration.

Requirements

mathias-baumann-sociomantic commented 5 years ago

Fixed in https://github.com/sociomantic-tsunami/neptune/pull/237

leandro-lucarella-sociomantic commented 5 years ago

@mihails-strasuns turtle is already in gitlab, right? can you test this with a turtle release? If a final release is not close, maybe we can make an alpha release.

leandro-lucarella-sociomantic commented 5 years ago

It seems it was dmd-transitional, but maybe we can try moving turtle and enabling the gitlab mirror feature so people using the github URLs can still get updates?

mihails-strasuns-sociomantic commented 5 years ago

There are no changes in turtle since last release at all but I can tag a dummy one.

mihails-strasuns-sociomantic commented 5 years ago

Not working at all for me:

https://gitlab.com/sociomantic-test/turtle

mathias-baumann-sociomantic commented 5 years ago

I'll look into it

mathias-baumann-sociomantic commented 5 years ago

What is the permission you gave the personal access token? Not sure what you mean with API version.. where would what how be specified and why? What config value did you set exactly? neptune.gitlab-oauthtoken?

mihails-strasuns-sociomantic commented 5 years ago

Not sure what you mean with API version.. where would what how be specified and why?

GET /projects/:id/repository/tags vs GET /api/v4/projects/:id/repository/tags

Nevermind, I got confused by neptune log output. It says that it is going to request the former, but in fact connection internally augments it to be the latter.

What is the permission you gave the personal access token?

API. Is anything else needed? Ideally neptune should be capable of creating token itself, same like git-hub does.

mihails-strasuns-sociomantic commented 5 years ago

What config value did you set exactly? neptune.gitlab-oauthtoken?

Yup

mathias-baumann-sociomantic commented 5 years ago

I believe neptune-release wrongly guessed the target platform and defaulted to GH instead. Investigating

mathias-baumann-sociomantic commented 5 years ago

Actually, what did it say at the beginning? Can you show me the output?

mihails-strasuns commented 5 years ago
$ ~/sociomantic/neptune/build/dub/bin/neptune-release 
Detected platform Gitlab
 Requesting: /projects/sociomantic-test%2Fturtle/repository/tags
provider.core.HTTPAPIException@src/provider/core.d(503): Expected status code 2xx, got 401

HTTP/1.1 401 Unauthorized

But! I tried again, regenerating token with access to everything and it worked this time :X

mihails-strasuns commented 5 years ago

Better attempt:

$ ~/sociomantic/neptune/build/dub/bin/neptune-release 
Detected platform Gitlab
 Requesting: /projects/sociomantic-test%2Fturtle/repository/tags
We are on branch v9.1.x
Detected release v9.1.4
Warning: No corresponding milestone found for v9.1.4
List of ignored non-semver branches: []
Actions to be done:
 * Creating annotated tag v9.1.4 (git tag --cleanup=verbatim -F- v9.1.4 v9.1.x)
 * Checkout v9.x.x locally (git checkout v9.x.x)
 * Merge v9.1.4 into v9.x.x (git merge --no-ff -m Merge tag v9.1.4 into v9.x.x v9.1.4)
 * Checkout original branch v9.1.x (git checkout v9.1.x)

Would you like to continue? y/n: y

Creating annotated tag v9.1.4 ...
    git tag --cleanup=verbatim -F- v9.1.4 v9.1.x

Checkout v9.x.x locally ...
    git checkout v9.x.x
    Switched to branch 'v9.x.x'
Your branch is up to date with 'upstream/v9.x.x'.
Merge v9.1.4 into v9.x.x ...
    git merge --no-ff -m Merge tag v9.1.4 into v9.x.x v9.1.4
    Already up to date.
Checkout original branch v9.1.x ...
    git checkout v9.1.x
    Switched to branch 'v9.1.x'
Done! Some references should be pushed: ["v9.1.4", "v9.x.x"]
Would you like to push the modified references now? y/n: y
Some tags on github should be released: [v9.1.4]
Would you like to release those tags now? y/n: y
failed: Requested non-existent API URL
retrying ...
failed: Requested non-existent API URL
retrying ...
failed: Requested non-existent API URL
retrying ...
failed: Requested non-existent API URL
retrying ...
failed: Requested non-existent API URL
retrying ...
failed: Requested non-existent API URL
retrying ...
failed: Requested non-existent API URL
retrying ...
failed: Requested non-existent API URL
retrying ...
failed: Requested non-existent API URL
retrying ...
failed: Requested non-existent API URL
Giving up after 10 attempts
provider.core.HTTPAPIException@src/provider/core.d(498): Requested non-existent API URL
----------------
src/provider/core.d:58 immutable(char)[] provider.core.HTTPConnection.handleResponseStatus(scope vibe.http.client.HTTPClientResponse) [0x35e63085]
src/provider/core.d:238 vibe.data.json.Json provider.core.HTTPConnection.get(immutable(char)[], provider.media.MediaType) [0x35e61e60]
src/provider/core.d:292 vibe.data.json.Json provider.core.HTTPConnection.get(immutable(char)[], immutable(char)[]) [0x35e623a2]
src/provider/api/issues.d:154 provider.api.issues.Issue[] provider.api.issues.listIssues(ref provider.core.HTTPConnection, immutable(char)[], provider.api.issues.IssueState) [0x35e5d9e7]
src/release/main.d:1183 void release.main.getIssues(ref provider.core.HTTPConnection, immutable(char)[], immutable(char)[]).__lambda4() [0x35dbf07a]
src/internal/shell/helper.d:345 void internal.shell.helper.keepTrying(void delegate(), int, core.time.Duration, std.typecons.Nullable!(std.stdio.File).Nullable, std.typecons.Nullable!(std.stdio.File).Nullable) [0x35e28f0f]
src/internal/shell/helper.d:305 void internal.shell.helper.keepTrying(void delegate(), int, core.time.Duration) [0x35e28dee]
src/release/main.d:1181 provider.api.issues.Issue[] release.main.getIssues(ref provider.core.HTTPConnection, immutable(char)[], immutable(char)[]) [0x35dbefe7]
src/release/main.d:175 _Dmain [0x35dbbe3e]
mihails-strasuns commented 5 years ago

Managed to create https://gitlab.com/sociomantic-test/turtle/tags/v9.1.4 at least

mathias-baumann-sociomantic commented 5 years ago

Ah, my problem was that I didn't test a patch release.