MCPcopy Index your code
hub / github.com/git-bug/git-bug / Init

Method Init

bridge/gitlab/import.go:29–52  ·  view source on GitHub ↗
(_ context.Context, repo *cache.RepoCache, conf core.Configuration)

Source from the content-addressed store, hash-verified

27}
28
29func (gi *gitlabImporter) Init(_ context.Context, repo *cache.RepoCache, conf core.Configuration) error {
30 gi.conf = conf
31
32 creds, err := auth.List(repo,
33 auth.WithTarget(target),
34 auth.WithKind(auth.KindToken),
35 auth.WithMeta(auth.MetaKeyBaseURL, conf[confKeyGitlabBaseUrl]),
36 auth.WithMeta(auth.MetaKeyLogin, conf[confKeyDefaultLogin]),
37 )
38 if err != nil {
39 return err
40 }
41
42 if len(creds) == 0 {
43 return ErrMissingIdentityToken
44 }
45
46 gi.client, err = buildClient(conf[confKeyGitlabBaseUrl], creds[0].(*auth.Token))
47 if err != nil {
48 return err
49 }
50
51 return nil
52}
53
54// ImportAll iterate over all the configured repository issues (notes) and ensure the creation
55// of the missing issues / comments / label events / title changes ...

Callers 2

TestGitlabImportFunction · 0.95
TestGitlabPushPullFunction · 0.95

Calls 5

ListFunction · 0.92
WithTargetFunction · 0.92
WithKindFunction · 0.92
WithMetaFunction · 0.92
buildClientFunction · 0.70

Tested by 2

TestGitlabImportFunction · 0.76
TestGitlabPushPullFunction · 0.76