Skip to content

Conversation

begedin
Copy link
Contributor

@begedin begedin commented Nov 6, 2017

What's in this PR?

Closes #1153

Builds on top of #1157, so will have to be rebased once merged

@joshsmith joshsmith force-pushed the 1053-assign-task-lists-and-archived-during-sync branch from 1ce82b0 to 53beb4d Compare November 6, 2017 19:32
Copy link
Contributor

@joshsmith joshsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a migration that will take all the existing Tasks > 30 days and archive them.

end
defp get_task_list(project_id, :pull_requests) do
TaskList |> Repo.get_by(project_id: project_id, pull_requests: true)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be possible to reverse the project_id and atom here so that you could chain above:

%TaskList{id: task_list_id} =
  github_issue
  |> get_task_list_type()
  |> get_task_list(project_id)

status = changeset |> Changeset.get_field(:status)

case {status, Timex.now |> Timex.diff(modified_at, :days)} do
{"closed", x} when x > 30 ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would make x more verbose and descriptive here.

@doc """
When provided a `CodeCorps.GithubIssue`, a `CodeCorps.User` and a GitHub API
payload, for each `CodeCorps.Project` associated to that
`CodeCorps.GithubRepo` via a `CodeCorps.ProjectGithubRepo`, it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This @doc needs to change to remove the mention of the payload.

@joshsmith
Copy link
Contributor

The Issue Adapter has also lost coverage of the to_issue_attrs fn.

@joshsmith joshsmith self-assigned this Nov 6, 2017
- Associate task with proper task list when syncing from github
- Add archiving of task during github sync
- Ditch usage of issue attrs from Sync.Issue.Task.Changeset.build_changeset
- Remove unused adapter clause
- Unset task list if archived
- Add migration to archive outdated tasks
- Add testing of column sync to acceptance test
@joshsmith joshsmith force-pushed the 1053-assign-task-lists-and-archived-during-sync branch from b6018ab to 339d4e2 Compare November 6, 2017 20:19
@joshsmith joshsmith merged commit 0e6eb76 into develop Nov 6, 2017
@joshsmith joshsmith deleted the 1053-assign-task-lists-and-archived-during-sync branch November 6, 2017 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants