FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Initial Gitea bridge. by MichaelMure · Pull Request #890 · git-bug/git-bug · GitHub

Initial Gitea bridge. - #890

Closed
MichaelMure wants to merge 1 commit into
masterfrom
gitea-bridge
Closed

Initial Gitea bridge.#890
MichaelMure wants to merge 1 commit into
masterfrom
gitea-bridge

Conversation

Copy link
Copy Markdown
Contributor

I rescued #675 of which the original repo has been deleted. Even though @tianyuanhao seems to not work on it anymore (apologize if that's not the case, you are of course welcome here), it seems that the configuration part and the importer are relatively complete.

@6543 @Vitali64 @bqv @gc-ss As you seemed interested, could you all give it a test drive and report on your findings? I don't and have never used gitea, but maybe together we can push that far enough.

This a just a preview. Not all features are expected to work.

Ppjet6 commented Oct 22, 2022

Copy link
Copy Markdown

I'm new to git-bug, I was mostly interested in the gitea bridge. I don't know if I'm using it wrong, but here is what I get when I do git bug bridge pull mybridge, after having configured it.

panic: runtime error: index out of range [-1]

goroutine 35 [running]:
github.com/MichaelMure/git-bug/bridge/gitea/iterator.(*issueIterator).Value(...)
        github.com/MichaelMure/git-bug/bridge/gitea/iterator/issue.go:39
github.com/MichaelMure/git-bug/bridge/gitea/iterator.(*Iterator).NextIssue(0xc0000b8120)
        github.com/MichaelMure/git-bug/bridge/gitea/iterator/iterator.go:90 +0x205
github.com/MichaelMure/git-bug/bridge/gitea.(*giteaImporter).ImportAll.func1()
        github.com/MichaelMure/git-bug/bridge/gitea/import.go:70 +0x92
created by github.com/MichaelMure/git-bug/bridge/gitea.(*giteaImporter).ImportAll
        github.com/MichaelMure/git-bug/bridge/gitea/import.go:66 +0x20a

git bug bridge auth correctly lists the gitea entry:

% git bug bridge auth
someid gitea-pre… token sometoken base-url:https://gitea.example,login:foo

go version go1.19.2 linux/amd64 on Archlinux.

I have added a single issue locally. This tracker doesn't have any issues yet. From a quick look this may be the issue?

Ppjet6 commented Oct 22, 2022

Copy link
Copy Markdown

I'm quite excited for this feature. It looks like the "only" big piece remaining is the export feature?

Copy link
Copy Markdown
Contributor Author

Looking at the code, it looks like something like that would fix that crash?

diff --git a/bridge/gitea/iterator/iterator.go b/bridge/gitea/iterator/iterator.go
index e3c701fa..9feef72b 100644
--- a/bridge/gitea/iterator/iterator.go
+++ b/bridge/gitea/iterator/iterator.go
@@ -85,12 +85,16 @@ func (i *Iterator) NextIssue() bool {
                return false
        }
 
+       if !more {
+               return false
+       }
+
        // Also reset the other sub iterators as they would
        // no longer be valid
        i.comment.Reset(i.issue.Value().Index)
        i.label.Reset(i.issue.Value().Index)
 
-       return more
+       return true
 }

I am not able to test though.

I'm quite excited for this feature. It looks like the "only" big piece remaining is the export feature?

That's correct. Would you like to take over?

Ppjet6 commented Oct 22, 2022

Copy link
Copy Markdown

The patch fixes it, thanks!

Would you like to take over?

I'm sorry, go isn't really my cup of tea, but most of all I already have my share of projects, I don't really have much time to put in new projects anymore. I may be able to test some things occasionally.

DarthRubik mentioned this pull request Feb 4, 2023

Copy link
Copy Markdown
Contributor Author

Closing in favor of #1017

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL