Skip to content

Put synced GitHub issues into the correct TaskList or archive it #1153

@joshsmith

Description

@joshsmith

Problem

We need to modify the GitHub sync so that when we create or update the Task we:

  • associate tasks without pull requests and with status: "open" in the TaskList where inbox: true
  • associate tasks with pull requests and with status: "open" in the TaskList where pull_requests: true
  • associate task with status: "closed" in the TaskList where done: true and modified_at < 30 days
  • archive task with status: "closed" where done: true and modified_at >= 30 days, and nullify any association with a TaskList

In order to do this, we'll probably want to modify the GitHub.Sync.Issue.Task.Changeset to:

  • See if there is a GithubPullRequest for the given GithubIssue
  • Move the TaskList |> Repo.get_by logic into a separate function that takes the changeset and the GithubIssue and determines the right logic per the above
  • Pattern match against the status and modified_at timestamps in order to either set the archived field or set the task_list_id association

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions