Module: StillActive::GitlabClient
Constant Summary collapse
- BASE_URI =
URI("https://gitlab.com/")
Instance Method Summary collapse
-
#repo_signals(owner:, name:) ⇒ Object
archived + last-activity date from a single project call.
Instance Method Details
#repo_signals(owner:, name:) ⇒ Object
archived + last-activity date from a single project call. The project object’s last_activity_at matches the latest commit date to the day in practice, so folding the two signals into one call halves the per-gem requests. Returns {} when the project can’t be read.
16 17 18 19 20 21 22 23 24 |
# File 'lib/still_active/gitlab_client.rb', line 16 def repo_signals(owner:, name:) return {} if owner.nil? || name.nil? path = "/api/v4/projects/#{encode_project(owner, name)}" body = HttpHelper.get_json(BASE_URI, path, headers: auth_headers) return {} if body.nil? { archived: body["archived"] == true, last_commit_date: parse_time(body["last_activity_at"], owner, name) } end |