Skip to content

Commit

Permalink
#6 - Changing puzzles format according to pdd
Browse files Browse the repository at this point in the history
  • Loading branch information
iakunin committed Apr 13, 2020
1 parent 1c65369 commit 8c4eb4d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void run() {
}

@Value
//@TODO: rewrite using org.javatuples.Pair
// @todo #6 get rid of FoundOnHackernews.TmpDto using `org.javatuples.Pair`
private static final class TmpDto {
private CodexiaProject codexiaProject;
private GithubRepoSource hackernewsSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void run() {
}

@Value
//@TODO: rewrite using org.javatuples.Pair
// @todo #6 get rid of FoundOnReddit.TmpDto using `org.javatuples.Pair`
private static final class TmpDto {
private CodexiaProject codexiaProject;
private GithubRepoSource redditSource;
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/dev/iakunin/codexiabot/bot/StarsUp.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public void run() {
// Тест-кейсы с двумя последовательными запусками с изменениями состояния github-статистики
// (бот может как сработать, так и нет)

// - Assert the full review text (including timezone!)


log.info("Exiting from {}", this.getClass().getName());
}
Expand All @@ -94,7 +96,7 @@ protected void processStatList(Deque<GithubRepoStat> deque) {
ZonedDateTime.of(
first.getCreatedAt(),
ZoneOffset.UTC
).toString(), //@TODO: check the timezone
).toString(),
firstStat.getStars(),
lastStat.getStars(),
first.getGithubRepo().getFullName()
Expand Down
15 changes: 6 additions & 9 deletions src/main/java/dev/iakunin/codexiabot/codexia/CodexiaModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@

public interface CodexiaModule {

//@TODO: split codexiaModule.sendReview() to codexiaModule.createReview() and codexiaModule.sendReview()
// codexiaModule.createReview() - just a saving to DB
// codexiaModule.sendReview() - real sending review to CDX api

//@TODO: codexiaModule.sendReview() must be used ONLY inside a cron-job
// in other code there should be only a codexiaModule.createReview() calls

//@TODO: check that all the codexiaModule.createReview() calls MUST be inside a transaction

// @todo #6 split codexiaModule.sendReview() to codexiaModule.createReview() and codexiaModule.sendReview()
// - codexiaModule.createReview() - just a saving to DB.
// - codexiaModule.sendReview() - real sending review to Codexia api.
// - codexiaModule.sendReview() must be used ONLY inside a cron-job.
// - In other code there should be only a codexiaModule.createReview() calls.
// - All the codexiaModule.createReview() calls MUST be inside a transaction/
void sendReview(CodexiaReview review);

void sendMeta(CodexiaProject codexiaProject, String metaKey, String metaValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class Project {
private Integer authorId;
private String deleted;

//@TODO: test different timezones
// @todo #6 write tests for different timezones
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss Z")
//@TODO: replace Date with ZonedDateTime
// @todo #6 replace `Date` with `ZonedDateTime`
private Date created;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public abstract class AbstractEntity {
@Column(updatable = false)
@CreationTimestamp
private LocalDateTime createdAt;
//@TODO: choose better created_at postgres-format (with or without TZ).
// @todo #6 choose better created_at postgres-format (with or without TZ).
// Also think of ZonedDateTime in createdAt field.
// ZonedDateTime + timestamptz seems the best way.
// - Test changing of postgres server timezone.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void twoActiveProjectsInRepoButDeletedInCodexia() {
.withBody(
new Joined(
"\n",
//@TODO: extract to json-file
// @todo #6 extract to json-file
"{",
" \"id\": {{ replace request.requestLine.pathSegments.[1] '.json' '' }},",
" \"coordinates\": \"test-project/test-repo\",",
Expand Down

0 comments on commit 8c4eb4d

Please sign in to comment.