Module: SentryApi::Client::Releases

Included in:
SentryApi::Client
Defined in:
lib/sentry-api/client/releases.rb

Instance Method Summary collapse

Instance Method Details

#create_release(project_slug, options = {}) ⇒ SentryApi::ObjectifiedHash

Create a new release for the given project. Releases are used by Sentry to improve it’s error reporting abilities by correlating first seen events with the release that might have introduced the problem.

Examples:

SentryApi.create_release('project-slug',{version:'1.0', ref:'6ba09a7c53235ee8a8fa5ee4c1ca8ca886e7fdbb'})

Options Hash (options):

  • :version (String)

    a version identifier for this release. Can be a version number, a commit hash etc.

  • :ref (String)

    an optional commit reference. This is useful if a tagged version has been provided.

  • :url (String)

    a URL that points to the release. This can be the path to an online interface to the sourcecode for instance.

  • :dateStarted (Timestamp)

    an optional date that indicates when the release process started.

  • :dateReleased (Timestamp)

    an optional date that indicates when the release went live. If not provided the current time is assumed.



19
20
21
# File 'lib/sentry-api/client/releases.rb', line 19

def create_release(project_slug, options={})
  post("/projects/#{@default_org_slug}/#{project_slug}/releases/", body: options)
end

#delete_release(project_slug, version) ⇒ Object

Permanently remove a release and all of its files.

Examples:

SentryApi.delete_release('project-slug','1.0')


30
31
32
# File 'lib/sentry-api/client/releases.rb', line 30

def delete_release(project_slug, version)
  delete("/projects/#{@default_org_slug}/#{project_slug}/releases/#{version}/")
end

#release(project_slug, version) ⇒ SentryApi::ObjectifiedHash

Retrieve a Release

Examples:

SentryApi.release('project-slug','1.0')


53
54
55
# File 'lib/sentry-api/client/releases.rb', line 53

def release(project_slug, version)
  get("/projects/#{@default_org_slug}/#{project_slug}/releases/#{version}/")
end

#releases(project_slug) ⇒ Array<SentryApi::ObjectifiedHash>

List a Project’s Releases

Examples:

SentryApi.releases('project-slug')


41
42
43
# File 'lib/sentry-api/client/releases.rb', line 41

def releases(project_slug)
  get("/projects/#{@default_org_slug}/#{project_slug}/releases/")
end

#update_release(project_slug, version, options = {}) ⇒ SentryApi::ObjectifiedHash

Update a Release

Examples:

SentryApi.update('project-slug', {ref:'6ba09a7c53235ee8a8fa5ee4c1ca8ca886e7fdbb'})

Options Hash (options):

  • :ref (String)

    an optional commit reference. This is useful if a tagged version has been provided.

  • :url (String)

    a URL that points to the release. This can be the path to an online interface to the sourcecode for instance.

  • :dateStarted (Timestamp)

    an optional date that indicates when the release process started.

  • :dateReleased (Timestamp)

    an optional date that indicates when the release went live. If not provided the current time is assumed.



69
70
71
# File 'lib/sentry-api/client/releases.rb', line 69

def update_release(project_slug, version, options={})
  put("/projects/#{@default_org_slug}/#{project_slug}/releases/#{version}/", body: options)
end