code_corps v0.0.1 CodeCorps.GitHub.Sync.Comment View Source

In charge of syncing CodeCorps.Comment records with a GitHub comment payload.

A single GitHub comment always matches a single CodeCorps.GithubComment, but it can match multiple CodeCorps.Comment records. This module handles creating or updating all those records.

Link to this section Summary

Functions

Deletes CodeCorps.Comment records associated to CodeCorps.GithubComment with specified github_id

Creates or updates a CodeCorps.Comment for the specified CodeCorps.Task

Creates or updates CodeCorps.Comment records for the specified CodeCorps.GithubRepo

Link to this section Types

Link to this section Functions

Link to this function delete(github_id) View Source
delete(String.t()) :: {:ok, [CodeCorps.Comment.t()]}

Deletes CodeCorps.Comment records associated to CodeCorps.GithubComment with specified github_id

Since there can be 0 or 1 such records, returns {:ok, results} where results is a 1-element or blank list of deleted records.

Creates or updates a CodeCorps.Comment for the specified CodeCorps.Task.

When provided a CodeCorps.Task, a CodeCorps.GithubComment, a CodeCorps.User, and a GitHub API payload, it creates or updates a CodeCorps.Comment record, using the provided GitHub API payload, associated to the specified CodeCorps.GithubComment, CodeCorps.Task and CodeCorps.User

Link to this function sync_github_repo(github_repo) View Source

Creates or updates CodeCorps.Comment records for the specified CodeCorps.GithubRepo.

For each CodeCorps.GithubComment record that relates to the CodeCorps.GithubRepo for a given CodeCorps.GithubRepo: