gitlab

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

README

Gitlab

Supported

  • ACL (Access Control List) on project or group

  • /ok-to-test support from allowed users

  • /retest support.

  • /retest on a non owner mr from a owner will retest it but subsequent submissions would not be allowed. (only ok-to-test allows it)

  • OWNERS files

  • Report build status on MR if token has access of submitted source

  • Report pull request status via comments if no access

  • Get files via APIs

  • Webhook via api token attached to repo secret

  • Auto secret attached for git-clone support on private repo.

  • Private instance is supported, the private instance is not required to be specified in config since auto detect but if for whatever reason you want to set another api url you can do this on Repository :

    kind: Repository
    spec:
      url: https://apiurl/project/repo
      provider:
        url: https://apiurl
        secret:
          name: secret-ref
          key: token
    

TODO

Until there is a ask for it
  • /ok-to-test in threads comments (only top level comment is supported atm).
  • caching API calls for permissions.

NOTES

  • since orgs may have subpaths we switch the / to - so we can use it for the pac automatic secret and label. Sucks a bit but such is life

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	Client *gitlab.Client
	Logger *zap.SugaredLogger
	Token  *string
	// contains filtered or unexported fields
}

func (*Provider) CreateStatus

func (v *Provider) CreateStatus(_ context.Context, _ versioned.Interface, event *info.Event, pacOpts *info.PacOpts,
	statusOpts provider.StatusOpts,
) error

func (*Provider) Detect

func (v *Provider) Detect(req *http.Request, payload string, logger *zap.SugaredLogger) (bool, bool, *zap.SugaredLogger, string, error)

Detect processes event and detect if it is a gitlab event, whether to process or reject it returns (if is a GL event, whether to process or reject, logger with event metadata,, error if any occurred)

func (*Provider) GetCommitInfo

func (v *Provider) GetCommitInfo(_ context.Context, runevent *info.Event) error

func (*Provider) GetConfig

func (v *Provider) GetConfig() *info.ProviderConfig

func (*Provider) GetFileInsideRepo

func (v *Provider) GetFileInsideRepo(_ context.Context, runevent *info.Event, path, _ string) (string, error)

func (*Provider) GetFiles added in v0.12.0

func (v *Provider) GetFiles(ctx context.Context, runevent *info.Event) ([]string, error)

func (*Provider) GetTaskURI added in v0.13.0

func (v *Provider) GetTaskURI(ctx context.Context, params *params.Run, event *info.Event, uri string) (bool, string, error)

GetTaskURI TODO: Implement me

func (*Provider) GetTektonDir

func (v *Provider) GetTektonDir(_ context.Context, event *info.Event, path string) (string, error)

func (*Provider) IsAllowed

func (v *Provider) IsAllowed(ctx context.Context, event *info.Event) (bool, error)

func (*Provider) ParsePayload

func (v *Provider) ParsePayload(_ context.Context, _ *params.Run, request *http.Request,
	payload string,
) (*info.Event, error)

func (*Provider) SetClient

func (v *Provider) SetClient(_ context.Context, run *params.Run, runevent *info.Event) error

func (*Provider) SetLogger

func (v *Provider) SetLogger(logger *zap.SugaredLogger)

func (*Provider) Validate

func (v *Provider) Validate(_ context.Context, _ *params.Run, event *info.Event) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL