Gullintanni v0.1.0 Gullintanni.MergeRequest

Defines a merge request.

Summary

Types

A merge request identifier

A 40 character SHA-1 hash

Supported merge request states

t()

Types

id()
id() :: pos_integer

A merge request identifier

sha()
sha() :: String.t

A 40 character SHA-1 hash

state()
state ::
  :under_review |
  :approved |
  :build_pending |
  :build_passed |
  :build_failed |
  :error

Supported merge request states

t()
t() :: %Gullintanni.MergeRequest{approved_by: %{optional(String.t) => NaiveDateTime.t}, branch_name: String.t, clone_url: String.t, id: id, latest_commit: sha, state: state, target_branch: String.t, title: String.t, url: String.t}

Functions

approve(mreq, username, timestamp)
approve(t, String.t, NaiveDateTime.t) :: t
approved_at(mreq)
approved_at(t) :: NaiveDateTime.t
build_error(mreq)
build_failed(mreq)
build_passed(mreq)
ffwd_failed(mreq)
merge_failed(mreq)
merge_passed(mreq)
new(id, opts \\ [])
new(id, Keyword.t) :: t

Creates a new merge request with the given id.

Options

The accepted options are:

  • :title - the title of the merge request
  • :url - the URL for viewing the merge request discussion
  • :clone_url - the URL for Git to use when cloning the merge request
  • :branch_name - the Git branch name of the merge request
  • :target_branch - the name of the Git branch that the merge request is targeting
  • :latest_commit - the SHA-1 hash of the latest commit on the merge request
  • :approved_by - the users that have approved the merge request
  • :state - the state of the merge request; valid states are defined by state/0
reset(mreq)
unapprove(mreq, username)
update_sha(mreq, sha)
update_sha(t, sha) :: t

Replaces the latest commit on the merge request with sha.

This will reset the state back to “under review” as well, canceling any existing approvals.