├── .circleci └── config.yml ├── .codacy.yml ├── .codeclimate.yml ├── .env.dist ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── question.md ├── PULL_REQUEST_TEMPLATE.md └── dependabot.yml.old ├── .gitignore ├── .pdd ├── IDEAS.md ├── LICENSE ├── Makefile ├── README.md ├── bin ├── codeclimate.sh ├── gradle_in_docker.sh └── migrate.sh ├── build.gradle ├── deploy ├── .k8s │ ├── 01-namespace.yml │ ├── Makefile │ ├── backend │ │ ├── deployment.yml │ │ ├── secret │ │ │ ├── app.txt.dist │ │ │ └── spring-datasource.txt.dist │ │ └── service.yml │ └── datadog │ │ └── values.yaml ├── Dockerfile-app └── Dockerfile-liquibase ├── docker-compose.yml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── lombok.config ├── settings.gradle ├── src ├── main │ ├── java │ │ └── dev │ │ │ └── iakunin │ │ │ └── codexiabot │ │ │ ├── CodexiaBotApplication.java │ │ │ ├── bot │ │ │ ├── Bot.java │ │ │ ├── Found.java │ │ │ ├── Small.java │ │ │ ├── TooManyStars.java │ │ │ ├── Up.java │ │ │ ├── config │ │ │ │ ├── ForksUpCronConfig.java │ │ │ │ ├── FoundOnHackernewsCronConfig.java │ │ │ │ ├── FoundOnRedditCronConfig.java │ │ │ │ ├── NotSmallCronConfig.java │ │ │ │ ├── StarsUpCronConfig.java │ │ │ │ ├── TooManyStarsCronConfig.java │ │ │ │ └── TooSmallCronConfig.java │ │ │ ├── entity │ │ │ │ ├── ForksUpResult.java │ │ │ │ ├── Result.java │ │ │ │ ├── StarsUpResult.java │ │ │ │ ├── TooManyStarsResult.java │ │ │ │ └── TooSmallResult.java │ │ │ ├── found │ │ │ │ ├── Bot.java │ │ │ │ ├── Hackernews.java │ │ │ │ └── Reddit.java │ │ │ ├── repository │ │ │ │ ├── ForksUpResultRepository.java │ │ │ │ ├── ResultRepository.java │ │ │ │ ├── StarsUpResultRepository.java │ │ │ │ ├── TooManyStarsResultRepository.java │ │ │ │ └── TooSmallResultRepository.java │ │ │ ├── toomanystars │ │ │ │ └── Submitter.java │ │ │ ├── toosmall │ │ │ │ ├── Approximate.java │ │ │ │ ├── Bot.java │ │ │ │ ├── Exact.java │ │ │ │ ├── ExactItem.java │ │ │ │ ├── LogNotFound.java │ │ │ │ ├── MappedText.java │ │ │ │ ├── NotSmall.java │ │ │ │ └── TooSmall.java │ │ │ └── up │ │ │ │ ├── Bot.java │ │ │ │ ├── Forks.java │ │ │ │ └── Stars.java │ │ │ ├── codexia │ │ │ ├── CodexiaModule.java │ │ │ ├── CodexiaModuleImpl.java │ │ │ ├── README.md │ │ │ ├── config │ │ │ │ ├── CodexiaParserCronConfig.java │ │ │ │ ├── DeleteObsoleteNotificationsCronConfig.java │ │ │ │ ├── FeignConfig.java │ │ │ │ ├── MissingFillerCronConfig.java │ │ │ │ ├── ResendErroneousReviewsCronConfig.java │ │ │ │ ├── ResendReviewsUntilDuplicatedCronConfig.java │ │ │ │ ├── SendBadgesCronConfig.java │ │ │ │ ├── SendReviewsCronConfig.java │ │ │ │ └── UpdateProjectsCronConfig.java │ │ │ ├── cron │ │ │ │ ├── CodexiaParser.java │ │ │ │ ├── DeleteObsoleteNotifications.java │ │ │ │ ├── MissingFiller.java │ │ │ │ ├── ResendErroneousReviews.java │ │ │ │ ├── ResendReviewsUntilDuplicated.java │ │ │ │ ├── SendBadges.java │ │ │ │ ├── SendReviews.java │ │ │ │ ├── UpdateProjects.java │ │ │ │ ├── throwaway │ │ │ │ │ └── InitializeBadges.java │ │ │ │ └── updateprojects │ │ │ │ │ └── Updater.java │ │ │ ├── entity │ │ │ │ ├── CodexiaBadge.java │ │ │ │ ├── CodexiaMeta.java │ │ │ │ ├── CodexiaProject.java │ │ │ │ ├── CodexiaReview.java │ │ │ │ └── CodexiaReviewNotification.java │ │ │ ├── repository │ │ │ │ ├── CodexiaBadgeRepository.java │ │ │ │ ├── CodexiaProjectRepository.java │ │ │ │ ├── CodexiaReviewNotificationRepository.java │ │ │ │ └── CodexiaReviewRepository.java │ │ │ ├── sdk │ │ │ │ └── CodexiaClient.java │ │ │ └── service │ │ │ │ ├── BadgeSender.java │ │ │ │ ├── BadgeSenderImpl.java │ │ │ │ ├── Composite.java │ │ │ │ ├── Database.java │ │ │ │ ├── GithubRepo.java │ │ │ │ ├── ReviewSender.java │ │ │ │ ├── ReviewSenderImpl.java │ │ │ │ └── Writer.java │ │ │ ├── common │ │ │ ├── SchedulerConfig.java │ │ │ ├── config │ │ │ │ ├── JacksonConfig.java │ │ │ │ ├── feign │ │ │ │ │ ├── GeneralClientConfiguration.java │ │ │ │ │ ├── Properties.java │ │ │ │ │ ├── SessionFingerprintInterceptor.java │ │ │ │ │ └── Slf4jFeignLogger.java │ │ │ │ └── service │ │ │ │ │ ├── SessionFingerprint.java │ │ │ │ │ └── SessionFingerprintImpl.java │ │ │ ├── duration │ │ │ │ ├── BiggestUnit.java │ │ │ │ └── HumanReadable.java │ │ │ ├── entity │ │ │ │ ├── AbstractEntity.java │ │ │ │ └── converter │ │ │ │ │ └── StringListConverter.java │ │ │ ├── runnable │ │ │ │ ├── FaultTolerant.java │ │ │ │ └── Logging.java │ │ │ └── text │ │ │ │ └── Pluralized.java │ │ │ ├── github │ │ │ ├── GithubModule.java │ │ │ ├── GithubModuleImpl.java │ │ │ ├── config │ │ │ │ ├── DeleteObsoleteStatCronConfig.java │ │ │ │ ├── Module.java │ │ │ │ └── stat │ │ │ │ │ ├── GithubCronConfig.java │ │ │ │ │ └── loc │ │ │ │ │ ├── CodexiaCronConfig.java │ │ │ │ │ └── WithoutLocCronConfig.java │ │ │ ├── cron │ │ │ │ ├── DeleteObsoleteStat.java │ │ │ │ └── stat │ │ │ │ │ ├── Github.java │ │ │ │ │ └── loc │ │ │ │ │ ├── Codexia.java │ │ │ │ │ └── WithoutLoc.java │ │ │ ├── entity │ │ │ │ ├── GithubRepo.java │ │ │ │ ├── GithubRepoSource.java │ │ │ │ └── GithubRepoStat.java │ │ │ ├── factory │ │ │ │ └── GithubRepoStatFactory.java │ │ │ ├── repository │ │ │ │ ├── GithubRepoRepository.java │ │ │ │ ├── GithubRepoSourceRepository.java │ │ │ │ └── GithubRepoStatRepository.java │ │ │ ├── sdk │ │ │ │ └── CodetabsClient.java │ │ │ └── service │ │ │ │ ├── GithubRepoName.java │ │ │ │ ├── LinesOfCode.java │ │ │ │ └── LinesOfCodeImpl.java │ │ │ ├── hackernews │ │ │ ├── HackernewsModule.java │ │ │ ├── HackernewsModuleImpl.java │ │ │ ├── README.md │ │ │ ├── config │ │ │ │ ├── AllItemsCronConfig.java │ │ │ │ ├── CodexiaItemsCronConfig.java │ │ │ │ ├── GapsFillerCronConfig.java │ │ │ │ ├── IncrementedParserCronConfig.java │ │ │ │ └── RetryErroneousCronConfig.java │ │ │ ├── cron │ │ │ │ ├── GapsFiller.java │ │ │ │ ├── IncrementedParser.java │ │ │ │ ├── RetryErroneous.java │ │ │ │ └── healthcheck │ │ │ │ │ ├── AllItems.java │ │ │ │ │ └── CodexiaItems.java │ │ │ ├── entity │ │ │ │ └── HackernewsItem.java │ │ │ ├── factory │ │ │ │ └── HackernewsItemFactory.java │ │ │ ├── repository │ │ │ │ └── HackernewsItemRepository.java │ │ │ ├── sdk │ │ │ │ └── HackernewsClient.java │ │ │ └── service │ │ │ │ ├── Composite.java │ │ │ │ ├── Database.java │ │ │ │ ├── GithubRepo.java │ │ │ │ └── Writer.java │ │ │ └── reddit │ │ │ ├── config │ │ │ ├── Client.java │ │ │ └── ParserCronConfig.java │ │ │ └── cron │ │ │ └── Parser.java │ └── resources │ │ ├── META-INF │ │ └── spring-configuration-metadata.json │ │ ├── application-dev.properties │ │ ├── application-prod.properties │ │ ├── application.properties │ │ ├── config.properties │ │ ├── db │ │ └── changelog │ │ │ ├── db.changelog-master.yaml │ │ │ └── sql │ │ │ ├── 2020-02-08_11:14_init.sql │ │ │ ├── 2020-02-08_20:10_rename_item.sql │ │ │ ├── 2020-02-08_21:45_github_repo.sql │ │ │ ├── 2020-02-08_22:15_github_repo__pushed_at.sql │ │ │ ├── 2020-02-08_22:20_github_repo__recreate.sql │ │ │ ├── 2020-02-09_21:11_hackernews_item__drop_text.sql │ │ │ ├── 2020-02-16_14:32_github_repo__recreation.sql │ │ │ ├── 2020-02-16_14:33_github_repo_stat.sql │ │ │ ├── 2020-02-16_18:24_github_repo_source.sql │ │ │ ├── 2020-02-25_18:57_hackernews_item__external_id.sql │ │ │ ├── 2020-02-26_10:13_github_repo_source__drop_index.sql │ │ │ ├── 2020-03-06_15:52_codexia_project.sql │ │ │ ├── 2020-03-06_17:37_github_repo_source__index.sql │ │ │ ├── 2020-03-07_20:13_hackernews_item__type__index.sql │ │ │ ├── 2020-03-09_12:14_codexia_review.sql │ │ │ ├── 2020-03-09_16:18_codexia_review__index.sql │ │ │ ├── 2020-03-09_16:19_github_repo_source__index.sql │ │ │ ├── 2020-03-09_17:56_github_repo_source__deleted_at.sql │ │ │ ├── 2020-03-09_18:56_github_repo_source__recreate_unique_index.sql │ │ │ ├── 2020-03-09_19:52_hackernews_item__type__add_deleted.sql.sql │ │ │ ├── 2020-03-09_19:56_hackernews_item__type__drop_default_deleted.sql.sql │ │ │ ├── 2020-03-09_20:56_codexia_review_notification.sql │ │ │ ├── 2020-03-10_21:01_codexia_review_notification__index.sql │ │ │ ├── 2020-04-11_21:20_stars_up_result.sql │ │ │ ├── 2020-04-18_20:42_forks_up_result.sql │ │ │ ├── 2020-04-20_14:58_too_many_stars_result.sql │ │ │ ├── 2020-04-24_15:15_codexia_project__drop_author_id.sql │ │ │ ├── 2020-04-29_00:15_too_small_result.sql │ │ │ ├── 2020-05-02_15:12_github_repo_stat__index.sql │ │ │ ├── 2020-05-02_15:50_github_repo_source__index.sql │ │ │ ├── 2020-05-03_00:20_github_repo_source__index.sql │ │ │ ├── 2020-05-19_18:09_codexia_badge.sql │ │ │ └── 2020-05-20_23:19_codexia_project__add_badges.sql │ │ ├── logback-spring.xml │ │ └── sentry.properties └── test │ ├── java │ └── dev │ │ └── iakunin │ │ └── codexiabot │ │ ├── AbstractIntegrationTest.java │ │ ├── bot │ │ ├── ForksUpIntegrationTest.java │ │ ├── ForksUpTransactionIntegrationTest.java │ │ ├── FoundOnHackernewsIntegrationTest.java │ │ ├── FoundOnRedditIntegrationTest.java │ │ ├── NotSmallIntegrationTest.java │ │ ├── StarsUpIntegrationTest.java │ │ ├── TooManyStarsIntegrationTest.java │ │ ├── TooManyStarsTransactionIntegrationTest.java │ │ ├── TooSmallIntegrationTest.java │ │ ├── TooSmallTransactionIntegrationTest.java │ │ ├── repository │ │ │ ├── ForksUpResultRepositoryIntegrationTest.java │ │ │ └── StarsUpResultRepositoryIntegrationTest.java │ │ └── toosmall │ │ │ ├── ExactItemTest.java │ │ │ └── LogNotFoundTest.java │ │ ├── codexia │ │ ├── cron │ │ │ ├── CodexiaParserIntegrationTest.java │ │ │ ├── DeleteObsoleteNotificationsIntegrationTest.java │ │ │ ├── MissingFillerIntegrationTest.java │ │ │ ├── ResendErroneousReviewsIntegrationTest.java │ │ │ ├── ResendReviewsUntilDuplicatedIntegrationTest.java │ │ │ ├── SendBadgesIntegrationTest.java │ │ │ ├── SendReviewsIntegrationTest.java │ │ │ ├── UpdateProjectsIntegrationTest.java │ │ │ ├── UpdateProjectsUpdaterUnitTest.java │ │ │ └── throwaway │ │ │ │ └── InitializeBadgesIntegrationTest.java │ │ ├── entity │ │ │ └── CodexiaProjectUnitTest.java │ │ ├── repository │ │ │ ├── CodexiaProjectRepositoryIntegrationTest.java │ │ │ └── CodexiaReviewRepositoryIntegrationTest.java │ │ └── service │ │ │ └── DatabaseTest.java │ │ ├── common │ │ ├── duration │ │ │ ├── BiggestUnitTest.java │ │ │ └── HumanReadableTest.java │ │ ├── entity │ │ │ └── converter │ │ │ │ └── StringListConverterUnitTest.java │ │ ├── runnable │ │ │ ├── FaultTolerantUnitTest.java │ │ │ └── LoggingTest.java │ │ └── text │ │ │ └── PluralizedTest.java │ │ ├── config │ │ ├── GithubConfig.java │ │ └── RedditConfig.java │ │ ├── dbunit │ │ └── CustomPostgresqlDataTypeFactory.java │ │ ├── github │ │ ├── GithubModuleCreateRepoIntegrationTest.java │ │ ├── cron │ │ │ ├── DeleteObsoleteStatIntegrationTest.java │ │ │ └── stat │ │ │ │ ├── GithubIntegrationTest.java │ │ │ │ └── loc │ │ │ │ ├── CodexiaIntegrationTest.java │ │ │ │ └── WithoutLocIntegrationTest.java │ │ ├── repository │ │ │ └── GithubRepoStatRepositoryIntegrationTest.java │ │ └── service │ │ │ └── GithubRepoNameTest.java │ │ ├── hackernews │ │ ├── HackernewsModuleImplIntegrationTest.java │ │ ├── cron │ │ │ ├── GapsFillerIntegrationTest.java │ │ │ ├── IncrementedParserIntegrationTest.java │ │ │ ├── RetryErroneousIntegrationTest.java │ │ │ └── healthcheck │ │ │ │ ├── AllItemsIntegrationTest.java │ │ │ │ └── CodexiaItemsIntegrationTest.java │ │ └── service │ │ │ └── GithubRepoUnitTest.java │ │ ├── reddit │ │ └── cron │ │ │ └── ParserIntegrationTest.java │ │ └── util │ │ ├── PostgresWrapper.java │ │ ├── WireMockWrapper.java │ │ ├── WiremockNetworkingAdapter.java │ │ └── wiremock │ │ ├── Request.java │ │ ├── Response.java │ │ └── Stub.java │ └── resources │ ├── db-rider │ ├── bot │ │ ├── forks-up-transaction │ │ │ ├── expected │ │ │ │ └── transactionRollback.yml │ │ │ └── initial │ │ │ │ └── transactionRollback.yml │ │ ├── forks-up │ │ │ ├── expected │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── noResults_githubRepoWithOneEmptyAndOneNonEmptyStat.yml │ │ │ │ ├── noResults_githubRepoWithOneStat.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_forksIncreaseLessThan10.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_forksIncreaseMoreThan10ButLessThan5Percents.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_happyPath.yml │ │ │ │ ├── noResults_githubRepoWithTwoEmptyStats.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_forksDecrease.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_forksIncreaseLessThan10.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_forksIncreaseMoreThan10ButLessThan5Percents.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_happyPath.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_withTwoEqualForks.yml │ │ │ │ ├── noResults_githubRepoWithoutStat.yml │ │ │ │ ├── oneResult_forksDecrease.yml │ │ │ │ ├── oneResult_forksIncreaseLessThan10.yml │ │ │ │ ├── oneResult_forksIncreaseMoreThan10ButLessThan5Percents.yml │ │ │ │ ├── oneResult_githubRepoWithFourStats_happyPath.yml │ │ │ │ ├── oneResult_githubRepoWithThreeStats_happyPath.yml │ │ │ │ └── oneResult_noNewGithubStats.yml │ │ │ └── initial │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── noResults_githubRepoWithOneEmptyAndOneNonEmptyStat.yml │ │ │ │ ├── noResults_githubRepoWithOneStat.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_forksIncreaseLessThan10.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_forksIncreaseMoreThan10ButLessThan5Percents.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_happyPath.yml │ │ │ │ ├── noResults_githubRepoWithTwoEmptyStats.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_forksDecrease.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_forksIncreaseLessThan10.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_forksIncreaseMoreThan10ButLessThan5Percents.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_happyPath.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_withTwoEqualForks.yml │ │ │ │ ├── noResults_githubRepoWithoutStat.yml │ │ │ │ ├── oneResult_forksDecrease.yml │ │ │ │ ├── oneResult_forksIncreaseLessThan10.yml │ │ │ │ ├── oneResult_forksIncreaseMoreThan10ButLessThan5Percents.yml │ │ │ │ ├── oneResult_githubRepoWithFourStats_happyPath.yml │ │ │ │ ├── oneResult_githubRepoWithThreeStats_happyPath.yml │ │ │ │ └── oneResult_noNewGithubStats.yml │ │ ├── found-on-hackernews │ │ │ ├── expected │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── happyPath.yml │ │ │ │ ├── happyPathNoUpvotes.yml │ │ │ │ ├── onlyCodexiaSource.yml │ │ │ │ ├── onlyHackernewsSource.yml │ │ │ │ └── reviewExists.yml │ │ │ └── initial │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── happyPath.yml │ │ │ │ ├── onlyCodexiaSource.yml │ │ │ │ ├── onlyHackernewsSource.yml │ │ │ │ └── reviewExists.yml │ │ ├── found-on-reddit │ │ │ ├── expected │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── happyPath.yml │ │ │ │ ├── onlyCodexiaSource.yml │ │ │ │ ├── onlyRedditSource.yml │ │ │ │ └── reviewExists.yml │ │ │ └── initial │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── happyPath.yml │ │ │ │ ├── onlyCodexiaSource.yml │ │ │ │ ├── onlyRedditSource.yml │ │ │ │ └── reviewExists.yml │ │ ├── not-small │ │ │ ├── expected │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── happyPath.yml │ │ │ │ ├── linesOfCodeLessThanThreshold.yml │ │ │ │ ├── noResult.yml │ │ │ │ ├── projectLevelMoreThanZero.yml │ │ │ │ └── resultWithTypeReset.yml │ │ │ └── initial │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── happyPath.yml │ │ │ │ ├── linesOfCodeLessThanThreshold.yml │ │ │ │ ├── noResult.yml │ │ │ │ ├── projectLevelMoreThanZero.yml │ │ │ │ └── resultWithTypeReset.yml │ │ ├── stars-up │ │ │ ├── expected │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── noResults_githubRepoWithOneEmptyAndOneNonEmptyStat.yml │ │ │ │ ├── noResults_githubRepoWithOneStat.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_happyPath.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_starsIncreaseLessThan10.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_starsIncreaseMoreThan10ButLessThan5Percents.yml │ │ │ │ ├── noResults_githubRepoWithTwoEmptyStats.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_happyPath.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_starsDecrease.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_starsIncreaseLessThan10.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_starsIncreaseMoreThan10ButLessThan5Percents.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_withTwoEqualStars.yml │ │ │ │ ├── noResults_githubRepoWithoutStat.yml │ │ │ │ ├── oneResult_githubRepoWithFourStats_happyPath.yml │ │ │ │ ├── oneResult_githubRepoWithThreeStats_happyPath.yml │ │ │ │ ├── oneResult_noNewGithubStats.yml │ │ │ │ ├── oneResult_starsDecrease.yml │ │ │ │ ├── oneResult_starsIncreaseLessThan10.yml │ │ │ │ └── oneResult_starsIncreaseMoreThan10ButLessThan5Percents.yml │ │ │ └── initial │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── noResults_githubRepoWithOneEmptyAndOneNonEmptyStat.yml │ │ │ │ ├── noResults_githubRepoWithOneStat.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_happyPath.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_starsIncreaseLessThan10.yml │ │ │ │ ├── noResults_githubRepoWithThreeStats_starsIncreaseMoreThan10ButLessThan5Percents.yml │ │ │ │ ├── noResults_githubRepoWithTwoEmptyStats.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_happyPath.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_starsDecrease.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_starsIncreaseLessThan10.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_starsIncreaseMoreThan10ButLessThan5Percents.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_withTwoEqualStars.yml │ │ │ │ ├── noResults_githubRepoWithoutStat.yml │ │ │ │ ├── oneResult_githubRepoWithFourStats_happyPath.yml │ │ │ │ ├── oneResult_githubRepoWithThreeStats_happyPath.yml │ │ │ │ ├── oneResult_noNewGithubStats.yml │ │ │ │ ├── oneResult_starsDecrease.yml │ │ │ │ ├── oneResult_starsIncreaseLessThan10.yml │ │ │ │ └── oneResult_starsIncreaseMoreThan10ButLessThan5Percents.yml │ │ ├── too-many-stars-transaction │ │ │ ├── expected │ │ │ │ └── transactionRollback.yml │ │ │ └── initial │ │ │ │ └── transactionRollback.yml │ │ ├── too-many-stars │ │ │ ├── expected │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── noResults_githubRepoWithOneEmptyStat.yml │ │ │ │ ├── noResults_githubRepoWithOneStat_aboveThreshold.yml │ │ │ │ ├── noResults_githubRepoWithOneStat_belowThreshold.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_aboveThreshold.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_belowThreshold.yml │ │ │ │ ├── noResults_githubRepoWithoutStat.yml │ │ │ │ ├── oneResult_noNewGithubStats.yml │ │ │ │ ├── oneResult_oneNewGithubStat.yml │ │ │ │ └── oneResult_twoNewGithubStats.yml │ │ │ └── initial │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── noResults_githubRepoWithOneEmptyStat.yml │ │ │ │ ├── noResults_githubRepoWithOneStat_aboveThreshold.yml │ │ │ │ ├── noResults_githubRepoWithOneStat_belowThreshold.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_aboveThreshold.yml │ │ │ │ ├── noResults_githubRepoWithTwoStats_belowThreshold.yml │ │ │ │ ├── noResults_githubRepoWithoutStat.yml │ │ │ │ ├── oneResult_noNewGithubStats.yml │ │ │ │ ├── oneResult_oneNewGithubStat.yml │ │ │ │ └── oneResult_twoNewGithubStats.yml │ │ ├── too-small-transaction │ │ │ ├── expected │ │ │ │ └── transactionRollback.yml │ │ │ └── initial │ │ │ │ └── transactionRollback.yml │ │ └── too-small │ │ │ ├── expected │ │ │ ├── emptyDatabase.yml │ │ │ ├── githubLanguageIsNull.yml │ │ │ ├── githubStatIsAbsent.yml │ │ │ ├── happyPath.yml │ │ │ ├── linesOfCodeIsAbsent.yml │ │ │ ├── moreThanThreshold.yml │ │ │ ├── notInCodexia.yml │ │ │ ├── oneResetResult.yml │ │ │ ├── oneSetResult.yml │ │ │ └── projectLevelMoreThanZero.yml │ │ │ └── initial │ │ │ ├── emptyDatabase.yml │ │ │ ├── githubLanguageIsNull.yml │ │ │ ├── githubStatIsAbsent.yml │ │ │ ├── happyPath.yml │ │ │ ├── linesOfCodeIsAbsent.yml │ │ │ ├── moreThanThreshold.yml │ │ │ ├── notInCodexia.yml │ │ │ ├── oneResetResult.yml │ │ │ ├── oneSetResult.yml │ │ │ └── projectLevelMoreThanZero.yml │ ├── codexia │ │ └── cron │ │ │ ├── codexia-parser │ │ │ ├── expected │ │ │ │ ├── codexiaProjectAlreadyExist.yml │ │ │ │ ├── deletedProject.yml │ │ │ │ ├── happyPathWithGithub.yml │ │ │ │ └── happyPathWithoutGithub.yml │ │ │ └── initial │ │ │ │ ├── codexiaProjectAlreadyExist.yml │ │ │ │ ├── deletedProject.yml │ │ │ │ ├── happyPathWithGithub.yml │ │ │ │ └── happyPathWithoutGithub.yml │ │ │ ├── delete-obsolete-notifications │ │ │ ├── expected │ │ │ │ ├── deletedOneNotificationPerOneReview.yml │ │ │ │ ├── deletedOneNotificationPerTwoReviews.yml │ │ │ │ ├── deletedTwoNotificationsPerOneReview.yml │ │ │ │ ├── deletedTwoNotificationsPerTwoReviews.yml │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── nothingToDeleteOneReview.yml │ │ │ │ ├── nothingToDeleteTwoReviews.yml │ │ │ │ └── unableToDelete.yml │ │ │ └── initial │ │ │ │ ├── deletedOneNotificationPerOneReview.yml │ │ │ │ ├── deletedOneNotificationPerTwoReviews.yml │ │ │ │ ├── deletedTwoNotificationsPerOneReview.yml │ │ │ │ ├── deletedTwoNotificationsPerTwoReviews.yml │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── nothingToDeleteOneReview.yml │ │ │ │ ├── nothingToDeleteTwoReviews.yml │ │ │ │ └── unableToDelete.yml │ │ │ ├── missing-filler │ │ │ ├── expected │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── oneDeletedWithoutGithubRepo.yml │ │ │ │ ├── oneWithGithubRepo.yml │ │ │ │ ├── oneWithoutGithubRepo.yml │ │ │ │ └── twoWithoutGithubRepo.yml │ │ │ └── initial │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── oneDeletedWithoutGithubRepo.yml │ │ │ │ ├── oneWithGithubRepo.yml │ │ │ │ ├── oneWithoutGithubRepo.yml │ │ │ │ └── twoWithoutGithubRepo.yml │ │ │ ├── projects-health-check │ │ │ ├── expected │ │ │ │ ├── noActiveProjectsInRepo.yml │ │ │ │ ├── oneSuccessAfterOneException.yml │ │ │ │ └── twoActiveProjectsInRepoButDeletedInCodexia.yml │ │ │ └── initial │ │ │ │ ├── noActiveProjectsInRepo.yml │ │ │ │ ├── oneSuccessAfterOneException.yml │ │ │ │ └── twoActiveProjectsInRepoButDeletedInCodexia.yml │ │ │ ├── resend-erroneous │ │ │ ├── expected │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── noErroneous.yml │ │ │ │ ├── oneErroneous.yml │ │ │ │ ├── oneSuccessfulOneErroneous.yml │ │ │ │ ├── reviewSentWith500.yml │ │ │ │ └── twoErroneous.yml │ │ │ └── initial │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── noErroneous.yml │ │ │ │ ├── oneErroneous.yml │ │ │ │ ├── oneSuccessfulOneErroneous.yml │ │ │ │ └── twoErroneous.yml │ │ │ ├── resend-reviews-until-duplicated │ │ │ ├── expected │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── happyPath.yml │ │ │ │ ├── oneSuccessfulNotificationWithDuplicatedCode.yml │ │ │ │ └── oneUnsuccessfulNotification.yml │ │ │ └── initial │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── happyPath.yml │ │ │ │ ├── oneSuccessfulNotificationWithDuplicatedCode.yml │ │ │ │ └── oneUnsuccessfulNotification.yml │ │ │ ├── send-badges │ │ │ ├── expected │ │ │ │ ├── attachOneBadge.yml │ │ │ │ ├── attachTwoBadges.yml │ │ │ │ ├── detachOneBadge.yml │ │ │ │ ├── detachTwoBadges.yml │ │ │ │ └── emptyDatabase.yml │ │ │ └── initial │ │ │ │ ├── attachOneBadge.yml │ │ │ │ ├── attachTwoBadges.yml │ │ │ │ ├── detachOneBadge.yml │ │ │ │ ├── detachTwoBadges.yml │ │ │ │ └── emptyDatabase.yml │ │ │ ├── send-reviews │ │ │ ├── expected │ │ │ │ ├── noReviewsToSend.yml │ │ │ │ ├── reviewSentWith500.yml │ │ │ │ ├── reviewSentWithDuplicate_responseBodyEmpty.yml │ │ │ │ ├── reviewSentWithDuplicate_responseBodyExists.yml │ │ │ │ └── reviewSuccessfullySent.yml │ │ │ └── initial │ │ │ │ ├── noReviewsToSend.yml │ │ │ │ ├── reviewSentWith500.yml │ │ │ │ ├── reviewSentWithDuplicate_responseBodyEmpty.yml │ │ │ │ ├── reviewSentWithDuplicate_responseBodyExists.yml │ │ │ │ └── reviewSuccessfullySent.yml │ │ │ └── throwaway │ │ │ └── initialize-badges │ │ │ ├── expected │ │ │ ├── altogether.yml │ │ │ ├── emptyDatabase.yml │ │ │ ├── fromTooSmallToNotSmall.yml │ │ │ ├── multipleTooSmall.yml │ │ │ ├── oneNotTooSmall.yml │ │ │ ├── oneTooManyStars.yml │ │ │ ├── oneTooSmall.yml │ │ │ └── twoTooManyStars.yml │ │ │ └── initial │ │ │ ├── altogether.yml │ │ │ ├── emptyDatabase.yml │ │ │ ├── fromTooSmallToNotSmall.yml │ │ │ ├── multipleTooSmall.yml │ │ │ ├── oneNotTooSmall.yml │ │ │ ├── oneTooManyStars.yml │ │ │ ├── oneTooSmall.yml │ │ │ └── twoTooManyStars.yml │ ├── github │ │ ├── cron │ │ │ ├── delete-obsolete-stat │ │ │ │ ├── expected │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── fourStatsOfTwoTypes.yml │ │ │ │ │ ├── oneStat.yml │ │ │ │ │ ├── sixStatsOfTwoTypes.yml │ │ │ │ │ ├── sixStatsOfTwoTypesWithForeignKeys.yml │ │ │ │ │ ├── threeStats.yml │ │ │ │ │ ├── threeStatsWithForeignKey.yml │ │ │ │ │ ├── twoStats.yml │ │ │ │ │ └── twoStatsOfTwoTypes.yml │ │ │ │ └── initial │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── fourStatsOfTwoTypes.yml │ │ │ │ │ ├── oneStat.yml │ │ │ │ │ ├── sixStatsOfTwoTypes.yml │ │ │ │ │ ├── sixStatsOfTwoTypesWithForeignKeys.yml │ │ │ │ │ ├── threeStats.yml │ │ │ │ │ ├── threeStatsWithForeignKey.yml │ │ │ │ │ ├── twoStats.yml │ │ │ │ │ └── twoStatsOfTwoTypes.yml │ │ │ └── stat │ │ │ │ ├── github │ │ │ │ ├── expected │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── githubIoException.yml │ │ │ │ │ ├── happyPath.yml │ │ │ │ │ └── notCodexiaSource.yml │ │ │ │ └── initial │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── githubIoException.yml │ │ │ │ │ ├── happyPath.yml │ │ │ │ │ └── notCodexiaSource.yml │ │ │ │ └── loc │ │ │ │ ├── codexia │ │ │ │ ├── expected │ │ │ │ │ ├── codetabsException.yml │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── happyPath.yml │ │ │ │ │ ├── processedRepo.yml │ │ │ │ │ └── tooManyRequests.yml │ │ │ │ └── initial │ │ │ │ │ ├── codetabsException.yml │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── happyPath.yml │ │ │ │ │ ├── processedRepo.yml │ │ │ │ │ └── tooManyRequests.yml │ │ │ │ └── without-loc │ │ │ │ ├── expected │ │ │ │ ├── codetabsException.yml │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── happyPath.yml │ │ │ │ ├── processedRepo.yml │ │ │ │ └── tooManyRequests.yml │ │ │ │ └── initial │ │ │ │ ├── codetabsException.yml │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── happyPath.yml │ │ │ │ ├── processedRepo.yml │ │ │ │ └── tooManyRequests.yml │ │ └── github-module │ │ │ ├── expected │ │ │ ├── happyPath.yml │ │ │ ├── notFoundInGithub.yml │ │ │ ├── repoExistsByCodexiaSource.yml │ │ │ ├── repoExistsByExternalId.yml │ │ │ └── repoExistsByFullName.yml │ │ │ └── initial │ │ │ ├── happyPath.yml │ │ │ ├── notFoundInGithub.yml │ │ │ ├── repoExistsByCodexiaSource.yml │ │ │ ├── repoExistsByExternalId.yml │ │ │ └── repoExistsByFullName.yml │ ├── hackernews │ │ ├── cron │ │ │ ├── gaps-filler │ │ │ │ ├── expected │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── oneMissing.yml │ │ │ │ │ └── twoMissing.yml │ │ │ │ └── initial │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── oneMissing.yml │ │ │ │ │ └── twoMissing.yml │ │ │ ├── health-check │ │ │ │ ├── all-items │ │ │ │ │ ├── expected │ │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ │ ├── hackernewsException.yml │ │ │ │ │ │ ├── oneActiveItem.yml │ │ │ │ │ │ ├── oneDeletedItem.yml │ │ │ │ │ │ ├── twoActiveItems.yml │ │ │ │ │ │ └── twoDeletedItems.yml │ │ │ │ │ └── initial │ │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ │ ├── hackernewsException.yml │ │ │ │ │ │ ├── oneActiveItem.yml │ │ │ │ │ │ ├── oneDeletedItem.yml │ │ │ │ │ │ ├── twoActiveItems.yml │ │ │ │ │ │ └── twoDeletedItems.yml │ │ │ │ └── codexia-items │ │ │ │ │ ├── expected │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── hackernewsException.yml │ │ │ │ │ ├── oneActiveItem.yml │ │ │ │ │ ├── oneDeletedItem.yml │ │ │ │ │ ├── twoActiveItems.yml │ │ │ │ │ ├── twoDeletedItems.yml │ │ │ │ │ └── withoutCodexiaSource.yml │ │ │ │ │ └── initial │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── hackernewsException.yml │ │ │ │ │ ├── oneActiveItem.yml │ │ │ │ │ ├── oneDeletedItem.yml │ │ │ │ │ ├── twoActiveItems.yml │ │ │ │ │ ├── twoDeletedItems.yml │ │ │ │ │ └── withoutCodexiaSource.yml │ │ │ ├── incremented-parser │ │ │ │ ├── expected │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── emptyDatabaseAndTwoItemsAtHackernews.yml │ │ │ │ │ ├── emptyDatabaseItemWithGistUrl.yml │ │ │ │ │ ├── emptyDatabaseItemWithGithubUrl.yml │ │ │ │ │ ├── emptyDatabaseItemWithoutUrl.yml │ │ │ │ │ ├── notEmptyDatabaseExistsInRepo.yml │ │ │ │ │ └── notEmptyDatabaseWithoutHackernews.yml │ │ │ │ └── initial │ │ │ │ │ ├── emptyDatabase.yml │ │ │ │ │ ├── notEmptyDatabaseExistsInRepo.yml │ │ │ │ │ └── notEmptyDatabaseWithoutHackernews.yml │ │ │ └── retry-erroneous │ │ │ │ ├── expected │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── hackernewsException.yml │ │ │ │ ├── oneItem.yml │ │ │ │ ├── oneUnprocessedItem.yml │ │ │ │ └── twoItems.yml │ │ │ │ └── initial │ │ │ │ ├── emptyDatabase.yml │ │ │ │ ├── hackernewsException.yml │ │ │ │ ├── oneItem.yml │ │ │ │ ├── oneUnprocessedItem.yml │ │ │ │ └── twoItems.yml │ │ └── hackernews-module │ │ │ ├── expected │ │ │ └── noItemInDatabase.yml │ │ │ └── initial │ │ │ └── noItemInDatabase.yml │ └── reddit │ │ └── cron │ │ └── parser │ │ ├── expected │ │ ├── emptyDatabase.yml │ │ ├── happyPath.yml │ │ └── notCodexiaSource.yml │ │ └── initial │ │ ├── emptyDatabase.yml │ │ ├── happyPath.yml │ │ └── notCodexiaSource.yml │ ├── dbunit.yml │ ├── mockito-extensions │ └── org.mockito.plugins.MockMaker │ └── wiremock │ ├── bot │ └── found-on-hackernews │ │ ├── withScore.json │ │ └── withoutScore.json │ ├── codexia │ └── cron │ │ ├── codexia-parser │ │ ├── codexia │ │ │ ├── recent.json │ │ │ └── recentWithDeleted.json │ │ └── github │ │ │ └── getRepo.json │ │ ├── missing-filler │ │ ├── algorithms-js.json │ │ └── instaloader.json │ │ └── projects-health-check │ │ ├── 12deletedWithBadges.json │ │ └── 34deletedWithBadges.json │ ├── config │ └── reddit │ │ ├── accessToken.json │ │ └── me.json │ ├── github │ ├── cron │ │ └── stat │ │ │ ├── github │ │ │ └── instaloader.json │ │ │ └── loc │ │ │ └── happyPath.json │ └── github-module │ │ ├── codexia │ │ └── recent.json │ │ └── github │ │ ├── getRepo.json │ │ └── repoNotFound.json │ ├── hackernews │ ├── cron │ │ ├── gaps-filler │ │ │ ├── 2.json │ │ │ └── 4.json │ │ ├── health-check │ │ │ ├── activeItem.json │ │ │ └── deletedItem.json │ │ ├── incremented-parser │ │ │ ├── itemWithGistUrl.json │ │ │ ├── itemWithGithubUrl.json │ │ │ ├── itemWithUrl.json │ │ │ └── itemWithoutUrl.json │ │ └── retry-erroneous │ │ │ ├── 1.json │ │ │ └── 2.json │ └── hackernews-module │ │ └── 4.json │ └── reddit │ └── cron │ └── parser │ └── reddit.json └── var ├── codestyle └── .gitkeep └── wiremock ├── __files └── codexia │ ├── project.json │ └── recent │ ├── page-0.json │ ├── page-1.json │ ├── page-2.json │ └── page-3.json └── mappings └── codexia ├── attach-badge.json ├── create-review.json ├── detach-badge.json ├── get-project.json ├── put-meta.json └── recent ├── page-0.json ├── page-1.json ├── page-2.json └── page-3.json /.codacy.yml: -------------------------------------------------------------------------------- 1 | exclude_paths: 2 | - "**/*.jar" 3 | - "gradlew" 4 | - "gradlew.bat" 5 | -------------------------------------------------------------------------------- /.env.dist: -------------------------------------------------------------------------------- 1 | SENTRY_AUTH_TOKEN= 2 | SENTRY_ORG=iakunin 3 | SENTRY_PROJECT=codexia-bot 4 | DATADOG_API_KEY= 5 | REMOTE_DB_PASSWORD= 6 | REMOTE_DB_HOST= 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask us any question 4 | title: '' 5 | labels: question 6 | assignees: '' 7 | 8 | --- 9 | 10 | **What is your question about? Please describe.** 11 | A clear and concise description of what the question/problem is. 12 | 13 | **Describe what you've tried to find an answer to your question** 14 | A clear and concise description of how you've tried to find an answer by yourself. 15 | -------------------------------------------------------------------------------- /.github/dependabot.yml.old: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: gradle 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 10 8 | ignore: 9 | - dependency-name: org.sonarqube 10 | versions: 11 | - "> 2.8" 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Gradle ### 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### Compiled class file ### 7 | *.class 8 | 9 | ### STS ### 10 | .apt_generated 11 | .classpath 12 | .factorypath 13 | .project 14 | .settings 15 | .springBeans 16 | .sts4-cache 17 | 18 | ### IntelliJ IDEA ### 19 | .idea 20 | /out/ 21 | 22 | ### Data work ### 23 | *.log 24 | *.iml 25 | *.iws 26 | *.ipr 27 | *.csv 28 | *.rdb 29 | *.DS_Store 30 | .attach_pid* 31 | 32 | .env 33 | .editorconfig 34 | .mdlrc 35 | .mdl-rules.rb 36 | 37 | /deploy/.k8s/backend/secret/app.txt 38 | /deploy/.k8s/backend/secret/spring-datasource.txt 39 | 40 | /var/codestyle 41 | !/var/codestyle/.gitkeep 42 | -------------------------------------------------------------------------------- /.pdd: -------------------------------------------------------------------------------- 1 | --verbose 2 | --source=. 3 | --exclude=.gradle/**/* 4 | --exclude=.idea/**/* 5 | --exclude=build/**/* 6 | --exclude=out/**/* 7 | --file=/dev/null 8 | -------------------------------------------------------------------------------- /bin/codeclimate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker run \ 4 | --interactive --tty --rm \ 5 | --env CODECLIMATE_CODE="${PWD}" \ 6 | --volume "${PWD}":/code \ 7 | --volume /var/run/docker.sock:/var/run/docker.sock \ 8 | --volume /tmp/cc:/tmp/cc \ 9 | codeclimate/codeclimate prepare 10 | 11 | docker run \ 12 | --interactive --tty --rm \ 13 | --env CODECLIMATE_CODE="${PWD}" \ 14 | --volume "${PWD}":/code \ 15 | --volume /var/run/docker.sock:/var/run/docker.sock \ 16 | --volume /tmp/cc:/tmp/cc \ 17 | codeclimate/codeclimate analyze 18 | 19 | docker run \ 20 | --tty \ 21 | --interactive \ 22 | --privileged \ 23 | --rm \ 24 | --volume="${PWD}":/home/gradle/project \ 25 | --workdir=/home/gradle/project \ 26 | gradle:6.8-jdk11 \ 27 | chown -R "$(id -u)":"$(id -g)" . 28 | -------------------------------------------------------------------------------- /bin/gradle_in_docker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker run \ 4 | --tty \ 5 | --interactive \ 6 | --privileged \ 7 | --rm \ 8 | --volume="${PWD}":/home/gradle/project \ 9 | --volume="${HOME}"/.m2:/root/.m2 \ 10 | --volume=codexia-bot-gradle-cache:/home/gradle/.gradle \ 11 | --volume=/var/run/docker.sock:/var/run/docker.sock \ 12 | --workdir=/home/gradle/project \ 13 | gradle:6.8-jdk11 \ 14 | gradle "$@" 15 | 16 | docker run \ 17 | --tty \ 18 | --interactive \ 19 | --privileged \ 20 | --rm \ 21 | --volume="${PWD}":/home/gradle/project \ 22 | --workdir=/home/gradle/project \ 23 | gradle:6.8-jdk11 \ 24 | chown -R "$(id -u)":"$(id -g)" . 25 | -------------------------------------------------------------------------------- /bin/migrate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) 4 | cd "$DIR"/.. || exit 5 | 6 | 7 | printf "Building image:\n" 8 | IMAGE=$(docker build -q -f deploy/Dockerfile-liquibase .) 9 | 10 | printf "\n\nNewly built image:\n" 11 | echo "$IMAGE" 12 | 13 | printf "\n\nRunning liquibase:\n" 14 | docker run \ 15 | --tty \ 16 | --interactive \ 17 | --rm \ 18 | --net host \ 19 | --env LIQUIBASE_HOST="$REMOTE_DB_HOST" \ 20 | --env LIQUIBASE_PORT=5432 \ 21 | --env LIQUIBASE_DATABASE=codexia-bot \ 22 | --env LIQUIBASE_USERNAME=codexia-bot \ 23 | --env LIQUIBASE_PASSWORD="$REMOTE_DB_PASSWORD" \ 24 | "$IMAGE" \ 25 | liquibase update 26 | 27 | printf "\n\nDeleting image:\n" 28 | docker image rm "$IMAGE" 29 | -------------------------------------------------------------------------------- /deploy/.k8s/01-namespace.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: codexia-bot 5 | -------------------------------------------------------------------------------- /deploy/.k8s/backend/secret/app.txt.dist: -------------------------------------------------------------------------------- 1 | github.token= 2 | codexia.token= 3 | reddit.password= 4 | reddit.client-secret= 5 | sentry.dsn= 6 | datadog.api-key= 7 | -------------------------------------------------------------------------------- /deploy/.k8s/backend/secret/spring-datasource.txt.dist: -------------------------------------------------------------------------------- 1 | password= 2 | host= 3 | -------------------------------------------------------------------------------- /deploy/.k8s/backend/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: backend-service 5 | namespace: codexia-bot 6 | spec: 7 | selector: 8 | app: backend 9 | type: NodePort 10 | ports: 11 | - name: backend-port 12 | protocol: TCP 13 | port: 8080 14 | targetPort: 8080 15 | -------------------------------------------------------------------------------- /deploy/Dockerfile-app: -------------------------------------------------------------------------------- 1 | FROM openjdk:11-jdk-slim 2 | 3 | COPY build/libs/codexia-bot-*.jar /app.jar 4 | COPY build/libs/dd-java-agent-*.jar /dd-java-agent.jar 5 | 6 | WORKDIR / 7 | 8 | ENTRYPOINT [ \ 9 | "java", \ 10 | "-XX:FlightRecorderOptions=stackdepth=128", \ 11 | "-javaagent:/dd-java-agent.jar", \ 12 | "-jar", \ 13 | "/app.jar" \ 14 | ] 15 | -------------------------------------------------------------------------------- /deploy/Dockerfile-liquibase: -------------------------------------------------------------------------------- 1 | FROM iakunin/liquibase-postgres:42.1.4-3.8.9 2 | 3 | ENV LIQUIBASE_CHANGELOG=db/changelog/db.changelog-master.yaml 4 | 5 | RUN mkdir /workspace/db 6 | COPY src/main/resources/db /workspace/db 7 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | services: 4 | db: 5 | container_name: codexia-bot-db 6 | image: postgres:12.2 7 | restart: always 8 | environment: 9 | POSTGRES_DB: codexia-bot 10 | POSTGRES_USER: codexia-bot 11 | POSTGRES_PASSWORD: codexia-bot 12 | ports: 13 | - 54322:5432 14 | 15 | wiremock: 16 | container_name: codexia-bot-wiremock 17 | image: rodolpheche/wiremock 18 | volumes: 19 | - ./var/wiremock:/home/wiremock 20 | expose: 21 | - 80 22 | ports: 23 | - "8098:80" 24 | command: 25 | - "java" 26 | - "-cp" 27 | - "/var/wiremock/lib/*:/var/wiremock/extensions/*" 28 | - "com.github.tomakehurst.wiremock.standalone.WireMockServerRunner" 29 | - "--local-response-templating" 30 | - "--port=80" 31 | - "--verbose" 32 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | version=0.0.0 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iakunin/codexia-bot/5ee879213722ca2b38cf35ad47950a811da2f59c/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /lombok.config: -------------------------------------------------------------------------------- 1 | # This file is generated by the 'io.freefair.lombok' Gradle plugin 2 | config.stopBubbling = true 3 | lombok.accessors.chain = true 4 | lombok.addLombokGeneratedAnnotation = true 5 | lombok.equalsAndHashCode.callSuper = skip 6 | lombok.toString.callSuper = call 7 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'codexia-bot' 2 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/Bot.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot; 2 | 3 | public interface Bot { 4 | enum Type { 5 | FOUND_ON_HACKERNEWS, 6 | FOUND_ON_REDDIT, 7 | STARS_UP, 8 | FORKS_UP, 9 | TOO_MANY_STARS, 10 | TOO_SMALL, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/entity/ForksUpResult.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.entity; 2 | 3 | import dev.iakunin.codexiabot.common.entity.AbstractEntity; 4 | import dev.iakunin.codexiabot.github.entity.GithubRepo; 5 | import dev.iakunin.codexiabot.github.entity.GithubRepoStat; 6 | import javax.persistence.Entity; 7 | import javax.persistence.ManyToOne; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | /** 12 | * @checkstyle MemberName (500 lines) 13 | */ 14 | @Entity 15 | @Data 16 | @EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true) 17 | public final class ForksUpResult extends AbstractEntity implements Result { 18 | 19 | @ManyToOne 20 | private GithubRepo githubRepo; 21 | 22 | @ManyToOne 23 | private GithubRepoStat githubRepoStat; 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/entity/Result.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.entity; 2 | 3 | import dev.iakunin.codexiabot.github.entity.GithubRepo; 4 | import dev.iakunin.codexiabot.github.entity.GithubRepoStat; 5 | 6 | public interface Result { 7 | 8 | GithubRepo getGithubRepo(); 9 | 10 | GithubRepoStat getGithubRepoStat(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/entity/StarsUpResult.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.entity; 2 | 3 | import dev.iakunin.codexiabot.common.entity.AbstractEntity; 4 | import dev.iakunin.codexiabot.github.entity.GithubRepo; 5 | import dev.iakunin.codexiabot.github.entity.GithubRepoStat; 6 | import javax.persistence.Entity; 7 | import javax.persistence.ManyToOne; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | /** 12 | * @checkstyle MemberName (500 lines) 13 | */ 14 | @Entity 15 | @Data 16 | @EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true) 17 | public final class StarsUpResult extends AbstractEntity implements Result { 18 | 19 | @ManyToOne 20 | private GithubRepo githubRepo; 21 | 22 | @ManyToOne 23 | private GithubRepoStat githubRepoStat; 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/entity/TooManyStarsResult.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.entity; 2 | 3 | import dev.iakunin.codexiabot.common.entity.AbstractEntity; 4 | import dev.iakunin.codexiabot.github.entity.GithubRepo; 5 | import dev.iakunin.codexiabot.github.entity.GithubRepoStat; 6 | import javax.persistence.Entity; 7 | import javax.persistence.ManyToOne; 8 | import lombok.Data; 9 | import lombok.EqualsAndHashCode; 10 | 11 | /** 12 | * @checkstyle MemberName (500 lines) 13 | */ 14 | @Entity 15 | @Data 16 | @EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true) 17 | public final class TooManyStarsResult extends AbstractEntity implements Result { 18 | 19 | @ManyToOne 20 | private GithubRepo githubRepo; 21 | 22 | @ManyToOne 23 | private GithubRepoStat githubRepoStat; 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/found/Bot.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.found; 2 | 3 | import dev.iakunin.codexiabot.codexia.entity.CodexiaMeta; 4 | import dev.iakunin.codexiabot.codexia.entity.CodexiaReview; 5 | import dev.iakunin.codexiabot.github.GithubModule; 6 | import dev.iakunin.codexiabot.github.entity.GithubRepo; 7 | import java.util.stream.Stream; 8 | 9 | public interface Bot { 10 | Stream repoStream(); 11 | 12 | GithubModule.Source source(); 13 | 14 | String reviewText(String id); 15 | 16 | CodexiaMeta meta(CodexiaReview review); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/repository/ForksUpResultRepository.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.repository; 2 | 3 | import dev.iakunin.codexiabot.bot.entity.ForksUpResult; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface ForksUpResultRepository 7 | extends JpaRepository, ResultRepository { 8 | /*_*/ 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/repository/ResultRepository.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.repository; 2 | 3 | import dev.iakunin.codexiabot.bot.entity.Result; 4 | import dev.iakunin.codexiabot.github.entity.GithubRepo; 5 | import java.util.Optional; 6 | 7 | public interface ResultRepository { 8 | 9 | Optional findFirstByGithubRepoOrderByIdDesc(GithubRepo repo); 10 | 11 | Result save(Result result); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/repository/StarsUpResultRepository.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.repository; 2 | 3 | import dev.iakunin.codexiabot.bot.entity.StarsUpResult; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface StarsUpResultRepository 7 | extends JpaRepository, ResultRepository { 8 | /*_*/ 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/repository/TooManyStarsResultRepository.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.repository; 2 | 3 | import dev.iakunin.codexiabot.bot.entity.TooManyStarsResult; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface TooManyStarsResultRepository 7 | extends JpaRepository, ResultRepository { 8 | /*_*/ 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/repository/TooSmallResultRepository.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.repository; 2 | 3 | import dev.iakunin.codexiabot.bot.entity.TooSmallResult; 4 | import dev.iakunin.codexiabot.github.entity.GithubRepo; 5 | import java.util.Optional; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | public interface TooSmallResultRepository extends JpaRepository { 9 | 10 | Optional findFirstByGithubRepoOrderByIdDesc(GithubRepo repo); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/toosmall/Bot.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.toosmall; 2 | 3 | import dev.iakunin.codexiabot.bot.entity.TooSmallResult; 4 | import dev.iakunin.codexiabot.codexia.entity.CodexiaMeta; 5 | import dev.iakunin.codexiabot.codexia.entity.CodexiaProject; 6 | import dev.iakunin.codexiabot.codexia.entity.CodexiaReview; 7 | import dev.iakunin.codexiabot.github.entity.GithubRepo; 8 | import dev.iakunin.codexiabot.github.entity.GithubRepoStat; 9 | import dev.iakunin.codexiabot.github.entity.GithubRepoStat.LinesOfCode.Item; 10 | import java.util.stream.Stream; 11 | 12 | public interface Bot { 13 | 14 | Stream repoStream(); 15 | 16 | boolean shouldSubmit(Item item); 17 | 18 | TooSmallResult result(GithubRepoStat stat); 19 | 20 | CodexiaReview review(GithubRepoStat stat, Item item); 21 | 22 | CodexiaMeta meta(CodexiaReview review); 23 | 24 | void badge(CodexiaProject project); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/bot/up/Bot.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.bot.up; 2 | 3 | import dev.iakunin.codexiabot.bot.entity.Result; 4 | import dev.iakunin.codexiabot.codexia.entity.CodexiaMeta; 5 | import dev.iakunin.codexiabot.codexia.entity.CodexiaReview; 6 | import dev.iakunin.codexiabot.github.entity.GithubRepoStat; 7 | 8 | public interface Bot { 9 | boolean shouldSubmit(GithubRepoStat.GithubApi first, GithubRepoStat.GithubApi last); 10 | 11 | Result result(GithubRepoStat stat); 12 | 13 | CodexiaMeta meta(CodexiaReview review); 14 | 15 | CodexiaReview review(GithubRepoStat first, GithubRepoStat last); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/codexia/README.md: -------------------------------------------------------------------------------- 1 | # Codexia module 2 | 3 | The main documentation for codexia-api is 4 | here: . 5 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/codexia/config/FeignConfig.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.codexia.config; 2 | 3 | import feign.RequestInterceptor; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.context.annotation.Bean; 6 | 7 | public final class FeignConfig { 8 | 9 | private final String token; 10 | 11 | public FeignConfig( 12 | @Value("${app.codexia.token}") 13 | final String token 14 | ) { 15 | this.token = token; 16 | } 17 | 18 | @Bean 19 | public RequestInterceptor requestInterceptor() { 20 | return requestTemplate -> requestTemplate.header("X-Codexia-Token", this.token); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/codexia/entity/CodexiaBadge.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.codexia.entity; 2 | 3 | import dev.iakunin.codexiabot.common.entity.AbstractEntity; 4 | import java.time.LocalDateTime; 5 | import javax.persistence.Entity; 6 | import javax.persistence.ManyToOne; 7 | import lombok.Data; 8 | import lombok.EqualsAndHashCode; 9 | import org.hibernate.annotations.SQLDelete; 10 | 11 | /** 12 | * @checkstyle MemberName (500 lines) 13 | */ 14 | @Entity 15 | @Data 16 | @EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true) 17 | @SQLDelete(sql = "UPDATE codexia_badge SET deleted_at = now() WHERE id = ?") 18 | public final class CodexiaBadge extends AbstractEntity { 19 | 20 | @ManyToOne 21 | private CodexiaProject codexiaProject; 22 | 23 | private String badge; 24 | 25 | private LocalDateTime deletedAt; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/codexia/entity/CodexiaMeta.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.codexia.entity; 2 | 3 | import dev.iakunin.codexiabot.common.entity.AbstractEntity; 4 | import javax.persistence.Entity; 5 | import javax.persistence.ManyToOne; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | 9 | /** 10 | * @checkstyle MemberName (500 lines) 11 | */ 12 | @Entity 13 | @Data 14 | @EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true) 15 | public final class CodexiaMeta extends AbstractEntity { 16 | 17 | @ManyToOne 18 | private CodexiaProject codexiaProject; 19 | 20 | private String key; 21 | 22 | private String value; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/codexia/entity/CodexiaReview.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.codexia.entity; 2 | 3 | import dev.iakunin.codexiabot.common.entity.AbstractEntity; 4 | import javax.persistence.Entity; 5 | import javax.persistence.ManyToOne; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | 9 | /** 10 | * @checkstyle MemberName (500 lines) 11 | */ 12 | @Entity 13 | @Data 14 | @EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true) 15 | public final class CodexiaReview extends AbstractEntity { 16 | 17 | @ManyToOne 18 | private CodexiaProject codexiaProject; 19 | 20 | private String author; 21 | 22 | private String reason; 23 | 24 | private String text; 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/codexia/repository/CodexiaBadgeRepository.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.codexia.repository; 2 | 3 | import dev.iakunin.codexiabot.codexia.entity.CodexiaBadge; 4 | import dev.iakunin.codexiabot.codexia.entity.CodexiaProject; 5 | import java.util.Optional; 6 | import java.util.stream.Stream; 7 | import org.springframework.data.jpa.repository.JpaRepository; 8 | import org.springframework.data.jpa.repository.Query; 9 | 10 | public interface CodexiaBadgeRepository extends JpaRepository { 11 | 12 | Optional findByCodexiaProjectAndBadge(CodexiaProject project, String badge); 13 | 14 | @Query("select cb from CodexiaBadge cb") 15 | Stream getAll(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/codexia/repository/CodexiaReviewNotificationRepository.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.codexia.repository; 2 | 3 | import dev.iakunin.codexiabot.codexia.entity.CodexiaReview; 4 | import dev.iakunin.codexiabot.codexia.entity.CodexiaReviewNotification; 5 | import java.util.List; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | public interface CodexiaReviewNotificationRepository 9 | extends JpaRepository { 10 | 11 | List findAllByCodexiaReviewOrderByIdDesc(CodexiaReview review); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/codexia/service/BadgeSender.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.codexia.service; 2 | 3 | import dev.iakunin.codexiabot.codexia.entity.CodexiaBadge; 4 | 5 | public interface BadgeSender { 6 | void send(CodexiaBadge badge); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/codexia/service/Composite.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.codexia.service; 2 | 3 | import dev.iakunin.codexiabot.codexia.entity.CodexiaProject; 4 | import java.util.List; 5 | import lombok.RequiredArgsConstructor; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.context.annotation.Primary; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service("codexia.service.Composite") 11 | @Primary 12 | @Slf4j 13 | @RequiredArgsConstructor 14 | public final class Composite implements Writer { 15 | 16 | private final List writers; 17 | 18 | @Override 19 | public void write(final CodexiaProject project) { 20 | this.writers.forEach(writer -> writer.write(project)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/codexia/service/ReviewSender.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.codexia.service; 2 | 3 | import dev.iakunin.codexiabot.codexia.entity.CodexiaReview; 4 | 5 | public interface ReviewSender { 6 | void send(CodexiaReview review); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/codexia/service/Writer.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.codexia.service; 2 | 3 | import dev.iakunin.codexiabot.codexia.entity.CodexiaProject; 4 | 5 | public interface Writer { 6 | void write(CodexiaProject project); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/common/config/service/SessionFingerprint.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.common.config.service; 2 | 3 | public interface SessionFingerprint { 4 | String get(); 5 | 6 | void set(String fingerprint); 7 | 8 | void unset(); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/common/config/service/SessionFingerprintImpl.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.common.config.service; 2 | 3 | import dev.iakunin.codexiabot.common.config.feign.Properties; 4 | import org.slf4j.MDC; 5 | import org.springframework.stereotype.Service; 6 | 7 | @Service 8 | public final class SessionFingerprintImpl implements SessionFingerprint { 9 | 10 | private final String key; 11 | 12 | public SessionFingerprintImpl(final Properties properties) { 13 | this.key = properties.getMdcKeys().getFingerprint().getSession(); 14 | } 15 | 16 | @Override 17 | public String get() { 18 | return MDC.get(this.key); 19 | } 20 | 21 | @Override 22 | public void set(final String fingerprint) { 23 | MDC.put(this.key, fingerprint); 24 | } 25 | 26 | @Override 27 | public void unset() { 28 | MDC.remove(this.key); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/common/runnable/FaultTolerant.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.common.runnable; 2 | 3 | import io.vavr.control.Try; 4 | import java.util.function.Consumer; 5 | import java.util.stream.Stream; 6 | import lombok.RequiredArgsConstructor; 7 | 8 | @RequiredArgsConstructor 9 | public final class FaultTolerant implements Runnable { 10 | 11 | private final Stream stream; 12 | 13 | private final Consumer> failure; 14 | 15 | @Override 16 | public void run() { 17 | this.stream 18 | .map(Try::runRunnable) 19 | .filter(Try::isFailure) 20 | .forEach(this.failure); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/common/runnable/Logging.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.common.runnable; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | public final class Logging implements Runnable { 7 | 8 | private final Runnable inner; 9 | 10 | private final Logger logger; 11 | 12 | public Logging(final Runnable inner) { 13 | this( 14 | inner, 15 | LoggerFactory.getLogger(Logging.class) 16 | ); 17 | } 18 | 19 | public Logging(final Runnable inner, final Logger logger) { 20 | this.inner = inner; 21 | this.logger = logger; 22 | } 23 | 24 | @Override 25 | public void run() { 26 | this.logger.debug("Running {}", this.inner.getClass().getName()); 27 | 28 | this.inner.run(); 29 | 30 | this.logger.debug("Exiting from {}", this.inner.getClass().getName()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/github/config/Module.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.github.config; 2 | 3 | import java.io.IOException; 4 | import org.kohsuke.github.GitHub; 5 | import org.kohsuke.github.GitHubBuilder; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.beans.factory.annotation.Value; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | /** 12 | * @checkstyle DesignForExtension (500 lines) 13 | */ 14 | @Configuration 15 | public class Module { 16 | 17 | @Bean 18 | @Autowired 19 | public GitHub gitHub( 20 | @Value("${app.github-token}") final String token 21 | ) throws IOException { 22 | return new GitHubBuilder().withOAuthToken(token).build(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/github/repository/GithubRepoStatRepository.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.github.repository; 2 | 3 | import dev.iakunin.codexiabot.github.entity.GithubRepo; 4 | import dev.iakunin.codexiabot.github.entity.GithubRepoStat; 5 | import java.util.List; 6 | import java.util.Optional; 7 | import org.springframework.data.jpa.repository.JpaRepository; 8 | import org.springframework.stereotype.Repository; 9 | 10 | @Repository 11 | public interface GithubRepoStatRepository extends JpaRepository { 12 | 13 | List findAllByGithubRepoAndTypeAndIdGreaterThanEqualOrderByIdAsc( 14 | GithubRepo repo, 15 | GithubRepoStat.Type type, 16 | Long id 17 | ); 18 | 19 | Optional findFirstByGithubRepoAndTypeOrderByIdDesc( 20 | GithubRepo repo, 21 | GithubRepoStat.Type type 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/github/service/LinesOfCode.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.github.service; 2 | 3 | import dev.iakunin.codexiabot.github.entity.GithubRepo; 4 | 5 | public interface LinesOfCode { 6 | 7 | void calculate(GithubRepo repo); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/hackernews/HackernewsModule.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.hackernews; 2 | 3 | import dev.iakunin.codexiabot.hackernews.sdk.HackernewsClient; 4 | import java.util.stream.Stream; 5 | 6 | public interface HackernewsModule { 7 | void healthCheckItems(Stream ids); 8 | 9 | HackernewsClient.Item getItem(Integer id); 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/hackernews/README.md: -------------------------------------------------------------------------------- 1 | # Hackernews module 2 | 3 | The main documentation for hackernews-api is here: . 4 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/hackernews/entity/HackernewsItem.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.hackernews.entity; 2 | 3 | import dev.iakunin.codexiabot.common.entity.AbstractEntity; 4 | import java.time.Instant; 5 | import javax.persistence.Entity; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | 9 | /** 10 | * @checkstyle ExplicitInitialization (500 lines) 11 | * @checkstyle MemberName (500 lines) 12 | */ 13 | @Entity 14 | @Data 15 | @EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true) 16 | public final class HackernewsItem extends AbstractEntity { 17 | 18 | private Integer externalId; 19 | 20 | private String type; 21 | 22 | private String by; 23 | 24 | private String title; 25 | 26 | private String url; 27 | 28 | private Instant time; 29 | 30 | private boolean deleted; 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/hackernews/repository/HackernewsItemRepository.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.hackernews.repository; 2 | 3 | import dev.iakunin.codexiabot.hackernews.entity.HackernewsItem; 4 | import java.util.Optional; 5 | import java.util.stream.Stream; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Query; 8 | import org.springframework.stereotype.Repository; 9 | 10 | @Repository 11 | public interface HackernewsItemRepository extends JpaRepository { 12 | 13 | boolean existsByExternalId(Integer id); 14 | 15 | Optional findByExternalId(Integer id); 16 | 17 | @Query("select coalesce(max(externalId), 0) from HackernewsItem") 18 | Integer getMaxExternalId(); 19 | 20 | Stream findAllByType(String type); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/hackernews/service/Composite.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.hackernews.service; 2 | 3 | import dev.iakunin.codexiabot.hackernews.entity.HackernewsItem; 4 | import java.util.List; 5 | import lombok.RequiredArgsConstructor; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.context.annotation.Primary; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service("hackernews.service.Composite") 11 | @Primary 12 | @Slf4j 13 | @RequiredArgsConstructor 14 | public final class Composite implements Writer { 15 | 16 | private final List list; 17 | 18 | @Override 19 | public void write(final HackernewsItem item) { 20 | this.list.forEach(writer -> writer.write(item)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/dev/iakunin/codexiabot/hackernews/service/Writer.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.hackernews.service; 2 | 3 | import dev.iakunin.codexiabot.hackernews.entity.HackernewsItem; 4 | 5 | public interface Writer { 6 | void write(HackernewsItem item); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | spring.jpa.show-sql=true 2 | -------------------------------------------------------------------------------- /src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | # THIS FILE INTENTIONALLY LEFT BLANK! 2 | # It's required for disabling warning "No URLs will be polled as dynamic configuration sources". 3 | # For more info see https://github.com/Netflix/Hystrix/issues/275 4 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/db.changelog-master.yaml: -------------------------------------------------------------------------------- 1 | databaseChangeLog: 2 | - 3 | includeAll: 4 | pathName: sql 5 | path: db/changelog/sql/ 6 | logicalFilePath: db/changelog/sql/ 7 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-02-08_11:14_init.sql: -------------------------------------------------------------------------------- 1 | create table "item" ( 2 | "id" bigserial primary key, 3 | "uuid" uuid unique, 4 | "external_id" varchar unique, 5 | "type" varchar, 6 | "by" varchar, 7 | "title" varchar, 8 | "text" varchar, 9 | "url" varchar, 10 | "time" timestamp, 11 | "created_at" timestamp, 12 | "updated_at" timestamp 13 | ); 14 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-02-08_20:10_rename_item.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE "item" RENAME TO "hackernews_item"; 2 | ALTER SEQUENCE "item_id_seq" RENAME TO "hackernews_item_id_seq"; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-02-08_21:45_github_repo.sql: -------------------------------------------------------------------------------- 1 | create table "github_repo" ( 2 | "id" bigserial primary key, 3 | "uuid" uuid not null unique, 4 | "external_id" varchar not null unique, 5 | 6 | "full_name" varchar, 7 | "html_url" varchar, 8 | "description" varchar, 9 | "language" varchar, 10 | "homepage" varchar, 11 | 12 | "forks" integer, 13 | "watchers" integer, 14 | "stars" integer, 15 | "releases" integer, 16 | "used_by" integer, 17 | 18 | "lines_of_code" json, 19 | 20 | "repo_created_at" timestamp, 21 | 22 | "created_at" timestamp, 23 | "updated_at" timestamp 24 | ); 25 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-02-08_22:15_github_repo__pushed_at.sql: -------------------------------------------------------------------------------- 1 | alter table "github_repo" 2 | add column "pushed_at" timestamp; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-02-08_22:20_github_repo__recreate.sql: -------------------------------------------------------------------------------- 1 | drop table "github_repo"; 2 | 3 | create table "github_repo" 4 | ( 5 | "id" bigserial primary key, 6 | "uuid" uuid not null unique, 7 | "external_id" varchar not null unique, 8 | 9 | "full_name" varchar, 10 | "html_url" varchar, 11 | "description" varchar, 12 | "language" varchar, 13 | "homepage" varchar, 14 | 15 | "forks" integer, 16 | "watchers" integer, 17 | "stars" integer, 18 | "releases" integer, 19 | "used_by" integer, 20 | 21 | "lines_of_code" json, 22 | 23 | "repo_created_at" timestamp, 24 | "pushed_at" timestamp, 25 | 26 | "created_at" timestamp, 27 | "updated_at" timestamp 28 | ); 29 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-02-09_21:11_hackernews_item__drop_text.sql: -------------------------------------------------------------------------------- 1 | alter table "hackernews_item" drop column "text"; 2 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-02-16_14:32_github_repo__recreation.sql: -------------------------------------------------------------------------------- 1 | drop table if exists "github_repo"; 2 | 3 | create table "github_repo" 4 | ( 5 | "id" bigserial primary key, 6 | "uuid" uuid not null unique, 7 | 8 | "external_id" varchar not null unique, 9 | "full_name" varchar not null, 10 | "html_url" varchar, 11 | "repo_created_at" timestamp, 12 | 13 | "created_at" timestamp, 14 | "updated_at" timestamp 15 | ); 16 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-02-16_14:33_github_repo_stat.sql: -------------------------------------------------------------------------------- 1 | create table "github_repo_stat" 2 | ( 3 | "id" bigserial primary key, 4 | "uuid" uuid not null unique, 5 | 6 | "github_repo_id" bigint not null references github_repo(id), 7 | 8 | "type" varchar not null, 9 | "stat" json, 10 | 11 | "created_at" timestamp, 12 | "updated_at" timestamp 13 | ); 14 | 15 | create index ix__github_repo_stat__type 16 | on github_repo_stat(type); 17 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-02-16_18:24_github_repo_source.sql: -------------------------------------------------------------------------------- 1 | create table "github_repo_source" 2 | ( 3 | "id" bigserial primary key, 4 | "uuid" uuid not null unique, 5 | 6 | "github_repo_id" bigint not null references github_repo(id), 7 | 8 | "source" varchar not null, 9 | "external_id" varchar not null, 10 | 11 | "created_at" timestamp, 12 | "updated_at" timestamp 13 | ); 14 | 15 | create unique index uq__github_repo_source__type 16 | on github_repo_source("source", "external_id"); 17 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-02-25_18:57_hackernews_item__external_id.sql: -------------------------------------------------------------------------------- 1 | alter table "hackernews_item" 2 | alter column external_id type int using external_id::int; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-02-26_10:13_github_repo_source__drop_index.sql: -------------------------------------------------------------------------------- 1 | drop index if exists "uq__github_repo_source__type"; 2 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-06_15:52_codexia_project.sql: -------------------------------------------------------------------------------- 1 | create table "codexia_project" 2 | ( 3 | "id" bigserial primary key, 4 | "uuid" uuid not null unique, 5 | 6 | "external_id" int not null unique, 7 | "coordinates" varchar not null, 8 | "author" varchar not null, 9 | "author_id" int not null, 10 | "deleted" varchar, 11 | "project_created_at" timestamp not null, 12 | 13 | "created_at" timestamp, 14 | "updated_at" timestamp 15 | ); 16 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-06_17:37_github_repo_source__index.sql: -------------------------------------------------------------------------------- 1 | create unique index uq__github_repo_source__external_id__source__github_repo_id 2 | on github_repo_source(external_id, source, github_repo_id); 3 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-07_20:13_hackernews_item__type__index.sql: -------------------------------------------------------------------------------- 1 | create index if not exists ix__hackernews_item__type 2 | on hackernews_item(type); 3 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-09_12:14_codexia_review.sql: -------------------------------------------------------------------------------- 1 | create table "codexia_review" 2 | ( 3 | "id" bigserial primary key, 4 | "uuid" uuid not null unique, 5 | 6 | "codexia_project_id" bigint not null references codexia_project (id), 7 | "author" varchar not null, 8 | "reason" varchar not null, 9 | "text" varchar not null, 10 | 11 | "created_at" timestamp, 12 | "updated_at" timestamp 13 | ); 14 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-09_16:18_codexia_review__index.sql: -------------------------------------------------------------------------------- 1 | create index if not exists ix__codexia_review__codexia_project_id__author__reason 2 | on codexia_review(codexia_project_id, author, reason); 3 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-09_16:19_github_repo_source__index.sql: -------------------------------------------------------------------------------- 1 | create index if not exists ix__github_repo_source__github_repo_id 2 | on github_repo_source(github_repo_id); 3 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-09_17:56_github_repo_source__deleted_at.sql: -------------------------------------------------------------------------------- 1 | alter table "github_repo_source" 2 | add column "deleted_at" timestamp; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-09_18:56_github_repo_source__recreate_unique_index.sql: -------------------------------------------------------------------------------- 1 | drop index if exists "uq__github_repo_source__external_id__source__github_repo_id"; 2 | 3 | create unique index uq__github_repo_source__source__external_id__github_repo_id 4 | on github_repo_source(source, external_id, github_repo_id); 5 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-09_19:52_hackernews_item__type__add_deleted.sql.sql: -------------------------------------------------------------------------------- 1 | alter table "hackernews_item" 2 | add column if not exists "deleted" boolean default false; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-09_19:56_hackernews_item__type__drop_default_deleted.sql.sql: -------------------------------------------------------------------------------- 1 | alter table "hackernews_item" 2 | alter column "deleted" drop default; 3 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-09_20:56_codexia_review_notification.sql: -------------------------------------------------------------------------------- 1 | create table "codexia_review_notification" 2 | ( 3 | "id" bigserial primary key, 4 | "uuid" uuid not null unique, 5 | 6 | "codexia_review_id" bigint not null references codexia_review (id), 7 | 8 | "status" varchar not null, 9 | "response_code" integer, 10 | "response" varchar, 11 | 12 | "created_at" timestamp, 13 | "updated_at" timestamp 14 | ); 15 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-03-10_21:01_codexia_review_notification__index.sql: -------------------------------------------------------------------------------- 1 | create index if not exists ix__codexia_review_notification__codexia_review_id 2 | on codexia_review_notification(codexia_review_id); 3 | 4 | create index if not exists ix__codexia_review_notification__status 5 | on codexia_review_notification(status); 6 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-04-11_21:20_stars_up_result.sql: -------------------------------------------------------------------------------- 1 | create table "stars_up_result" 2 | ( 3 | "id" bigserial primary key, 4 | "uuid" uuid not null unique, 5 | 6 | "github_repo_id" bigint not null references github_repo (id), 7 | "github_repo_stat_id" bigint not null references github_repo_stat (id), 8 | 9 | "created_at" timestamp, 10 | "updated_at" timestamp 11 | ); 12 | 13 | create index ix__stars_up_result__github_repo_id 14 | on stars_up_result (github_repo_id); 15 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-04-18_20:42_forks_up_result.sql: -------------------------------------------------------------------------------- 1 | create table "forks_up_result" 2 | ( 3 | "id" bigserial primary key, 4 | "uuid" uuid not null unique, 5 | 6 | "github_repo_id" bigint not null references github_repo (id), 7 | "github_repo_stat_id" bigint not null references github_repo_stat (id), 8 | 9 | "created_at" timestamp, 10 | "updated_at" timestamp 11 | ); 12 | 13 | create index ix__forks_up_result__github_repo_id 14 | on forks_up_result (github_repo_id); 15 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-04-20_14:58_too_many_stars_result.sql: -------------------------------------------------------------------------------- 1 | create table "too_many_stars_result" 2 | ( 3 | "id" bigserial primary key, 4 | "uuid" uuid not null unique, 5 | 6 | "github_repo_id" bigint not null references github_repo (id), 7 | "github_repo_stat_id" bigint not null references github_repo_stat (id), 8 | 9 | "created_at" timestamp, 10 | "updated_at" timestamp 11 | ); 12 | 13 | create index ix__too_many_stars_result__github_repo_id 14 | on too_many_stars_result (github_repo_id); 15 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-04-24_15:15_codexia_project__drop_author_id.sql: -------------------------------------------------------------------------------- 1 | alter table "codexia_project" drop column "author_id"; 2 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-04-29_00:15_too_small_result.sql: -------------------------------------------------------------------------------- 1 | create table "too_small_result" 2 | ( 3 | "id" bigserial primary key, 4 | "uuid" uuid not null unique, 5 | 6 | "github_repo_id" bigint not null references github_repo (id), 7 | "github_repo_stat_id" bigint not null references github_repo_stat (id), 8 | "state" varchar not null, 9 | 10 | "created_at" timestamp, 11 | "updated_at" timestamp 12 | ); 13 | 14 | create index ix__too_small_result__github_repo_id 15 | on too_small_result (github_repo_id); 16 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-05-02_15:12_github_repo_stat__index.sql: -------------------------------------------------------------------------------- 1 | drop index if exists ix__github_repo_stat__type; 2 | 3 | create index if not exists ix__github_repo_stat__type__github_repo_id 4 | on github_repo_stat(type, github_repo_id); 5 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-05-02_15:50_github_repo_source__index.sql: -------------------------------------------------------------------------------- 1 | create index if not exists ix__github_repo_source__source__deleted_at 2 | on github_repo_source(source, deleted_at); 3 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-05-03_00:20_github_repo_source__index.sql: -------------------------------------------------------------------------------- 1 | drop index if exists ix__github_repo_source__source__deleted_at; 2 | 3 | create index if not exists 4 | ix__github_repo_source__source__deleted_at 5 | on github_repo_source(source) 6 | where github_repo_source.deleted_at is null; 7 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-05-19_18:09_codexia_badge.sql: -------------------------------------------------------------------------------- 1 | create table "codexia_badge" 2 | ( 3 | "id" bigserial primary key, 4 | "uuid" uuid not null unique, 5 | 6 | "codexia_project_id" bigint not null references codexia_project (id), 7 | "badge" varchar not null, 8 | 9 | "created_at" timestamp, 10 | "updated_at" timestamp, 11 | "deleted_at" timestamp 12 | ); 13 | 14 | create unique index uq__codexia_badge__project__badge 15 | on codexia_badge ("codexia_project_id", "badge"); 16 | -------------------------------------------------------------------------------- /src/main/resources/db/changelog/sql/2020-05-20_23:19_codexia_project__add_badges.sql: -------------------------------------------------------------------------------- 1 | alter table "codexia_project" add column badges text; 2 | -------------------------------------------------------------------------------- /src/main/resources/sentry.properties: -------------------------------------------------------------------------------- 1 | stacktrace.app.packages=dev.iakunin.codexiabot 2 | -------------------------------------------------------------------------------- /src/test/java/dev/iakunin/codexiabot/common/runnable/LoggingTest.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.common.runnable; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.mockito.InOrder; 5 | import org.mockito.Mockito; 6 | import org.slf4j.Logger; 7 | 8 | public class LoggingTest { 9 | 10 | @Test 11 | public void run() { 12 | final Logger logger = Mockito.mock(Logger.class); 13 | 14 | new Logging(() -> { }, logger).run(); 15 | 16 | final InOrder order = Mockito.inOrder(logger); 17 | order.verify(logger).debug( 18 | Mockito.eq("Running {}"), 19 | Mockito.any(String.class) 20 | ); 21 | order.verify(logger).debug( 22 | Mockito.eq("Exiting from {}"), 23 | Mockito.any(String.class) 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/java/dev/iakunin/codexiabot/config/GithubConfig.java: -------------------------------------------------------------------------------- 1 | package dev.iakunin.codexiabot.config; 2 | 3 | import dev.iakunin.codexiabot.CodexiaBotApplication; 4 | import dev.iakunin.codexiabot.util.WireMockWrapper; 5 | import lombok.SneakyThrows; 6 | import org.kohsuke.github.GitHub; 7 | import org.kohsuke.github.GitHubBuilder; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | import org.springframework.context.annotation.Import; 11 | 12 | /** 13 | * @checkstyle DesignForExtension (500 lines) 14 | */ 15 | @Configuration 16 | @Import(CodexiaBotApplication.class) 17 | public class GithubConfig { 18 | @SneakyThrows 19 | @Bean 20 | public GitHub gitHub() { 21 | return new GitHubBuilder() 22 | .withEndpoint( 23 | new WireMockWrapper().baseUrl() + "/github" 24 | ).build(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up-transaction/expected/transactionRollback.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithOneEmptyAndOneNonEmptyStat.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithOneStat.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithThreeStats_forksIncreaseLessThan10.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithThreeStats_forksIncreaseMoreThan10ButLessThan5Percents.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithThreeStats_happyPath.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 4 5 | 6 | codexia_review: 7 | - 8 | codexia_project_id: 6 9 | author: "FORKS_UP" 10 | reason: "473" 11 | text: >- 12 | The repo gained 71 forks (from 402 to 473) in 1 week. 13 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithTwoEmptyStats.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithTwoStats_forksDecrease.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithTwoStats_forksIncreaseLessThan10.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithTwoStats_forksIncreaseMoreThan10ButLessThan5Percents.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithTwoStats_happyPath.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: 7 | - 8 | codexia_project_id: 5 9 | author: "FORKS_UP" 10 | reason: "459" 11 | text: >- 12 | The repo gained 57 forks (from 402 to 459) in 5 days. 13 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithTwoStats_withTwoEqualForks.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/noResults_githubRepoWithoutStat.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/oneResult_forksDecrease.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: [] 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/oneResult_forksIncreaseLessThan10.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: [] 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/oneResult_forksIncreaseMoreThan10ButLessThan5Percents.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: [] 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/oneResult_githubRepoWithFourStats_happyPath.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | - 6 | github_repo_id: 1 7 | github_repo_stat_id: 5 8 | 9 | codexia_review: 10 | - 11 | codexia_project_id: 5 12 | author: "FORKS_UP" 13 | reason: "528" 14 | text: >- 15 | The repo gained 69 forks (from 459 to 528) in 3 hours. 16 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/oneResult_githubRepoWithThreeStats_happyPath.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | - 6 | github_repo_id: 1 7 | github_repo_stat_id: 4 8 | 9 | codexia_review: 10 | - 11 | codexia_project_id: 5 12 | author: "FORKS_UP" 13 | reason: "502" 14 | text: >- 15 | The repo gained 43 forks (from 459 to 502) in 25 minutes. 16 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/expected/oneResult_noNewGithubStats.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: [] 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | 5 | forks_up_result: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/initial/noResults_githubRepoWithOneEmptyAndOneNonEmptyStat.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | stat: '{"type": "GITHUB_API", "stars": 111}' 23 | - 24 | id: 2 25 | uuid: "groovy: UUID.randomUUID().toString()" 26 | github_repo_id: 1 27 | type: "GITHUB_API" 28 | 29 | forks_up_result: [] 30 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/initial/noResults_githubRepoWithOneStat.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | 23 | forks_up_result: [] 24 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/initial/noResults_githubRepoWithTwoEmptyStats.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | - 23 | id: 2 24 | uuid: "groovy: UUID.randomUUID().toString()" 25 | github_repo_id: 1 26 | type: "GITHUB_API" 27 | 28 | forks_up_result: [] 29 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/initial/noResults_githubRepoWithTwoStats_forksDecrease.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | stat: '{"type": "GITHUB_API", "forks": 123}' 23 | - 24 | id: 2 25 | uuid: "groovy: UUID.randomUUID().toString()" 26 | github_repo_id: 1 27 | type: "GITHUB_API" 28 | stat: '{"type": "GITHUB_API", "forks": 99}' 29 | 30 | forks_up_result: [] 31 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/initial/noResults_githubRepoWithTwoStats_forksIncreaseLessThan10.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | stat: '{"type": "GITHUB_API", "forks": 123}' 23 | - 24 | id: 2 25 | uuid: "groovy: UUID.randomUUID().toString()" 26 | github_repo_id: 1 27 | type: "GITHUB_API" 28 | stat: '{"type": "GITHUB_API", "forks": 132}' 29 | 30 | forks_up_result: [] 31 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/initial/noResults_githubRepoWithTwoStats_withTwoEqualForks.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | stat: '{"type": "GITHUB_API", "forks": 123}' 23 | - 24 | id: 2 25 | uuid: "groovy: UUID.randomUUID().toString()" 26 | github_repo_id: 1 27 | type: "GITHUB_API" 28 | stat: '{"type": "GITHUB_API", "forks": 123}' 29 | 30 | forks_up_result: [] 31 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/forks-up/initial/noResults_githubRepoWithoutStat.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: [] 17 | 18 | forks_up_result: [] 19 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-hackernews/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_review: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-hackernews/expected/happyPath.yml: -------------------------------------------------------------------------------- 1 | codexia_review: 2 | - 3 | codexia_project_id: 5 4 | author: "FOUND_ON_HACKERNEWS" 5 | reason: "99912" 6 | text: >- 7 | This project is found on Hackernews (45 upvotes): 8 | [web link](https://news.ycombinator.com/item?id=99912), 9 | [api link](https://hacker-news.firebaseio.com/v0/item/99912.json). 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-hackernews/expected/happyPathNoUpvotes.yml: -------------------------------------------------------------------------------- 1 | codexia_review: 2 | - 3 | codexia_project_id: 5 4 | author: "FOUND_ON_HACKERNEWS" 5 | reason: "99912" 6 | text: >- 7 | This project is found on Hackernews (0 upvotes): 8 | [web link](https://news.ycombinator.com/item?id=99912), 9 | [api link](https://hacker-news.firebaseio.com/v0/item/99912.json). 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-hackernews/expected/onlyCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | codexia_review: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-hackernews/expected/onlyHackernewsSource.yml: -------------------------------------------------------------------------------- 1 | codexia_review: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-hackernews/expected/reviewExists.yml: -------------------------------------------------------------------------------- 1 | codexia_review: 2 | - 3 | id: 1 4 | codexia_project_id: 5 5 | author: "FOUND_ON_HACKERNEWS" 6 | reason: "99912" 7 | text: >- 8 | This project is found on Hackernews: 9 | [web link](https://news.ycombinator.com/item?id=99912), 10 | [api link](https://hacker-news.firebaseio.com/v0/item/99912.json). 11 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-hackernews/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | codexia_project: [] 4 | 5 | github_repo_source: [] 6 | 7 | codexia_review: [] 8 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-hackernews/initial/onlyCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | codexia_project: 9 | - 10 | id: 5 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | external_id: 12 13 | coordinates: "test-project1/test-repo1" 14 | author: "some-first-author" 15 | deleted: null 16 | project_created_at: "2019-12-20 12:01:02" 17 | 18 | github_repo_source: 19 | - 20 | id: 1 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | github_repo_id: 1 23 | source: "CODEXIA" 24 | external_id: "12" 25 | 26 | codexia_review: [] 27 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-hackernews/initial/onlyHackernewsSource.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | codexia_project: 9 | - 10 | id: 5 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | external_id: 12 13 | coordinates: "test-project1/test-repo1" 14 | author: "some-first-author" 15 | deleted: null 16 | project_created_at: "2019-12-20 12:01:02" 17 | 18 | github_repo_source: 19 | - 20 | id: 1 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | github_repo_id: 1 23 | source: "HACKERNEWS" 24 | external_id: "431222" 25 | 26 | codexia_review: [] 27 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-reddit/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_review: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-reddit/expected/happyPath.yml: -------------------------------------------------------------------------------- 1 | codexia_review: 2 | - 3 | codexia_project_id: 5 4 | author: "FOUND_ON_REDDIT" 5 | reason: "6zzom9" 6 | text: >- 7 | This project is found on Reddit: 8 | [web link](https://www.reddit.com/comments/6zzom9), 9 | [api link](https://www.reddit.com/api/info.json?id=t3_6zzom9). 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-reddit/expected/onlyCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | codexia_review: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-reddit/expected/onlyRedditSource.yml: -------------------------------------------------------------------------------- 1 | codexia_review: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-reddit/expected/reviewExists.yml: -------------------------------------------------------------------------------- 1 | codexia_review: 2 | - 3 | id: 1 4 | codexia_project_id: 5 5 | author: "FOUND_ON_REDDIT" 6 | reason: "9xsr9i" 7 | text: >- 8 | This project is found on Reddit: 9 | [web link](https://www.reddit.com/comments/9xsr9i), 10 | [api link](https://www.reddit.com/api/info.json?id=t3_9xsr9i). 11 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-reddit/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | codexia_project: [] 4 | 5 | github_repo_source: [] 6 | 7 | codexia_review: [] 8 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-reddit/initial/onlyCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | codexia_project: 9 | - 10 | id: 5 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | external_id: 12 13 | coordinates: "test-project1/test-repo1" 14 | author: "some-first-author" 15 | deleted: null 16 | project_created_at: "2019-12-20 12:01:02" 17 | 18 | github_repo_source: 19 | - 20 | id: 1 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | github_repo_id: 1 23 | source: "CODEXIA" 24 | external_id: "12" 25 | 26 | codexia_review: [] 27 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/found-on-reddit/initial/onlyRedditSource.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | codexia_project: 9 | - 10 | id: 5 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | external_id: 12 13 | coordinates: "test-project1/test-repo1" 14 | author: "some-first-author" 15 | deleted: null 16 | project_created_at: "2019-12-20 12:01:02" 17 | 18 | github_repo_source: 19 | - 20 | id: 1 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | github_repo_id: 1 23 | source: "REDDIT" 24 | external_id: "ab1c2d" 25 | 26 | codexia_review: [] 27 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/not-small/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | too_small_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/not-small/expected/happyPath.yml: -------------------------------------------------------------------------------- 1 | too_small_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 4 5 | state: SET 6 | - 7 | github_repo_id: 1 8 | github_repo_stat_id: 6 9 | state: RESET 10 | 11 | codexia_review: 12 | - 13 | codexia_project_id: 6 14 | author: "TOO_SMALL" 15 | reason: "3533" 16 | text: The repo is too small (LoC is 3533). 17 | - 18 | codexia_project_id: 6 19 | author: "TOO_SMALL" 20 | reason: "5000" 21 | text: The repo is not small anymore (LoC is 5000). 22 | 23 | codexia_badge: 24 | - 25 | codexia_project_id: 6 26 | badge: bad 27 | deleted_at: regex:^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{1,6}$ 28 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/not-small/expected/linesOfCodeLessThanThreshold.yml: -------------------------------------------------------------------------------- 1 | too_small_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 4 5 | state: SET 6 | 7 | codexia_review: 8 | - 9 | codexia_project_id: 6 10 | author: "TOO_SMALL" 11 | reason: "3533" 12 | text: The repo is too small (LoC is 3533). 13 | 14 | codexia_badge: [] 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/not-small/expected/noResult.yml: -------------------------------------------------------------------------------- 1 | too_small_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/not-small/expected/projectLevelMoreThanZero.yml: -------------------------------------------------------------------------------- 1 | too_small_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/not-small/expected/resultWithTypeReset.yml: -------------------------------------------------------------------------------- 1 | too_small_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 4 5 | state: RESET 6 | 7 | codexia_review: 8 | - 9 | codexia_project_id: 6 10 | author: "TOO_SMALL" 11 | reason: "3533" 12 | text: The repo is too small (LoC is 3533). 13 | 14 | codexia_badge: [] 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/not-small/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | 5 | github_repo_stat: [] 6 | 7 | too_small_result: [] 8 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/not-small/initial/noResult.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | codexia_project: 9 | - 10 | id: 6 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | external_id: 12 13 | coordinates: "test-project1/test-repo1" 14 | author: "some-first-author" 15 | project_created_at: "2019-12-20 12:01:02" 16 | badges: "newbie" 17 | 18 | github_repo_source: 19 | - 20 | id: 1 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | github_repo_id: 1 23 | source: "CODEXIA" 24 | external_id: "12" 25 | 26 | github_repo_stat: [] 27 | 28 | too_small_result: [] 29 | 30 | codexia_review: [] 31 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/not-small/initial/projectLevelMoreThanZero.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | codexia_project: 9 | - 10 | id: 6 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | external_id: 12 13 | coordinates: "test-project1/test-repo1" 14 | author: "some-first-author" 15 | project_created_at: "2019-12-20 12:01:02" 16 | badges: "L1" 17 | 18 | github_repo_source: 19 | - 20 | id: 1 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | github_repo_id: 1 23 | source: "CODEXIA" 24 | external_id: "12" 25 | 26 | github_repo_stat: [] 27 | 28 | too_small_result: [] 29 | 30 | codexia_review: [] 31 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithOneEmptyAndOneNonEmptyStat.yml: -------------------------------------------------------------------------------- 1 | forks_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithOneStat.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithThreeStats_happyPath.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 4 5 | 6 | codexia_review: 7 | - 8 | codexia_project_id: 6 9 | author: "STARS_UP" 10 | reason: "473" 11 | text: >- 12 | The repo gained 71 stars (from 402 to 473) in 1 week. 13 | See the stars history 14 | [here](https://star-history.t9t.io/#test-project1/test-repo1). 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithThreeStats_starsIncreaseLessThan10.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithThreeStats_starsIncreaseMoreThan10ButLessThan5Percents.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithTwoEmptyStats.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithTwoStats_happyPath.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: 7 | - 8 | codexia_project_id: 5 9 | author: "STARS_UP" 10 | reason: "459" 11 | text: >- 12 | The repo gained 57 stars (from 402 to 459) in 5 days. 13 | See the stars history 14 | [here](https://star-history.t9t.io/#test-project1/test-repo1). 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithTwoStats_starsDecrease.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithTwoStats_starsIncreaseLessThan10.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithTwoStats_starsIncreaseMoreThan10ButLessThan5Percents.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithTwoStats_withTwoEqualStars.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/noResults_githubRepoWithoutStat.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/oneResult_githubRepoWithFourStats_happyPath.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | - 6 | github_repo_id: 1 7 | github_repo_stat_id: 5 8 | 9 | codexia_review: 10 | - 11 | codexia_project_id: 5 12 | author: "STARS_UP" 13 | reason: "528" 14 | text: >- 15 | The repo gained 69 stars (from 459 to 528) in 3 hours. 16 | See the stars history 17 | [here](https://star-history.t9t.io/#test-project1/test-repo1). 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/oneResult_githubRepoWithThreeStats_happyPath.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | - 6 | github_repo_id: 1 7 | github_repo_stat_id: 4 8 | 9 | codexia_review: 10 | - 11 | codexia_project_id: 5 12 | author: "STARS_UP" 13 | reason: "502" 14 | text: >- 15 | The repo gained 43 stars (from 459 to 502) in 25 minutes. 16 | See the stars history 17 | [here](https://star-history.t9t.io/#test-project1/test-repo1). 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/oneResult_noNewGithubStats.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: [] 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/oneResult_starsDecrease.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: [] 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/oneResult_starsIncreaseLessThan10.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: [] 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/expected/oneResult_starsIncreaseMoreThan10ButLessThan5Percents.yml: -------------------------------------------------------------------------------- 1 | stars_up_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: [] 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | 5 | stars_up_result: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/initial/noResults_githubRepoWithOneEmptyAndOneNonEmptyStat.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | stat: '{"type": "GITHUB_API", "stars": 111}' 23 | - 24 | id: 2 25 | uuid: "groovy: UUID.randomUUID().toString()" 26 | github_repo_id: 1 27 | type: "GITHUB_API" 28 | 29 | forks_up_result: [] 30 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/initial/noResults_githubRepoWithOneStat.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | 23 | stars_up_result: [] 24 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/initial/noResults_githubRepoWithTwoEmptyStats.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | - 23 | id: 2 24 | uuid: "groovy: UUID.randomUUID().toString()" 25 | github_repo_id: 1 26 | type: "GITHUB_API" 27 | 28 | stars_up_result: [] 29 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/initial/noResults_githubRepoWithTwoStats_starsDecrease.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | stat: '{"type": "GITHUB_API", "stars": 123}' 23 | - 24 | id: 2 25 | uuid: "groovy: UUID.randomUUID().toString()" 26 | github_repo_id: 1 27 | type: "GITHUB_API" 28 | stat: '{"type": "GITHUB_API", "stars": 99}' 29 | 30 | stars_up_result: [] 31 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/initial/noResults_githubRepoWithTwoStats_starsIncreaseLessThan10.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | stat: '{"type": "GITHUB_API", "stars": 123}' 23 | - 24 | id: 2 25 | uuid: "groovy: UUID.randomUUID().toString()" 26 | github_repo_id: 1 27 | type: "GITHUB_API" 28 | stat: '{"type": "GITHUB_API", "stars": 132}' 29 | 30 | stars_up_result: [] 31 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/initial/noResults_githubRepoWithTwoStats_withTwoEqualStars.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | stat: '{"type": "GITHUB_API", "stars": 123}' 23 | - 24 | id: 2 25 | uuid: "groovy: UUID.randomUUID().toString()" 26 | github_repo_id: 1 27 | type: "GITHUB_API" 28 | stat: '{"type": "GITHUB_API", "stars": 123}' 29 | 30 | stars_up_result: [] 31 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/stars-up/initial/noResults_githubRepoWithoutStat.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: [] 17 | 18 | stars_up_result: [] 19 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars-transaction/expected/transactionRollback.yml: -------------------------------------------------------------------------------- 1 | too_many_stars_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | too_many_stars_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/expected/noResults_githubRepoWithOneEmptyStat.yml: -------------------------------------------------------------------------------- 1 | too_many_stars_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/expected/noResults_githubRepoWithOneStat_aboveThreshold.yml: -------------------------------------------------------------------------------- 1 | too_many_stars_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 2 5 | 6 | codexia_review: 7 | - 8 | codexia_project_id: 5 9 | author: "TOO_MANY_STARS" 10 | reason: "10023" 11 | text: >- 12 | The repo gained too many stars: 10023. 13 | 14 | codexia_badge: 15 | - 16 | codexia_project_id: 5 17 | badge: bad 18 | deleted_at: null 19 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/expected/noResults_githubRepoWithOneStat_belowThreshold.yml: -------------------------------------------------------------------------------- 1 | too_many_stars_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/expected/noResults_githubRepoWithTwoStats_aboveThreshold.yml: -------------------------------------------------------------------------------- 1 | too_many_stars_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: 7 | - 8 | codexia_project_id: 5 9 | author: "TOO_MANY_STARS" 10 | reason: "10111" 11 | text: >- 12 | The repo gained too many stars: 10111. 13 | 14 | codexia_badge: 15 | - 16 | codexia_project_id: 5 17 | badge: bad 18 | deleted_at: null 19 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/expected/noResults_githubRepoWithTwoStats_belowThreshold.yml: -------------------------------------------------------------------------------- 1 | too_many_stars_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/expected/noResults_githubRepoWithoutStat.yml: -------------------------------------------------------------------------------- 1 | too_many_stars_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/expected/oneResult_noNewGithubStats.yml: -------------------------------------------------------------------------------- 1 | too_many_stars_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: [] 7 | 8 | codexia_badge: [] 9 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/expected/oneResult_oneNewGithubStat.yml: -------------------------------------------------------------------------------- 1 | too_many_stars_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: [] 7 | 8 | codexia_badge: [] 9 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/expected/oneResult_twoNewGithubStats.yml: -------------------------------------------------------------------------------- 1 | too_many_stars_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 3 5 | 6 | codexia_review: [] 7 | 8 | codexia_badge: [] 9 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | 5 | too_many_stars_result: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/initial/noResults_githubRepoWithOneEmptyStat.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | 23 | too_many_stars_result: [] 24 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/initial/noResults_githubRepoWithOneStat_belowThreshold.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | stat: '{"type": "GITHUB_API", "stars": 123}' 23 | 24 | too_many_stars_result: [] 25 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/initial/noResults_githubRepoWithTwoStats_belowThreshold.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: 17 | - 18 | id: 1 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | stat: '{"type": "GITHUB_API", "stars": 123}' 23 | - 24 | id: 2 25 | uuid: "groovy: UUID.randomUUID().toString()" 26 | github_repo_id: 1 27 | type: "GITHUB_API" 28 | stat: '{"type": "GITHUB_API", "stars": 678}' 29 | 30 | too_many_stars_result: [] 31 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-many-stars/initial/noResults_githubRepoWithoutStat.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_source: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | source: "CODEXIA" 14 | external_id: "12" 15 | 16 | github_repo_stat: [] 17 | 18 | too_many_stars_result: [] 19 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small-transaction/expected/transactionRollback.yml: -------------------------------------------------------------------------------- 1 | too_small_result: [] 2 | 3 | codexia_review: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | too_small_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/expected/githubLanguageIsNull.yml: -------------------------------------------------------------------------------- 1 | too_small_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/expected/githubStatIsAbsent.yml: -------------------------------------------------------------------------------- 1 | too_small_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/expected/happyPath.yml: -------------------------------------------------------------------------------- 1 | too_small_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 4 5 | state: SET 6 | 7 | codexia_review: 8 | - 9 | codexia_project_id: 6 10 | author: "TOO_SMALL" 11 | reason: "3533" 12 | text: The repo is too small (LoC is 3533). 13 | 14 | codexia_badge: 15 | - 16 | codexia_project_id: 6 17 | badge: bad 18 | deleted_at: null 19 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/expected/linesOfCodeIsAbsent.yml: -------------------------------------------------------------------------------- 1 | too_small_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/expected/moreThanThreshold.yml: -------------------------------------------------------------------------------- 1 | too_small_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/expected/notInCodexia.yml: -------------------------------------------------------------------------------- 1 | too_small_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/expected/oneResetResult.yml: -------------------------------------------------------------------------------- 1 | too_small_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 4 5 | state: RESET 6 | 7 | codexia_review: 8 | - 9 | codexia_project_id: 6 10 | author: "TOO_SMALL" 11 | reason: "3533" 12 | text: The repo is not small anymore (LoC is 6666). 13 | 14 | codexia_badge: [] 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/expected/oneSetResult.yml: -------------------------------------------------------------------------------- 1 | too_small_result: 2 | - 3 | github_repo_id: 1 4 | github_repo_stat_id: 4 5 | state: SET 6 | 7 | codexia_review: 8 | - 9 | codexia_project_id: 6 10 | author: "TOO_SMALL" 11 | reason: "3533" 12 | text: The repo is too small (LoC is 3533). 13 | 14 | codexia_badge: [] 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/expected/projectLevelMoreThanZero.yml: -------------------------------------------------------------------------------- 1 | too_small_result: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_badge: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | 5 | github_repo_stat: [] 6 | 7 | too_small_result: [] 8 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/initial/notInCodexia.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | codexia_project: [] 9 | 10 | github_repo_source: 11 | - 12 | id: 1 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | github_repo_id: 1 15 | source: "REDDIT" 16 | external_id: "aabbcc" 17 | 18 | github_repo_stat: [] 19 | 20 | too_small_result: [] 21 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/bot/too-small/initial/projectLevelMoreThanZero.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | codexia_project: 9 | - 10 | id: 6 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | external_id: 12 13 | coordinates: "test-project1/test-repo1" 14 | author: "some-first-author" 15 | project_created_at: "2019-12-20 12:01:02" 16 | badges: "L2" 17 | 18 | github_repo_source: 19 | - 20 | id: 1 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | github_repo_id: 1 23 | source: "CODEXIA" 24 | external_id: "12" 25 | 26 | github_repo_stat: [] 27 | 28 | too_small_result: [] 29 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/codexia-parser/expected/codexiaProjectAlreadyExist.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | external_id: 1662 4 | coordinates: "casbin/casbin-rs" 5 | author: "iakunin" 6 | deleted: null 7 | project_created_at: "2020-05-05 10:29:21" 8 | 9 | github_repo: [] 10 | 11 | github_repo_source: [] 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/codexia-parser/expected/deletedProject.yml: -------------------------------------------------------------------------------- 1 | codexia_project: [] 2 | 3 | github_repo: [] 4 | 5 | github_repo_source: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/codexia-parser/expected/happyPathWithGithub.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | external_id: 1662 4 | coordinates: "casbin/casbin-rs" 5 | author: "iakunin" 6 | deleted: null 7 | project_created_at: "2020-05-05 10:29:21" 8 | 9 | github_repo: 10 | - 11 | external_id: "202275988" 12 | full_name: "casbin/casbin-rs" 13 | html_url: "https://github.com/casbin/casbin-rs" 14 | repo_created_at: "2019-08-14 04:42:36" 15 | 16 | github_repo_source: 17 | - 18 | source: "CODEXIA" 19 | external_id: "1662" 20 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/codexia-parser/expected/happyPathWithoutGithub.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | external_id: 1662 4 | coordinates: "casbin/casbin-rs" 5 | author: "iakunin" 6 | deleted: null 7 | project_created_at: "2020-05-05 10:29:21" 8 | 9 | github_repo: [] 10 | 11 | github_repo_source: [] 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/codexia-parser/initial/codexiaProjectAlreadyExist.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | uuid: "groovy: UUID.randomUUID().toString()" 4 | external_id: 1662 5 | coordinates: "casbin/casbin-rs" 6 | author: "iakunin" 7 | deleted: null 8 | project_created_at: "2020-05-05 10:29:21" 9 | 10 | github_repo: [] 11 | 12 | github_repo_source: [] 13 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/codexia-parser/initial/deletedProject.yml: -------------------------------------------------------------------------------- 1 | codexia_project: [] 2 | 3 | github_repo: [] 4 | 5 | github_repo_source: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/codexia-parser/initial/happyPathWithGithub.yml: -------------------------------------------------------------------------------- 1 | codexia_project: [] 2 | 3 | github_repo: [] 4 | 5 | github_repo_source: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/codexia-parser/initial/happyPathWithoutGithub.yml: -------------------------------------------------------------------------------- 1 | codexia_project: [] 2 | 3 | github_repo: [] 4 | 5 | github_repo_source: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/delete-obsolete-notifications/expected/deletedOneNotificationPerOneReview.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: SUCCESS 5 | response_code: 200 6 | response: OK 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/delete-obsolete-notifications/expected/deletedOneNotificationPerTwoReviews.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: SUCCESS 5 | response_code: 201 6 | response: OK321 7 | - 8 | codexia_review_id: 3 9 | status: SUCCESS 10 | response_code: 201 11 | response: OK123 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/delete-obsolete-notifications/expected/deletedTwoNotificationsPerOneReview.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: SUCCESS 5 | response_code: 200 6 | response: OK 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/delete-obsolete-notifications/expected/deletedTwoNotificationsPerTwoReviews.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: SUCCESS 5 | response_code: 201 6 | response: OK321 7 | - 8 | codexia_review_id: 3 9 | status: SUCCESS 10 | response_code: 201 11 | response: OK123 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/delete-obsolete-notifications/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/delete-obsolete-notifications/expected/nothingToDeleteOneReview.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: ERROR 5 | response_code: 500 6 | response: "" 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/delete-obsolete-notifications/expected/nothingToDeleteTwoReviews.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: ERROR 5 | response_code: 500 6 | response: "" 7 | - 8 | codexia_review_id: 3 9 | status: ERROR 10 | response_code: 500 11 | response: "" 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/delete-obsolete-notifications/expected/unableToDelete.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: ERROR 5 | response_code: 500 6 | response: "" 7 | - 8 | codexia_review_id: 2 9 | status: SUCCESS 10 | response_code: 200 11 | response: OK 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/delete-obsolete-notifications/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/delete-obsolete-notifications/initial/nothingToDeleteOneReview.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 1222 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | project_created_at: "2019-12-20 12:01:02" 9 | 10 | codexia_review: 11 | - 12 | id: 2 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | author: Review author 16 | reason: Review reason 17 | text: Review text 18 | 19 | codexia_review_notification: 20 | - 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | codexia_review_id: 2 23 | status: ERROR 24 | response_code: 500 25 | response: "" 26 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/missing-filler/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_project: [] 2 | 3 | github_repo_source: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/missing-filler/expected/oneDeletedWithoutGithubRepo.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | external_id: 1662 4 | coordinates: "instaloader/instaloader" 5 | author: "iakunin" 6 | deleted: "deleted" 7 | project_created_at: "2020-05-05 10:29:21" 8 | 9 | github_repo: [] 10 | 11 | github_repo_source: [] 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/missing-filler/expected/oneWithGithubRepo.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | external_id: 1662 4 | coordinates: "test-project1/test-repo1" 5 | author: "iakunin" 6 | deleted: null 7 | project_created_at: "2020-05-05 10:29:21" 8 | 9 | github_repo: 10 | - 11 | external_id: "150713223" 12 | full_name: "test-project1/test-repo1" 13 | 14 | github_repo_source: 15 | - 16 | github_repo_id: 1 17 | source: "CODEXIA" 18 | external_id: "1662" 19 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/missing-filler/expected/oneWithoutGithubRepo.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | external_id: 1662 4 | coordinates: "instaloader/instaloader" 5 | author: "iakunin" 6 | deleted: null 7 | project_created_at: "2020-05-05 10:29:21" 8 | 9 | github_repo: 10 | - 11 | external_id: "61200117" 12 | full_name: "instaloader/instaloader" 13 | html_url: "https://github.com/instaloader/instaloader" 14 | 15 | github_repo_source: 16 | - 17 | source: "CODEXIA" 18 | external_id: "1662" 19 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/missing-filler/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_project: [] 2 | 3 | github_repo_source: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/missing-filler/initial/oneDeletedWithoutGithubRepo.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | uuid: "groovy: UUID.randomUUID().toString()" 4 | external_id: 1662 5 | coordinates: "instaloader/instaloader" 6 | author: "iakunin" 7 | deleted: "deleted" 8 | project_created_at: "2020-05-05 10:29:21" 9 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/missing-filler/initial/oneWithGithubRepo.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | uuid: "groovy: UUID.randomUUID().toString()" 4 | external_id: 1662 5 | coordinates: "test-project1/test-repo1" 6 | author: "iakunin" 7 | deleted: null 8 | project_created_at: "2020-05-05 10:29:21" 9 | 10 | github_repo: 11 | - 12 | id: 1 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | external_id: "150713223" 15 | full_name: "test-project1/test-repo1" 16 | 17 | github_repo_source: 18 | - 19 | id: 1 20 | uuid: "groovy: UUID.randomUUID().toString()" 21 | github_repo_id: 1 22 | source: "CODEXIA" 23 | external_id: "1662" 24 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/missing-filler/initial/oneWithoutGithubRepo.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | uuid: "groovy: UUID.randomUUID().toString()" 4 | external_id: 1662 5 | coordinates: "instaloader/instaloader" 6 | author: "iakunin" 7 | deleted: null 8 | project_created_at: "2020-05-05 10:29:21" 9 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/missing-filler/initial/twoWithoutGithubRepo.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | uuid: "groovy: UUID.randomUUID().toString()" 4 | external_id: 1662 5 | coordinates: "instaloader/instaloader" 6 | author: "iakunin" 7 | deleted: null 8 | project_created_at: "2020-05-05 10:29:21" 9 | - 10 | uuid: "groovy: UUID.randomUUID().toString()" 11 | external_id: 1999 12 | coordinates: "arpit9667/algorithms-js" 13 | author: "iakunin" 14 | deleted: null 15 | project_created_at: "2020-05-07 11:06:40" 16 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/projects-health-check/expected/noActiveProjectsInRepo.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 1 4 | deleted: "deleted1" 5 | - 6 | id: 2 7 | deleted: "deleted2" 8 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/projects-health-check/expected/oneSuccessAfterOneException.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 1 4 | deleted: null 5 | badges: null 6 | - 7 | id: 2 8 | deleted: "deleted by someone" 9 | badges: "newbie,L1" 10 | 11 | github_repo_source: 12 | - 13 | id: 1 14 | deleted_at: null 15 | - 16 | id: 2 17 | deleted_at: regex:^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{1,6}$ 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/projects-health-check/expected/twoActiveProjectsInRepoButDeletedInCodexia.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 1 4 | deleted: "deleted by someone" 5 | badges: "newbie,L1" 6 | - 7 | id: 2 8 | deleted: "deleted by someone" 9 | badges: "newbie,L1" 10 | 11 | github_repo_source: 12 | - 13 | id: 1 14 | deleted_at: regex:^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{1,6}$ 15 | - 16 | id: 2 17 | deleted_at: regex:^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{1,6}$ 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/projects-health-check/initial/noActiveProjectsInRepo.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 12 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | deleted: "deleted1" 9 | project_created_at: "2019-12-20 12:01:02" 10 | created_at: "2019-12-21 15:00:00" 11 | updated_at: "2019-12-21 15:00:00" 12 | - 13 | id: 2 14 | uuid: "groovy: UUID.randomUUID().toString()" 15 | external_id: 34 16 | coordinates: "test-project2/test-repo2" 17 | author: "some-second-author" 18 | deleted: "deleted2" 19 | project_created_at: "2019-11-22 10:01:02" 20 | created_at: "2019-12-21 15:00:00" 21 | updated_at: "2019-12-21 15:00:00" 22 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-erroneous/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-erroneous/expected/noErroneous.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: "SUCCESS" 5 | response_code: 200 6 | response: "Successfully sent" 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-erroneous/expected/oneErroneous.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: "ERROR" 5 | response_code: 500 6 | response: "" 7 | - 8 | codexia_review_id: 2 9 | status: "SUCCESS" 10 | response_code: 200 11 | response: "regex:^<200 OK OK,Review successfully sent.*" 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-erroneous/expected/oneSuccessfulOneErroneous.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: "SUCCESS" 5 | response_code: 500 6 | response: "" 7 | - 8 | codexia_review_id: 3 9 | status: "ERROR" 10 | response_code: 500 11 | response: "" 12 | - 13 | codexia_review_id: 3 14 | status: "SUCCESS" 15 | response_code: 200 16 | response: "regex:^<200 OK OK,Review successfully sent.*" 17 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-erroneous/expected/reviewSentWith500.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: "ERROR" 5 | response_code: 500 6 | response: "" 7 | - 8 | codexia_review_id: 2 9 | status: "ERROR" 10 | response_code: 500 11 | response: "" 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-erroneous/expected/twoErroneous.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 2 4 | status: "ERROR" 5 | response_code: 500 6 | response: "" 7 | - 8 | codexia_review_id: 3 9 | status: "ERROR" 10 | response_code: 500 11 | response: "" 12 | - 13 | codexia_review_id: 2 14 | status: "SUCCESS" 15 | response_code: 200 16 | response: "regex:^<200 OK OK,Review successfully sent.*" 17 | - 18 | codexia_review_id: 3 19 | status: "SUCCESS" 20 | response_code: 200 21 | response: "regex:^<200 OK OK,Review successfully sent.*" 22 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-erroneous/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_project: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_review_notification: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-erroneous/initial/noErroneous.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 1222 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | project_created_at: "2019-12-20 12:01:02" 9 | 10 | codexia_review: 11 | - 12 | id: 2 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | author: Review author 16 | reason: Review reason 17 | text: Review text 18 | 19 | codexia_review_notification: 20 | - 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | codexia_review_id: 2 23 | status: "SUCCESS" 24 | response_code: 200 25 | response: "Successfully sent" 26 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-erroneous/initial/oneErroneous.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 1222 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | project_created_at: "2019-12-20 12:01:02" 9 | 10 | codexia_review: 11 | - 12 | id: 2 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | author: Review author 16 | reason: Review reason 17 | text: Review text 18 | 19 | codexia_review_notification: 20 | - 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | codexia_review_id: 2 23 | status: "ERROR" 24 | response_code: 500 25 | response: "" 26 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-reviews-until-duplicated/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_project: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_review_notification: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-reviews-until-duplicated/expected/happyPath.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 1 4 | status: SUCCESS 5 | response_code: 200 6 | response: Some response 7 | - 8 | codexia_review_id: 1 9 | status: SUCCESS 10 | response_code: 404 11 | response: "Review already exists." 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-reviews-until-duplicated/expected/oneSuccessfulNotificationWithDuplicatedCode.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 1 4 | status: SUCCESS 5 | response_code: 404 6 | response: Some response 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-reviews-until-duplicated/expected/oneUnsuccessfulNotification.yml: -------------------------------------------------------------------------------- 1 | codexia_review_notification: 2 | - 3 | codexia_review_id: 1 4 | status: ERROR 5 | response_code: 500 6 | response: Some response 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-reviews-until-duplicated/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_project: [] 2 | 3 | codexia_review: [] 4 | 5 | codexia_review_notification: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-reviews-until-duplicated/initial/happyPath.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 12 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | project_created_at: "2019-12-20 12:01:02" 9 | 10 | codexia_review: 11 | - 12 | id: 1 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | author: Review author 16 | reason: Review reason 17 | text: Review text 18 | 19 | codexia_review_notification: 20 | - 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | codexia_review_id: 1 23 | status: SUCCESS 24 | response_code: 200 25 | response: Some response 26 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-reviews-until-duplicated/initial/oneSuccessfulNotificationWithDuplicatedCode.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 12 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | project_created_at: "2019-12-20 12:01:02" 9 | 10 | codexia_review: 11 | - 12 | id: 1 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | author: Review author 16 | reason: Review reason 17 | text: Review text 18 | 19 | codexia_review_notification: 20 | - 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | codexia_review_id: 1 23 | status: SUCCESS 24 | response_code: 404 25 | response: Some response 26 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/resend-reviews-until-duplicated/initial/oneUnsuccessfulNotification.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 12 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | project_created_at: "2019-12-20 12:01:02" 9 | 10 | codexia_review: 11 | - 12 | id: 1 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | author: Review author 16 | reason: Review reason 17 | text: Review text 18 | 19 | codexia_review_notification: 20 | - 21 | uuid: "groovy: UUID.randomUUID().toString()" 22 | codexia_review_id: 1 23 | status: ERROR 24 | response_code: 500 25 | response: Some response 26 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-badges/expected/attachOneBadge.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | external_id: 123 4 | coordinates: "test-project1/test-repo1" 5 | author: "some-first-author" 6 | deleted: null 7 | project_created_at: "2019-12-20 12:01:02" 8 | 9 | codexia_badge: 10 | - 11 | codexia_project_id: 5 12 | badge: "bad" 13 | deleted_at: null 14 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-badges/expected/attachTwoBadges.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | external_id: 123 4 | coordinates: "test-project1/test-repo1" 5 | author: "some-first-author1" 6 | deleted: null 7 | project_created_at: "2019-12-20 12:01:02" 8 | - 9 | external_id: 321 10 | coordinates: "test-project2/test-repo2" 11 | author: "some-first-author2" 12 | deleted: null 13 | project_created_at: "2020-01-12 09:10:45" 14 | 15 | codexia_badge: 16 | - 17 | codexia_project_id: 5 18 | badge: "bad" 19 | deleted_at: null 20 | - 21 | codexia_project_id: 6 22 | badge: "bad" 23 | deleted_at: null 24 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-badges/expected/detachOneBadge.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | external_id: 333 4 | coordinates: "test-project1/test-repo1" 5 | author: "some-first-author" 6 | deleted: null 7 | project_created_at: "2019-12-20 12:01:02" 8 | 9 | codexia_badge: 10 | - 11 | codexia_project_id: 5 12 | badge: "bad" 13 | deleted_at: "2020-05-20 12:01:02" 14 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-badges/expected/detachTwoBadges.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | external_id: 123 4 | coordinates: "test-project1/test-repo1" 5 | author: "some-first-author2" 6 | deleted: null 7 | project_created_at: "2019-12-20 12:01:02" 8 | - 9 | external_id: 321 10 | coordinates: "test-project2/test-repo2" 11 | author: "some-first-author2" 12 | deleted: null 13 | project_created_at: "2020-03-02 09:10:11" 14 | 15 | codexia_badge: 16 | - 17 | codexia_project_id: 5 18 | badge: "bad" 19 | deleted_at: "2020-05-20 12:01:02" 20 | - 21 | codexia_project_id: 6 22 | badge: "bad" 23 | deleted_at: "2020-05-20 12:20:14" 24 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-badges/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_badge: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-badges/initial/attachOneBadge.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 123 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | deleted: null 9 | project_created_at: "2019-12-20 12:01:02" 10 | 11 | codexia_badge: 12 | - 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | badge: "bad" 16 | deleted_at: null 17 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-badges/initial/detachOneBadge.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 333 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | deleted: null 9 | project_created_at: "2019-12-20 12:01:02" 10 | 11 | codexia_badge: 12 | - 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | badge: "bad" 16 | deleted_at: "2020-05-20 12:01:02" 17 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-badges/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_badge: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-reviews/expected/noReviewsToSend.yml: -------------------------------------------------------------------------------- 1 | codexia_review: [] 2 | 3 | codexia_review_notification: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-reviews/expected/reviewSentWith500.yml: -------------------------------------------------------------------------------- 1 | codexia_review: 2 | - 3 | id: 1 4 | codexia_project_id: 5 5 | author: Review author 6 | reason: Review reason 7 | text: Review text 8 | 9 | codexia_review_notification: 10 | - 11 | codexia_review_id: 1 12 | status: "ERROR" 13 | response_code: 500 14 | response: "" 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-reviews/expected/reviewSentWithDuplicate_responseBodyEmpty.yml: -------------------------------------------------------------------------------- 1 | codexia_review: 2 | - 3 | id: 1 4 | codexia_project_id: 5 5 | author: Review author 6 | reason: Review reason 7 | text: Review text 8 | 9 | codexia_review_notification: 10 | - 11 | codexia_review_id: 1 12 | status: "SUCCESS" 13 | response_code: 404 14 | response: "" 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-reviews/expected/reviewSentWithDuplicate_responseBodyExists.yml: -------------------------------------------------------------------------------- 1 | codexia_review: 2 | - 3 | id: 1 4 | codexia_project_id: 5 5 | author: Review author 6 | reason: Review reason 7 | text: Review text 8 | 9 | codexia_review_notification: 10 | - 11 | codexia_review_id: 1 12 | status: "SUCCESS" 13 | response_code: 404 14 | response: Review already exists 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-reviews/expected/reviewSuccessfullySent.yml: -------------------------------------------------------------------------------- 1 | codexia_review: 2 | - 3 | id: 1 4 | codexia_project_id: 5 5 | author: Review author 6 | reason: Review reason 7 | text: Review text 8 | 9 | codexia_review_notification: 10 | - 11 | codexia_review_id: 1 12 | status: "SUCCESS" 13 | response_code: 200 14 | response: "regex:^<200 OK OK,.*" 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-reviews/initial/noReviewsToSend.yml: -------------------------------------------------------------------------------- 1 | codexia_review: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-reviews/initial/reviewSentWith500.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 12 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | project_created_at: "2019-12-20 12:01:02" 9 | 10 | codexia_review: 11 | - 12 | id: 1 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | author: Review author 16 | reason: Review reason 17 | text: Review text 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-reviews/initial/reviewSentWithDuplicate_responseBodyEmpty.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 12 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | project_created_at: "2019-12-20 12:01:02" 9 | 10 | codexia_review: 11 | - 12 | id: 1 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | author: Review author 16 | reason: Review reason 17 | text: Review text 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-reviews/initial/reviewSentWithDuplicate_responseBodyExists.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 12 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | project_created_at: "2019-12-20 12:01:02" 9 | 10 | codexia_review: 11 | - 12 | id: 1 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | author: Review author 16 | reason: Review reason 17 | text: Review text 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/send-reviews/initial/reviewSuccessfullySent.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 12 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | project_created_at: "2019-12-20 12:01:02" 9 | 10 | codexia_review: 11 | - 12 | id: 1 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | author: Review author 16 | reason: Review reason 17 | text: Review text 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/expected/altogether.yml: -------------------------------------------------------------------------------- 1 | codexia_badge: 2 | - 3 | codexia_project_id: 6 4 | badge: "bad" 5 | deleted_at: null 6 | - 7 | codexia_project_id: 7 8 | badge: "bad" 9 | deleted_at: regex:^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{1,6}$ 10 | - 11 | codexia_project_id: 5 12 | badge: "bad" 13 | deleted_at: null 14 | - 15 | codexia_project_id: 8 16 | badge: "bad" 17 | deleted_at: null 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_badge: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/expected/fromTooSmallToNotSmall.yml: -------------------------------------------------------------------------------- 1 | codexia_badge: 2 | - 3 | codexia_project_id: 8 4 | badge: "bad" 5 | deleted_at: regex:^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{1,6}$ 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/expected/multipleTooSmall.yml: -------------------------------------------------------------------------------- 1 | codexia_badge: 2 | - 3 | codexia_project_id: 8 4 | badge: "bad" 5 | deleted_at: null 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/expected/oneNotTooSmall.yml: -------------------------------------------------------------------------------- 1 | codexia_badge: 2 | - 3 | codexia_project_id: 8 4 | badge: "bad" 5 | deleted_at: regex:^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{1,6}$ 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/expected/oneTooManyStars.yml: -------------------------------------------------------------------------------- 1 | codexia_badge: 2 | - 3 | codexia_project_id: 5 4 | badge: "bad" 5 | deleted_at: null 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/expected/oneTooSmall.yml: -------------------------------------------------------------------------------- 1 | codexia_badge: 2 | - 3 | codexia_project_id: 8 4 | badge: "bad" 5 | deleted_at: null 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/expected/twoTooManyStars.yml: -------------------------------------------------------------------------------- 1 | codexia_badge: 2 | - 3 | codexia_project_id: 5 4 | badge: "bad" 5 | deleted_at: null 6 | - 7 | codexia_project_id: 6 8 | badge: "bad" 9 | deleted_at: null 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_review: [] 2 | 3 | codexia_badge: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/initial/oneNotTooSmall.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 8 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 123 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author2" 8 | deleted: null 9 | project_created_at: "2019-12-20 12:01:02" 10 | 11 | codexia_review: 12 | - 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 8 15 | author: TOO_SMALL 16 | reason: 5010 17 | text: "The repo is not small anymore (LoC is 5010)." 18 | 19 | codexia_badge: [] 20 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/initial/oneTooManyStars.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 5 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 123 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author2" 8 | deleted: null 9 | project_created_at: "2019-12-20 12:01:02" 10 | 11 | codexia_review: 12 | - 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 5 15 | author: TOO_MANY_STARS 16 | reason: 12430 17 | text: "The repo gained too many stars: 12430." 18 | 19 | codexia_badge: [] 20 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/codexia/cron/throwaway/initialize-badges/initial/oneTooSmall.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 8 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 123 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author2" 8 | deleted: null 9 | project_created_at: "2019-12-20 12:01:02" 10 | 11 | codexia_review: 12 | - 13 | uuid: "groovy: UUID.randomUUID().toString()" 14 | codexia_project_id: 8 15 | author: TOO_SMALL 16 | reason: 840 17 | text: "The repo is too small (LoC is 840)." 18 | 19 | codexia_badge: [] 20 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/expected/fourStatsOfTwoTypes.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "GITHUB_API" 5 | stat: '{"stars":1561,"type":"GITHUB_API"}' 6 | - 7 | github_repo_id: 1 8 | type: "GITHUB_API" 9 | stat: '{"stars":2123,"type":"GITHUB_API"}' 10 | - 11 | github_repo_id: 1 12 | type: "LINES_OF_CODE" 13 | stat: '{"type": "LINES_OF_CODE", "itemList": [{"language": "Total", "linesOfCode": 29330}]}' 14 | - 15 | github_repo_id: 1 16 | type: "LINES_OF_CODE" 17 | stat: '{"type": "LINES_OF_CODE", "itemList": [{"language": "Total", "linesOfCode": 31111}]}' 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/expected/oneStat.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "GITHUB_API" 5 | stat: '{"stars":1561,"type":"GITHUB_API"}' 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/expected/sixStatsOfTwoTypes.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "GITHUB_API" 5 | stat: '{"stars":1561,"type":"GITHUB_API"}' 6 | - 7 | github_repo_id: 1 8 | type: "GITHUB_API" 9 | stat: '{"stars":3456,"type":"GITHUB_API"}' 10 | - 11 | github_repo_id: 1 12 | type: "LINES_OF_CODE" 13 | stat: '{"type": "LINES_OF_CODE", "itemList": [{"language": "Total", "linesOfCode": 29330}]}' 14 | - 15 | github_repo_id: 1 16 | type: "LINES_OF_CODE" 17 | stat: '{"type": "LINES_OF_CODE", "itemList": [{"language": "Total", "linesOfCode": 32222}]}' 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/expected/threeStats.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "GITHUB_API" 5 | stat: '{"stars":1561,"type":"GITHUB_API"}' 6 | - 7 | github_repo_id: 1 8 | type: "GITHUB_API" 9 | stat: '{"stars":2100,"type":"GITHUB_API"}' 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/expected/threeStatsWithForeignKey.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "GITHUB_API" 5 | stat: '{"stars":1561,"type":"GITHUB_API"}' 6 | - 7 | github_repo_id: 1 8 | type: "GITHUB_API" 9 | stat: '{"stars":1999,"type":"GITHUB_API"}' 10 | - 11 | github_repo_id: 1 12 | type: "GITHUB_API" 13 | stat: '{"stars":2100,"type":"GITHUB_API"}' 14 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/expected/twoStats.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "GITHUB_API" 5 | stat: '{"stars":1561,"type":"GITHUB_API"}' 6 | - 7 | github_repo_id: 1 8 | type: "GITHUB_API" 9 | stat: '{"stars":1999,"type":"GITHUB_API"}' 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/expected/twoStatsOfTwoTypes.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "GITHUB_API" 5 | stat: '{"stars":1561,"type":"GITHUB_API"}' 6 | - 7 | github_repo_id: 1 8 | type: "LINES_OF_CODE" 9 | stat: '{"type": "LINES_OF_CODE", "itemList": []}' 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | stars_up_result: [] 4 | 5 | github_repo_stat: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/initial/oneStat.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 61200117 6 | full_name: instaloader/instaloader 7 | html_url: https://github.com/instaloader/instaloader 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | stars_up_result: [] 11 | 12 | github_repo_stat: 13 | - 14 | uuid: "groovy: UUID.randomUUID().toString()" 15 | github_repo_id: 1 16 | type: "GITHUB_API" 17 | stat: '{"stars":1561,"type":"GITHUB_API"}' 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/initial/twoStats.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 61200117 6 | full_name: instaloader/instaloader 7 | html_url: https://github.com/instaloader/instaloader 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | stars_up_result: [] 11 | 12 | github_repo_stat: 13 | - 14 | uuid: "groovy: UUID.randomUUID().toString()" 15 | github_repo_id: 1 16 | type: "GITHUB_API" 17 | stat: '{"stars":1561,"type":"GITHUB_API"}' 18 | - 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "GITHUB_API" 22 | stat: '{"stars":1999,"type":"GITHUB_API"}' 23 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/delete-obsolete-stat/initial/twoStatsOfTwoTypes.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 61200117 6 | full_name: instaloader/instaloader 7 | html_url: https://github.com/instaloader/instaloader 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | stars_up_result: [] 11 | 12 | github_repo_stat: 13 | - 14 | uuid: "groovy: UUID.randomUUID().toString()" 15 | github_repo_id: 1 16 | type: "GITHUB_API" 17 | stat: '{"stars":1561,"type":"GITHUB_API"}' 18 | - 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | github_repo_id: 1 21 | type: "LINES_OF_CODE" 22 | stat: '{"type": "LINES_OF_CODE", "itemList": []}' 23 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/github/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/github/expected/githubIoException.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/github/expected/happyPath.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "GITHUB_API" 5 | stat: "{\"description\":\"Download pictures along with their metadata from Instagram.\",\ 6 | \"pushedAt\":[2020,5,11,18,27,23],\"language\":\"Python\",\ 7 | \"homepage\":\"https://instaloader.github.io/\",\"forks\":281,\"watchers\":1561,\ 8 | \"stars\":1561,\"type\":\"GITHUB_API\"}" 9 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/github/expected/notCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/github/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | 5 | github_repo_stat: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/github/initial/githubIoException.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 61200117 6 | full_name: instaloader/instaloader 7 | html_url: https://github.com/instaloader/instaloader 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "CODEXIA" 15 | external_id: "2222" 16 | 17 | github_repo_stat: [] 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/github/initial/happyPath.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 61200117 6 | full_name: instaloader/instaloader 7 | html_url: https://github.com/instaloader/instaloader 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "CODEXIA" 15 | external_id: "2222" 16 | 17 | github_repo_stat: [] 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/github/initial/notCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 202275988 6 | full_name: test1/test1 7 | html_url: https://github.com/test1/test1 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "HACKERNEWS" 15 | external_id: "2222" 16 | 17 | github_repo_stat: [] 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/codexia/expected/codetabsException.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "LINES_OF_CODE" 5 | stat: '{"itemList":null,"type":"LINES_OF_CODE"}' 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/codexia/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/codexia/expected/happyPath.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "LINES_OF_CODE" 5 | stat: "{\"itemList\":[{\"language\":\"TypeScript\",\"files\":84,\"lines\":9415,\ 6 | \"blanks\":1200,\"comments\":682,\"linesOfCode\":3533}],\"type\":\"LINES_OF_CODE\"}" 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/codexia/expected/processedRepo.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "LINES_OF_CODE" 5 | stat: '{"itemList":null,"type":"LINES_OF_CODE"}' 6 | - 7 | github_repo_id: 1 8 | type: "LINES_OF_CODE" 9 | stat: "{\"itemList\":[{\"language\":\"TypeScript\",\"files\":84,\"lines\":9415,\ 10 | \"blanks\":1200,\"comments\":682,\"linesOfCode\":3533}],\"type\":\"LINES_OF_CODE\"}" 11 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/codexia/expected/tooManyRequests.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/codexia/initial/codetabsException.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 12 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | deleted: null 9 | project_created_at: "2019-12-20 12:01:02" 10 | created_at: "2019-12-21 15:00:00" 11 | updated_at: "2019-12-21 15:00:00" 12 | 13 | github_repo: 14 | - 15 | id: 1 16 | uuid: "groovy: UUID.randomUUID().toString()" 17 | external_id: "150713223" 18 | full_name: "test-project1/test-repo1" 19 | 20 | github_repo_source: 21 | - 22 | id: 1 23 | uuid: "groovy: UUID.randomUUID().toString()" 24 | github_repo_id: 1 25 | source: "CODEXIA" 26 | external_id: "12" 27 | 28 | github_repo_stat: [] 29 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/codexia/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | codexia_project: [] 2 | 3 | github_repo: [] 4 | 5 | github_repo_source: [] 6 | 7 | github_repo_stat: [] 8 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/codexia/initial/happyPath.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 12 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | deleted: null 9 | project_created_at: "2019-12-20 12:01:02" 10 | created_at: "2019-12-21 15:00:00" 11 | updated_at: "2019-12-21 15:00:00" 12 | 13 | github_repo: 14 | - 15 | id: 1 16 | uuid: "groovy: UUID.randomUUID().toString()" 17 | external_id: "150713223" 18 | full_name: "test-project1/test-repo1" 19 | 20 | github_repo_source: 21 | - 22 | id: 1 23 | uuid: "groovy: UUID.randomUUID().toString()" 24 | github_repo_id: 1 25 | source: "CODEXIA" 26 | external_id: "12" 27 | 28 | github_repo_stat: [] 29 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/codexia/initial/tooManyRequests.yml: -------------------------------------------------------------------------------- 1 | codexia_project: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 12 6 | coordinates: "test-project1/test-repo1" 7 | author: "some-first-author" 8 | deleted: null 9 | project_created_at: "2019-12-20 12:01:02" 10 | created_at: "2019-12-21 15:00:00" 11 | updated_at: "2019-12-21 15:00:00" 12 | 13 | github_repo: 14 | - 15 | id: 1 16 | uuid: "groovy: UUID.randomUUID().toString()" 17 | external_id: "150713223" 18 | full_name: "test-project1/test-repo1" 19 | 20 | github_repo_source: 21 | - 22 | id: 1 23 | uuid: "groovy: UUID.randomUUID().toString()" 24 | github_repo_id: 1 25 | source: "CODEXIA" 26 | external_id: "12" 27 | 28 | github_repo_stat: [] 29 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/without-loc/expected/codetabsException.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "LINES_OF_CODE" 5 | stat: '{"itemList":null,"type":"LINES_OF_CODE"}' 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/without-loc/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/without-loc/expected/happyPath.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | github_repo_id: 1 4 | type: "LINES_OF_CODE" 5 | stat: "{\"itemList\":[{\"language\":\"TypeScript\",\"files\":84,\"lines\":9415,\ 6 | \"blanks\":1200,\"comments\":682,\"linesOfCode\":3533}],\"type\":\"LINES_OF_CODE\"}" 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/without-loc/expected/processedRepo.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: 2 | - 3 | id: 1 4 | github_repo_id: 1 5 | type: "LINES_OF_CODE" 6 | stat: '{"itemList":null,"type":"LINES_OF_CODE"}' 7 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/without-loc/expected/tooManyRequests.yml: -------------------------------------------------------------------------------- 1 | github_repo_stat: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/without-loc/initial/codetabsException.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_stat: [] 9 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/without-loc/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_stat: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/without-loc/initial/happyPath.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_stat: [] 9 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/without-loc/initial/processedRepo.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_stat: 9 | - 10 | id: 1 11 | uuid: "groovy: UUID.randomUUID().toString()" 12 | github_repo_id: 1 13 | type: "LINES_OF_CODE" 14 | stat: '{"itemList":null,"type":"LINES_OF_CODE"}' 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/cron/stat/loc/without-loc/initial/tooManyRequests.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "150713223" 6 | full_name: "test-project1/test-repo1" 7 | 8 | github_repo_stat: [] 9 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/github-module/expected/happyPath.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | external_id: "202275988" 4 | full_name: "casbin/casbin-rs" 5 | html_url: "https://github.com/casbin/casbin-rs" 6 | repo_created_at: "2019-08-14 04:42:36" 7 | 8 | github_repo_source: 9 | - 10 | source: "CODEXIA" 11 | external_id: "1662" 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/github-module/expected/notFoundInGithub.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/github-module/expected/repoExistsByCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | external_id: "202275988" 4 | full_name: "casbin/casbin-rs" 5 | html_url: "https://github.com/casbin/casbin-rs" 6 | repo_created_at: "2019-08-14 04:42:36" 7 | 8 | github_repo_source: 9 | - 10 | source: "CODEXIA" 11 | external_id: "1662" 12 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/github-module/expected/repoExistsByExternalId.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | external_id: "202275988" 4 | full_name: "casbin/casbin" 5 | html_url: "https://github.com/casbin/casbin" 6 | repo_created_at: "2019-08-14 04:42:36" 7 | 8 | github_repo_source: 9 | - 10 | source: "HACKERNEWS" 11 | external_id: "1111" 12 | - 13 | source: "CODEXIA" 14 | external_id: "1662" 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/github-module/expected/repoExistsByFullName.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | external_id: "202275988" 4 | full_name: "casbin/casbin-rs" 5 | html_url: "https://github.com/casbin/casbin-rs" 6 | repo_created_at: "2019-08-14 04:42:36" 7 | 8 | github_repo_source: 9 | - 10 | source: "HACKERNEWS" 11 | external_id: "1111" 12 | - 13 | source: "CODEXIA" 14 | external_id: "1662" 15 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/github-module/initial/happyPath.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/github-module/initial/notFoundInGithub.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/github-module/initial/repoExistsByCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "202275988" 6 | full_name: "casbin/casbin-rs" 7 | html_url: "https://github.com/casbin/casbin-rs" 8 | repo_created_at: "2019-08-14 04:42:36" 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "CODEXIA" 15 | external_id: "1662" 16 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/github-module/initial/repoExistsByExternalId.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "202275988" 6 | full_name: "casbin/casbin" 7 | html_url: "https://github.com/casbin/casbin" 8 | repo_created_at: "2019-08-14 04:42:36" 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "HACKERNEWS" 15 | external_id: "1111" 16 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/github/github-module/initial/repoExistsByFullName.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: "202275988" 6 | full_name: "casbin/casbin-rs" 7 | html_url: "https://github.com/casbin/casbin-rs" 8 | repo_created_at: "2019-08-14 04:42:36" 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "HACKERNEWS" 15 | external_id: "1111" 16 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/gaps-filler/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/gaps-filler/expected/oneMissing.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author 6 | title: Title for test1 7 | url: test 1 url 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | - 11 | external_id: 3 12 | type: story 13 | by: test3author 14 | title: Title for test3 15 | url: test 3 url 16 | time: 2009-01-15 05:58:12 17 | deleted: false 18 | - 19 | external_id: 2 20 | type: story 21 | by: test2author 22 | title: Title for test2 23 | url: test 2 url 24 | time: 2009-01-15 06:12:49 25 | deleted: false 26 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/gaps-filler/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/gaps-filler/initial/oneMissing.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author 6 | title: Title for test1 7 | url: test 1 url 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | - 11 | external_id: 3 12 | type: story 13 | by: test3author 14 | title: Title for test3 15 | url: test 3 url 16 | time: 2009-01-15 05:58:12 17 | deleted: false 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/gaps-filler/initial/twoMissing.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author 6 | title: Title for test1 7 | url: test 1 url 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | - 11 | external_id: 3 12 | type: story 13 | by: test3author 14 | title: Title for test3 15 | url: test 3 url 16 | time: 2009-01-15 05:58:12 17 | deleted: false 18 | - 19 | external_id: 5 20 | type: story 21 | by: test5author 22 | title: Title for test5 23 | url: test 5 url 24 | time: 2009-01-15 06:32:52 25 | deleted: false 26 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/all-items/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: [] 2 | 3 | hackernews_item: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/all-items/expected/hackernewsException.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: 2 | - 3 | github_repo_id: 1 4 | source: "HACKERNEWS" 5 | external_id: "2222" 6 | deleted_at: null 7 | 8 | hackernews_item: 9 | - 10 | external_id: 2222 11 | type: story 12 | by: smartmic 13 | title: Title for casbin 14 | url: https://github.com/casbin/casbin 15 | time: 2020-02-14 18:43:33 16 | deleted: false 17 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/all-items/expected/oneActiveItem.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: 2 | - 3 | github_repo_id: 1 4 | source: "HACKERNEWS" 5 | external_id: "2222" 6 | deleted_at: null 7 | 8 | hackernews_item: 9 | - 10 | external_id: 2222 11 | type: story 12 | by: smartmic 13 | title: Title for casbin 14 | url: https://github.com/casbin/casbin 15 | time: 2020-02-14 18:43:33 16 | deleted: false 17 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/all-items/expected/oneDeletedItem.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: 2 | - 3 | github_repo_id: 1 4 | source: "HACKERNEWS" 5 | external_id: "2222" 6 | deleted_at: regex:^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{1,6}$ 7 | 8 | hackernews_item: 9 | - 10 | external_id: 2222 11 | type: story 12 | by: smartmic 13 | title: Title for casbin 14 | url: https://github.com/casbin/casbin 15 | time: 2009-01-15 05:56:02 16 | deleted: true 17 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/all-items/expected/twoActiveItems.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: 2 | - 3 | github_repo_id: 1 4 | source: "HACKERNEWS" 5 | external_id: "2222" 6 | deleted_at: null 7 | - 8 | github_repo_id: 2 9 | source: "HACKERNEWS" 10 | external_id: "3333" 11 | deleted_at: null 12 | 13 | hackernews_item: 14 | - 15 | external_id: 2222 16 | type: story 17 | by: smartmic 18 | title: Title for casbin 19 | url: https://github.com/casbin/casbin 20 | time: 2020-02-14 18:43:33 21 | deleted: false 22 | - 23 | external_id: 3333 24 | type: story 25 | by: test-author 26 | title: Title for test-post 27 | url: https://github.com/test/test 28 | time: 2002-02-14 18:43:33 29 | deleted: false 30 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/all-items/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | 5 | hackernews_item: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/all-items/initial/hackernewsException.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 202275988 6 | full_name: casbin/casbin 7 | html_url: https://github.com/casbin/casbin 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "HACKERNEWS" 15 | external_id: "2222" 16 | 17 | hackernews_item: 18 | - 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | external_id: 2222 21 | type: story 22 | by: smartmic 23 | title: Title for casbin 24 | url: https://github.com/casbin/casbin 25 | time: 2020-02-14 18:43:33 26 | deleted: false 27 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/all-items/initial/oneActiveItem.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 202275988 6 | full_name: casbin/casbin 7 | html_url: https://github.com/casbin/casbin 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "HACKERNEWS" 15 | external_id: "2222" 16 | 17 | hackernews_item: 18 | - 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | external_id: 2222 21 | type: story 22 | by: smartmic 23 | title: Title for casbin 24 | url: https://github.com/casbin/casbin 25 | time: 2020-02-14 18:43:33 26 | deleted: false 27 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/all-items/initial/oneDeletedItem.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 202275988 6 | full_name: casbin/casbin 7 | html_url: https://github.com/casbin/casbin 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "HACKERNEWS" 15 | external_id: "2222" 16 | 17 | hackernews_item: 18 | - 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | external_id: 2222 21 | type: story 22 | by: smartmic 23 | title: Title for casbin 24 | url: https://github.com/casbin/casbin 25 | time: 2020-02-14 18:43:33 26 | deleted: false 27 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/codexia-items/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: [] 2 | 3 | hackernews_item: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/codexia-items/expected/hackernewsException.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: 2 | - 3 | github_repo_id: 1 4 | source: "HACKERNEWS" 5 | external_id: "2222" 6 | deleted_at: null 7 | - 8 | github_repo_id: 1 9 | source: "CODEXIA" 10 | external_id: "666" 11 | deleted_at: null 12 | 13 | hackernews_item: 14 | - 15 | external_id: 2222 16 | type: story 17 | by: smartmic 18 | title: Title for casbin 19 | url: https://github.com/casbin/casbin 20 | time: 2020-02-14 18:43:33 21 | deleted: false 22 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/codexia-items/expected/oneActiveItem.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: 2 | - 3 | github_repo_id: 1 4 | source: "HACKERNEWS" 5 | external_id: "2222" 6 | deleted_at: null 7 | - 8 | github_repo_id: 1 9 | source: "CODEXIA" 10 | external_id: "999" 11 | deleted_at: null 12 | 13 | hackernews_item: 14 | - 15 | external_id: 2222 16 | type: story 17 | by: smartmic 18 | title: Title for casbin 19 | url: https://github.com/casbin/casbin 20 | time: 2020-02-14 18:43:33 21 | deleted: false 22 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/codexia-items/expected/oneDeletedItem.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: 2 | - 3 | github_repo_id: 1 4 | source: "HACKERNEWS" 5 | external_id: "2222" 6 | deleted_at: regex:^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{1,6}$ 7 | - 8 | github_repo_id: 1 9 | source: "CODEXIA" 10 | external_id: "999" 11 | deleted_at: null 12 | 13 | hackernews_item: 14 | - 15 | external_id: 2222 16 | type: story 17 | by: smartmic 18 | title: Title for casbin 19 | url: https://github.com/casbin/casbin 20 | time: 2009-01-15 05:56:02 21 | deleted: true 22 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/codexia-items/expected/withoutCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: 2 | - 3 | github_repo_id: 1 4 | source: "HACKERNEWS" 5 | external_id: "2222" 6 | deleted_at: null 7 | 8 | hackernews_item: 9 | - 10 | external_id: 2222 11 | type: story 12 | by: smartmic 13 | title: Title for casbin 14 | url: https://github.com/casbin/casbin 15 | time: 2020-02-14 18:43:33 16 | deleted: false 17 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/codexia-items/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | 5 | hackernews_item: [] 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/health-check/codexia-items/initial/withoutCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 202275988 6 | full_name: casbin/casbin 7 | html_url: https://github.com/casbin/casbin 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "HACKERNEWS" 15 | external_id: "2222" 16 | 17 | hackernews_item: 18 | - 19 | uuid: "groovy: UUID.randomUUID().toString()" 20 | external_id: 2222 21 | type: story 22 | by: smartmic 23 | title: Title for casbin 24 | url: https://github.com/casbin/casbin 25 | time: 2020-02-14 18:43:33 26 | deleted: false 27 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/incremented-parser/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/incremented-parser/expected/emptyDatabaseAndTwoItemsAtHackernews.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author 6 | title: Title for test1 7 | url: "" 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | - 11 | external_id: 2 12 | type: story 13 | by: test2author 14 | title: Title for test2 15 | url: https://example.com 16 | time: 2009-01-15 05:42:03 17 | deleted: false 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/incremented-parser/expected/emptyDatabaseItemWithGistUrl.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author 6 | title: Title for item with gist 7 | url: https://gist.github.com/iakunin/test123123 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/incremented-parser/expected/emptyDatabaseItemWithGithubUrl.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author 6 | title: Title for test1 7 | url: https://github.com/test-user/test-repo 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/incremented-parser/expected/emptyDatabaseItemWithoutUrl.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author 6 | title: Title for test1 7 | url: "" 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/incremented-parser/expected/notEmptyDatabaseExistsInRepo.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author 6 | title: Title for test1 7 | url: https://test1.com 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/incremented-parser/expected/notEmptyDatabaseWithoutHackernews.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author 6 | title: Title for test1 7 | url: https://test1.com 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | - 11 | external_id: 2 12 | type: story 13 | by: test2author 14 | title: Title for test2 15 | url: https://test2.com 16 | time: 2009-01-15 05:42:03 17 | deleted: false 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/incremented-parser/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/incremented-parser/initial/notEmptyDatabaseExistsInRepo.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author 6 | title: Title for test1 7 | url: https://test1.com 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/incremented-parser/initial/notEmptyDatabaseWithoutHackernews.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author 6 | title: Title for test1 7 | url: https://test1.com 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | - 11 | external_id: 2 12 | type: story 13 | by: test2author 14 | title: Title for test2 15 | url: https://test2.com 16 | time: 2009-01-15 05:42:03 17 | deleted: false 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/retry-erroneous/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/retry-erroneous/expected/hackernewsException.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: "" 5 | by: test1author 6 | title: Title for test1 7 | url: https://test1.com 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/retry-erroneous/expected/oneItem.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author111 6 | title: Title for test1_123 7 | url: https://example.com/test123 8 | time: 2009-01-15 06:12:49 9 | deleted: false 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/retry-erroneous/expected/oneUnprocessedItem.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: author 6 | title: title 7 | url: url 8 | time: 2000-01-01 00:01:10 9 | deleted: false 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/retry-erroneous/expected/twoItems.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: test1author111 6 | title: Title for test1_123 7 | url: https://example.com/test123 8 | time: 2009-01-15 06:12:49 9 | deleted: false 10 | - 11 | external_id: 2 12 | type: story 13 | by: test2author222 14 | title: Title for test2_222 15 | url: https://example.com/test456 16 | time: 2009-01-05 04:32:53 17 | deleted: false 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/retry-erroneous/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/retry-erroneous/initial/hackernewsException.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: "" 5 | by: test1author 6 | title: Title for test1 7 | url: https://test1.com 8 | time: 2009-01-15 05:56:17 9 | deleted: false 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/retry-erroneous/initial/oneItem.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: "" 5 | by: author 6 | title: title 7 | url: url 8 | time: 2000-01-01 00:01:10 9 | deleted: false 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/retry-erroneous/initial/oneUnprocessedItem.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: story 5 | by: author 6 | title: title 7 | url: url 8 | time: 2000-01-01 00:01:10 9 | deleted: false 10 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/cron/retry-erroneous/initial/twoItems.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: 2 | - 3 | external_id: 1 4 | type: "" 5 | by: author 6 | title: title 7 | url: url 8 | time: 2000-01-01 00:01:10 9 | deleted: false 10 | - 11 | external_id: 2 12 | type: "" 13 | by: author 14 | title: title 15 | url: url 16 | time: 2000-01-01 00:01:10 17 | deleted: false 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/hackernews-module/expected/noItemInDatabase.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/hackernews/hackernews-module/initial/noItemInDatabase.yml: -------------------------------------------------------------------------------- 1 | hackernews_item: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/reddit/cron/parser/expected/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: [] 2 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/reddit/cron/parser/expected/happyPath.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: 2 | - 3 | github_repo_id: 1 4 | source: "CODEXIA" 5 | external_id: "2222" 6 | - 7 | github_repo_id: 1 8 | source: "REDDIT" 9 | external_id: "f3an2d" 10 | - 11 | github_repo_id: 1 12 | source: "REDDIT" 13 | external_id: "f38bpw" 14 | - 15 | github_repo_id: 1 16 | source: "REDDIT" 17 | external_id: "f3tc36" 18 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/reddit/cron/parser/expected/notCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | github_repo_source: 2 | - 3 | github_repo_id: 1 4 | source: "HACKERNEWS" 5 | external_id: "2222" 6 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/reddit/cron/parser/initial/emptyDatabase.yml: -------------------------------------------------------------------------------- 1 | github_repo: [] 2 | 3 | github_repo_source: [] 4 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/reddit/cron/parser/initial/happyPath.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 202275988 6 | full_name: test1/test1 7 | html_url: https://github.com/test1/test1 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "CODEXIA" 15 | external_id: "2222" 16 | -------------------------------------------------------------------------------- /src/test/resources/db-rider/reddit/cron/parser/initial/notCodexiaSource.yml: -------------------------------------------------------------------------------- 1 | github_repo: 2 | - 3 | id: 1 4 | uuid: "groovy: UUID.randomUUID().toString()" 5 | external_id: 202275988 6 | full_name: test1/test1 7 | html_url: https://github.com/test1/test1 8 | repo_created_at: 2019-08-14 04:42:36 9 | 10 | github_repo_source: 11 | - 12 | uuid: "groovy: UUID.randomUUID().toString()" 13 | github_repo_id: 1 14 | source: "HACKERNEWS" 15 | external_id: "2222" 16 | -------------------------------------------------------------------------------- /src/test/resources/dbunit.yml: -------------------------------------------------------------------------------- 1 | cacheConnection: true 2 | cacheTableNames: true 3 | caseInsensitiveStrategy: !!com.github.database.rider.core.api.configuration.Orthography 'LOWERCASE' 4 | properties: 5 | datatypeFactory: !!dev.iakunin.codexiabot.dbunit.CustomPostgresqlDataTypeFactory {} 6 | batchedStatements: true 7 | caseSensitiveTableNames: false 8 | allowEmptyFields: true 9 | -------------------------------------------------------------------------------- /src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline 2 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/bot/found-on-hackernews/withScore.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "fisherxu", 3 | "descendants": 0, 4 | "id": 22274959, 5 | "score": 45, 6 | "time": 1581155435, 7 | "title": "KubeEdge: Reliable message delivery design based on K8s in EdgeComputing", 8 | "type": "story", 9 | "url": "https://github.com/kubeedge/kubeedge/pull/1343" 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/bot/found-on-hackernews/withoutScore.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "fisherxu", 3 | "descendants": 0, 4 | "id": 22274959, 5 | "time": 1581155435, 6 | "title": "KubeEdge: Reliable message delivery design based on K8s in EdgeComputing", 7 | "type": "story", 8 | "url": "https://github.com/kubeedge/kubeedge/pull/1343" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/codexia/cron/codexia-parser/codexia/recent.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1662, 4 | "coordinates": "casbin/casbin-rs", 5 | "platform": "github", 6 | "created": "2020-05-05 10:29:21 +0000", 7 | "deleted": null, 8 | "submitter": { 9 | "id": 1358, 10 | "login": "iakunin" 11 | }, 12 | "badges": [ 13 | { 14 | "id": "1642", 15 | "text": "newbie" 16 | } 17 | ] 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/codexia/cron/codexia-parser/codexia/recentWithDeleted.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1662, 4 | "coordinates": "casbin/casbin-rs", 5 | "platform": "github", 6 | "created": "2020-05-05 10:29:21 +0000", 7 | "deleted": "Deleted by somebody.", 8 | "submitter": { 9 | "id": 1358, 10 | "login": "iakunin" 11 | }, 12 | "badges": [ 13 | { 14 | "id": "1642", 15 | "text": "newbie" 16 | } 17 | ] 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/codexia/cron/projects-health-check/12deletedWithBadges.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 12, 3 | "coordinates": "test-project/test-repo", 4 | "platform": "github", 5 | "submitter": { 6 | "id": 123, 7 | "login": "iakunin-codexia-bot" 8 | }, 9 | "badges": [ 10 | { 11 | "id": 2526, 12 | "text": "newbie" 13 | }, 14 | { 15 | "id": 123, 16 | "text": "L1" 17 | } 18 | ], 19 | "created": "2020-03-10 19:12:21 +0000", 20 | "deleted": "deleted by someone" 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/codexia/cron/projects-health-check/34deletedWithBadges.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 34, 3 | "coordinates": "test-project/test-repo", 4 | "platform": "github", 5 | "submitter": { 6 | "id": 123, 7 | "login": "iakunin-codexia-bot" 8 | }, 9 | "badges": [ 10 | { 11 | "id": 2526, 12 | "text": "newbie" 13 | }, 14 | { 15 | "id": 123, 16 | "text": "L1" 17 | } 18 | ], 19 | "created": "2020-03-10 19:12:21 +0000", 20 | "deleted": "deleted by someone" 21 | } 22 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/config/reddit/accessToken.json: -------------------------------------------------------------------------------- 1 | { 2 | "access_token": "some_access_token", 3 | "expires_in": 99999, 4 | "scope": "some_scope", 5 | "refresh_token": "some_refresh_token" 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/config/reddit/me.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "someUsername" 3 | } 4 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/github/cron/stat/loc/happyPath.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "language": "TypeScript", 4 | "files": 84, 5 | "lines": 9415, 6 | "blanks": 1200, 7 | "comments": 682, 8 | "linesOfCode": 3533 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/github/github-module/codexia/recent.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1662, 4 | "coordinates": "casbin/casbin-rs", 5 | "platform": "github", 6 | "created": "2020-05-05 10:29:21 +0000", 7 | "deleted": null, 8 | "submitter": { 9 | "id": 1358, 10 | "login": "iakunin" 11 | }, 12 | "badges": [ 13 | { 14 | "id": "1642", 15 | "text": "newbie" 16 | } 17 | ] 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/github/github-module/github/repoNotFound.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Not Found", 3 | "documentation_url": "https://developer.github.com/v3/repos/#get" 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/hackernews/cron/gaps-filler/2.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "test2author", 3 | "id": 2, 4 | "text": "Some awesome text for test 2.", 5 | "title": "Title for test2", 6 | "url": "test 2 url", 7 | "time": 1231999969, 8 | "type": "story", 9 | "descendants": 0, 10 | "score": 2 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/hackernews/cron/gaps-filler/4.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "test4author", 3 | "id": 4, 4 | "text": "Some awesome text for test 4.", 5 | "title": "Title for test4", 6 | "url": "test 4 url", 7 | "time": 1231999973, 8 | "type": "story", 9 | "descendants": 30, 10 | "score": 55 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/hackernews/cron/health-check/activeItem.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "smartmic", 3 | "id": 2222, 4 | "text": "Some awesome text.", 5 | "title": "Title for casbin", 6 | "url": "https://github.com/casbin/casbin", 7 | "time": 1231998962, 8 | "type": "story", 9 | "descendants": 0, 10 | "score": 2 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/hackernews/cron/health-check/deletedItem.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "smartmic", 3 | "id": 2222, 4 | "text": "Some awesome text.", 5 | "title": "Title for casbin", 6 | "url": "https://github.com/casbin/casbin", 7 | "time": 1231998962, 8 | "type": "story", 9 | "descendants": 0, 10 | "score": 2, 11 | "deleted": true 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/hackernews/cron/incremented-parser/itemWithGistUrl.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "test1author", 3 | "id": 1, 4 | "text": "Some awesome text for test 1.", 5 | "title": "Title for item with gist", 6 | "url": "https://gist.github.com/iakunin/test123123", 7 | "time": 1231998977, 8 | "type": "story", 9 | "descendants": 0, 10 | "score": 2 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/hackernews/cron/incremented-parser/itemWithGithubUrl.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "test1author", 3 | "id": 1, 4 | "text": "Some awesome text for test 1.", 5 | "title": "Title for test1", 6 | "url": "https://github.com/test-user/test-repo", 7 | "time": 1231998977, 8 | "type": "story", 9 | "descendants": 0, 10 | "score": 2 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/hackernews/cron/incremented-parser/itemWithUrl.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "test2author", 3 | "id": 2, 4 | "text": "Some awesome text for test 2.", 5 | "title": "Title for test2", 6 | "url": "https://example.com", 7 | "time": 1231998123, 8 | "type": "story", 9 | "descendants": 2, 10 | "score": 5 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/hackernews/cron/incremented-parser/itemWithoutUrl.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "test1author", 3 | "id": 1, 4 | "text": "Some awesome text for test 1.", 5 | "title": "Title for test1", 6 | "time": 1231998977, 7 | "type": "story", 8 | "descendants": 0, 9 | "score": 2 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/hackernews/cron/retry-erroneous/1.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "test1author111", 3 | "id": 1, 4 | "text": "Some awesome text for test 1.", 5 | "title": "Title for test1_123", 6 | "url": "https://example.com/test123", 7 | "time": 1231999969, 8 | "type": "story", 9 | "descendants": 0, 10 | "score": 2 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/hackernews/cron/retry-erroneous/2.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "test2author222", 3 | "id": 2, 4 | "text": "Some awesome text for test 2.", 5 | "title": "Title for test2_222", 6 | "url": "https://example.com/test456", 7 | "time": 1231129973, 8 | "type": "story", 9 | "descendants": 30, 10 | "score": 55 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/wiremock/hackernews/hackernews-module/4.json: -------------------------------------------------------------------------------- 1 | { 2 | "by": "test4author", 3 | "id": 4, 4 | "text": "Some awesome text for test 4.", 5 | "title": "Title for test4", 6 | "url": "test 4 url", 7 | "time": 1231999973, 8 | "type": "story", 9 | "descendants": 30, 10 | "score": 55, 11 | "deleted": true 12 | } 13 | -------------------------------------------------------------------------------- /var/codestyle/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iakunin/codexia-bot/5ee879213722ca2b38cf35ad47950a811da2f59c/var/codestyle/.gitkeep -------------------------------------------------------------------------------- /var/wiremock/__files/codexia/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 444, 3 | "coordinates": "test-project/test-repo", 4 | "platform": "github", 5 | "submitter": { 6 | "id": 123, 7 | "login": "iakunin-codexia-bot" 8 | }, 9 | "created": "2020-03-10 19:12:21 +0000", 10 | "deleted": null 11 | } 12 | -------------------------------------------------------------------------------- /var/wiremock/__files/codexia/recent/page-3.json: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /var/wiremock/mappings/codexia/attach-badge.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "urlPathPattern": "/codexia/p/\\d+/attach", 4 | "method": "POST" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "body": "The badge successfully attached!" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /var/wiremock/mappings/codexia/create-review.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "urlPathPattern": "/codexia/p/\\d+/post", 4 | "method": "POST" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "body": "Review successfully created!" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /var/wiremock/mappings/codexia/detach-badge.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "urlPathPattern": "/codexia/p/\\d+/detach/.+", 4 | "method": "POST" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "body": "The badge successfully detached!" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /var/wiremock/mappings/codexia/get-project.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "urlPathPattern": "/codexia/p/\\d+\\.json", 4 | "method": "GET" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "bodyFileName": "codexia/project.json", 9 | "transformers": [ 10 | "response-template" 11 | ], 12 | "headers": { 13 | "Content-Type": "application/json" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /var/wiremock/mappings/codexia/put-meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "urlPathPattern": "/codexia/p/\\d+/meta", 4 | "method": "POST" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "body": "Meta successfully put!" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /var/wiremock/mappings/codexia/recent/page-0.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "url": "/codexia/recent.json?page=0", 4 | "method": "GET" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "bodyFileName": "codexia/recent/page-0.json", 9 | "headers": { 10 | "Content-Type": "application/json" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /var/wiremock/mappings/codexia/recent/page-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "url": "/codexia/recent.json?page=1", 4 | "method": "GET" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "bodyFileName": "codexia/recent/page-1.json", 9 | "headers": { 10 | "Content-Type": "application/json" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /var/wiremock/mappings/codexia/recent/page-2.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "url": "/codexia/recent.json?page=2", 4 | "method": "GET" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "bodyFileName": "codexia/recent/page-2.json", 9 | "headers": { 10 | "Content-Type": "application/json" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /var/wiremock/mappings/codexia/recent/page-3.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "url": "/codexia/recent.json?page=3", 4 | "method": "GET" 5 | }, 6 | "response": { 7 | "status": 200, 8 | "bodyFileName": "codexia/recent/page-3.json", 9 | "headers": { 10 | "Content-Type": "application/json" 11 | } 12 | } 13 | } 14 | --------------------------------------------------------------------------------