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
Problem
We need to modify the GitHub sync so that when we create or update the
Taskwe:status: "open"in theTaskListwhereinbox: truestatus: "open"in theTaskListwherepull_requests: truestatus: "closed"in theTaskListwheredone: trueandmodified_at < 30 daysstatus: "closed"wheredone: trueandmodified_at >= 30 days, and nullify any association with aTaskListIn order to do this, we'll probably want to modify the
GitHub.Sync.Issue.Task.Changesetto:GithubPullRequestfor the givenGithubIssueTaskList |> Repo.get_bylogic into a separate function that takes the changeset and theGithubIssueand determines the right logic per the abovestatusandmodified_attimestamps in order to either set thearchivedfield or set thetask_list_idassociation