Skip to content
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

Version 2.0.0 #45

Merged
merged 37 commits into from
Jan 26, 2025
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
aa3b963
New application design
walter-juan Jan 11, 2025
b73d3df
New application design
walter-juan Jan 23, 2025
9889213
Clean up mark as seen code
walter-juan Jan 23, 2025
9b72796
New application design
walter-juan Jan 23, 2025
44db6d5
Update dependencies
walter-juan Jan 23, 2025
ba8eaa6
Save the selected pull request filters
walter-juan Jan 23, 2025
59c1b7f
Add missing debug icons
walter-juan Jan 23, 2025
7a8fb0d
New application design
walter-juan Jan 23, 2025
fe1f5d3
Remove dependency updates action
walter-juan Jan 24, 2025
9bd2401
Update runs
walter-juan Jan 23, 2025
ba7be28
New application design
walter-juan Jan 24, 2025
83b92b2
Clean up mark as seen code
walter-juan Jan 24, 2025
8833959
[skip ci] Add Koin
walter-juan Jan 24, 2025
0335458
[skip ci] Fix RepoToCheckEditViewModel and add search
walter-juan Jan 24, 2025
a501081
[skip ci] Add button to open the repo website
walter-juan Jan 24, 2025
cdcbd60
[skip ci] Add button to open the repo website
walter-juan Jan 24, 2025
ab81f66
[skip ci] store filters for repos and releases
walter-juan Jan 24, 2025
7b40590
[skip ci] set random color for group name
walter-juan Jan 25, 2025
c1c7a2d
Add remove all
walter-juan Jan 25, 2025
a2a3ce1
Delete repository confirmation
walter-juan Jan 25, 2025
872c781
Delete repository confirmation
walter-juan Jan 25, 2025
3fc1139
Remove login screen
walter-juan Jan 25, 2025
ab122c0
Changelog
walter-juan Jan 25, 2025
2790862
remove loading from pull requests, releases and repos
walter-juan Jan 25, 2025
b8b86ed
reoder
walter-juan Jan 25, 2025
5fc60ce
single line and request focus on text fields
walter-juan Jan 25, 2025
06f069e
[skip ci] icon and warnings
walter-juan Jan 26, 2025
81a2b1d
Remove MaterialColors class
walter-juan Jan 26, 2025
8300610
Add Detekt with formatting and change configs for Compose
walter-juan Jan 26, 2025
af04544
changelog
walter-juan Jan 26, 2025
5c48d98
[skip ci] fix some warnings
walter-juan Jan 26, 2025
7b0d436
[skip ci] Update readme
walter-juan Jan 26, 2025
ee9d5ea
[skip ci] change default synchronization interval from 1 to 5 minutes
walter-juan Jan 26, 2025
2072647
[skip ci] update readme
walter-juan Jan 26, 2025
e8381d7
Changelog
walter-juan Jan 26, 2025
6765d0d
Add Detekt baseline
walter-juan Jan 26, 2025
aabba50
Detekt config
walter-juan Jan 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up mark as seen code
  • Loading branch information
walter-juan committed Jan 24, 2025
commit 83b92b2f78e7c3b22a76b766560be787c63e2175
Original file line number Diff line number Diff line change
@@ -37,10 +37,6 @@ class PullRequestService(
}

override suspend fun synchronize(syncResultId: Long, syncSettings: SyncSettings, repoToCheckList: List<RepoToCheck>): List<SyncResultEntry> {
return newSync(syncResultId, syncSettings, repoToCheckList)
}

suspend fun newSync(syncResultId: Long, syncSettings: SyncSettings, repoToCheckList: List<RepoToCheck>): List<SyncResultEntry> {
AppLogger.d("Synchronizer :: sync :: pulls :: start")
val prSyncStartAt = Clock.System.now()
val pullRequestsBefore = getAll().getOrDefault(listOf())
@@ -69,32 +65,24 @@ class PullRequestService(
)
}
// update the local pull requests
val pullRequests = apiResponseResults.mapNotNull { (repoToCheck, _, apiResponseResult) ->
val apiResponse = apiResponseResult.getOrNull()
val apiPullRequests = apiResponse?.data ?: listOf()
if (apiPullRequests.isEmpty()) {
null
} else {
val pullRequests = apiPullRequests.map { apiPullRequest ->
val pullRequestsWithRepos = apiResponseResults
.map { (repoToCheck, _, apiResponseResult) ->
val apiPullRequests = apiResponseResult.getOrNull()?.data ?: listOf()
apiPullRequests.map { apiPullRequest ->
apiPullRequest.toPullRequest(repoToCheck = repoToCheck)
}
pullRequests
}
}

val validPullRequests = pullRequests.map { pullRequestsWithRepoAndReviews ->
pullRequestsWithRepoAndReviews.filterSyncValid(syncSettings = syncSettings)
}
validPullRequests.map { pullRequestsWithRepoAndReviews ->
localDataSource.upsertPullRequests(pullRequestsWithRepoAndReviews.map { it.pullRequest })
localDataSource.removeReviewsByPullRequest(pullRequestsWithRepoAndReviews.map { it.pullRequest.id })
val reviews = pullRequestsWithRepoAndReviews.map { it.reviews }.flatten()
localDataSource.upsertReviews(reviews)
}
.flatten()
.filterSyncValid(syncSettings = syncSettings)
localDataSource.upsertPullRequests(pullRequestsWithRepos.map { it.pullRequest })
localDataSource.removeReviewsByPullRequest(pullRequestsWithRepos.map { it.pullRequest.id })
val reviews = pullRequestsWithRepos.map { it.reviews }.flatten()
localDataSource.upsertReviews(reviews)

// remove pull requests non returned from remote
val pullRequestIdsToRemove = pullRequestsBefore.map { it.pullRequest.id } - validPullRequests.flatten().map { it.pullRequest.id }.toSet()
val pullRequestIdsToRemove = pullRequestsBefore.map { it.pullRequest.id } - pullRequestsWithRepos.map { it.pullRequest.id }.toSet()
localDataSource.removePullRequests(pullRequestIdsToRemove)
cleanUp(syncSettings)

// send the notifications
val pullRequestsAfter = getAll().getOrDefault(listOf())