Skip to content

feat: Tests/official support for Gitea#1007

Merged
jenkins-x-bot merged 4 commits into
jenkins-x:masterfrom
abayer:gitea
Dec 22, 2020
Merged

feat: Tests/official support for Gitea#1007
jenkins-x-bot merged 4 commits into
jenkins-x:masterfrom
abayer:gitea

Conversation

@abayer
Copy link
Copy Markdown
Contributor

@abayer abayer commented Sep 3, 2020

Yay! Gitea 1.13 finally released, so this is ready to go. =)

@jenkins-x-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign abayer
You can assign the PR to them by writing /assign @abayer in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 3, 2020

I'm using the tekton context for the moment.

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 3, 2020

Blech, there seems to be a problem with getting the token set properly in the Gitea client under the hood. Working on it.

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 4, 2020

/retest

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 4, 2020

So current situation is that it's not populating the OWNERS link from Needs approval from an approver in each of these files in the initial comment, and that means I have to wade into the hell of owners file parsing and such. yay. =)

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 4, 2020

OK! So the problem is that we have to have a hack to do the PullRequest.ListChanges function with Gitea, because they don't have an equivalent endpoint. So what I decided to do was get the .patch and parse that into the changes we need. Hoorah! Should work! But go-gitea/gitea#10923 - can't get the .diff or .patch with an api token, just via basic authentication. Except! go-gitea/gitea#11751 - it's fixed, now there are such endpoints...but they aren't released yet. We need to wait for 1.13.0. Baaaaah.

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 4, 2020

I hacked around it by using the latest pre-release image of gitea, but we aren't going to want to merge this until it's actually released. I also opened https://gitea.com/gitea/go-sdk/pulls/398 so we don't have to do hacks for ListChanges. Next up is figuring out why Keeper refuses to start...

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 4, 2020

yaaaaaay everything passed.

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 7, 2020

So this works - it's just waiting on Gitea 1.13.0 releasing for the .patch endpoint (so we can calculate the list of changed files in a PR). I'll keep it on WIP until then.

@eddycharly
Copy link
Copy Markdown

DeleteRef was not implemented for Gitea, the branchcleaner plugin does not work. I opened a PR (jenkins-x/go-scm#177)

@eddycharly
Copy link
Copy Markdown

@abayer any idea how to take care of the branch name when deleting a branch in the branchcleaner plugin ?

if err := spc.DeleteRef(pr.Base.Repo.Namespace, pr.Base.Repo.Name, fmt.Sprintf("heads/%s", pr.Head.Ref)); err != nil {

Adding the heads/ prefix does not work for gitea.

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 16, 2020

Hrm, I'll take a look. I'm actually kinda regretting using the Gitea Go SDK behind the scenes now because it doesn't work the way the other providers do re: pagination, so I may just rewrite everything today. =)

@eddycharly
Copy link
Copy Markdown

Yeah, in kloops i introduced an ScmTools interface to accommodate for these differences (https://github.com/eddycharly/kloops/blob/520d6dc1e92a1be8979e082c47ba908ebb31623a/pkg/scmprovider/tools.go#L22-L27).

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 16, 2020

Let's see how far I get with rewriting - if I don't get it done before Gitea 1.13 is released, we can special case like you're doing in kloops.

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 16, 2020

Ah-ha, the new version of gitea/go-sdk has http.Response (well, a wrapper around it, but...) returns now, so tada, jenkins-x/go-scm#180

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Sep 16, 2020

/test tekton

@hferentschik
Copy link
Copy Markdown
Contributor

@abayer what's the state on this one? I guess at the very least is seems to require a rebase.

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Oct 2, 2020

@hferentschik Waiting for gitea to release 1.13 for go-gitea/gitea#11751, which we’re currently using to construct the list of changed files in a PR.

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Oct 13, 2020

/test gitea

1 similar comment
@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Oct 13, 2020

/test gitea

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Oct 13, 2020

/retest

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Oct 13, 2020

/test gitea

@abayer abayer changed the title WIP: feat: Tests/official support for Gitea feat: Tests/official support for Gitea Dec 4, 2020
@abayer abayer requested a review from jstrachan December 4, 2020 14:27
@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Dec 4, 2020

/test gitea

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Dec 4, 2020

Well, blech, the Gitea chart is currently broken on k8s <1.19 - https://gitea.com/gitea/helm-chart/issues/77. And the chart isn't updated to 1.13.0 anyway. So I'll come back to this. =)

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Dec 8, 2020

/test gitea

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Dec 8, 2020

/retest

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Dec 10, 2020

/test gitea

1 similar comment
@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Dec 10, 2020

/test gitea

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Dec 22, 2020

/retest

@abayer
Copy link
Copy Markdown
Contributor Author

abayer commented Dec 22, 2020

/test gitea

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
@jenkins-x-bot jenkins-x-bot merged commit e148349 into jenkins-x:master Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants