-
Notifications
You must be signed in to change notification settings - Fork 86
Assign task lists and archived during sync #1158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assign task lists and archived during sync #1158
Conversation
1ce82b0
to
53beb4d
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 -> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
The Issue Adapter has also lost coverage of the |
- 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
b6018ab
to
339d4e2
Compare
What's in this PR?
Closes #1153
Builds on top of #1157, so will have to be rebased once merged