Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use RON as the primary format #100

Merged
merged 10 commits into from
Nov 3, 2018
Merged

Use RON as the primary format #100

merged 10 commits into from
Nov 3, 2018

Conversation

cblp
Copy link
Member

@cblp cblp commented Oct 28, 2018

For #25


This change is Reviewable

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 19 files reviewed, 2 unresolved discussions

a discussion (no related file):
ron-storage in separate patch


a discussion (no related file):
Types2 -> Types


Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 19 files reviewed, 2 unresolved discussions

a discussion (no related file):

Previously, cblp (Yuriy Syrovetskiy) wrote…

ron-storage in separate patch

#101


Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 15 files reviewed, 2 unresolved discussions

a discussion (no related file):
Remove FF.Storage


Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 14 files at r4.
Reviewable status: 1 of 16 files reviewed, all discussions resolved

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 7 files at r3, 1 of 14 files at r4, 1 of 1 files at r5.
Reviewable status: 5 of 16 files reviewed, all discussions resolved

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 14 files at r4.
Reviewable status: 6 of 16 files reviewed, all discussions resolved

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r6.
Reviewable status: 7 of 16 files reviewed, all discussions resolved

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 14 files at r4.
Reviewable status: 9 of 16 files reviewed, all discussions resolved

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 14 files at r4.
Reviewable status: 10 of 16 files reviewed, all discussions resolved

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 3 files at r7.
Reviewable status: 10 of 17 files reviewed, all discussions resolved

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 3 files at r7.
Reviewable status: 11 of 17 files reviewed, all discussions resolved

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 14 files at r4, 1 of 3 files at r7.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 3 unresolved discussions

a discussion (no related file):
ronRoundtrip


a discussion (no related file):
stack exec ff


a discussion (no related file):
stack exec ff upgrade


Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r8.
Reviewable status: all files reviewed, 3 unresolved discussions

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 3 unresolved discussions

a discussion (no related file):
stack exec ff track


note_status_assign $ TaskStatus Archived

cmdUnarchive :: MonadStorage m => NoteId -> m (Entity Note)
cmdUnarchive nid = modifyAndView nid $ note_status_assign $ TaskStatus Active
Copy link
Contributor

Choose a reason for hiding this comment

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

Хорошо код упростился и более читаемым стал.

pure ()
unless (start <= end) $ throwError "task cannot end before it is started"

note_status_assignIfDiffer
Copy link
Contributor

@willbasky willbasky Oct 30, 2018

Choose a reason for hiding this comment

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

Функция для решения конфликтов двух статусов?
lwwAssignIfDiffer была для любого поля?

{ track_provider = "github"
, track_source = address
, track_externalId
, track_url
Copy link
Contributor

Choose a reason for hiding this comment

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

Почему теперь стиль нижнего подчеркивания вместо camelCase?

singletonTaskModeMap today note = Map.singleton (taskMode today note) [note]

noteView :: NoteId -> Note -> NoteView
noteView nid Note {..} = NoteView
Copy link
Contributor

Choose a reason for hiding this comment

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

Теперь все через тип Note? Не нашел, где он объявлен.


import FF.Storage (Collection, MonadStorage (..), listDocuments,
modify)
import FF.Types (Note)

upgradeDatabase :: MonadStorage m => m ()
Copy link
Contributor

Choose a reason for hiding this comment

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

Апргрейд базы данных будет происходить в ручном режиме или автоматическом?

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Теперь все через тип Note?

Вроде того

Не нашел, где он объявлен.

Генерится в FF.Types

Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @willbasky)

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @cblp and @willbasky)


ff-core/lib/FF.hs, line 309 at r8 (raw file):

Previously, willbasky (Vladislav Sabanov) wrote…

Хорошо код упростился и более читаемым стал.

Спасибо

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @willbasky and @cblp)


ff-core/lib/FF.hs, line 391 at r8 (raw file):

Функция для решения конфликтов двух статусов?

В CRDT нет конфликтов по определению. Эта функция обновляет поле, только если его надо обновить.

lwwAssignIfDiffer была для любого поля?

Да, но использовалась только для одного.

Я завёл задачу о том, чтобы имет возможность обобщать такие конструкции — ff-notes/ron#13

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @willbasky and @cblp)


ff-core/lib/FF/Github.hs, line 107 at r8 (raw file):

Previously, willbasky (Vladislav Sabanov) wrote…

Почему теперь стиль нижнего подчеркивания вместо camelCase?

Мне так кажется более понятным. Например, fooBarBaz — это поле barBaz в структуре foo или поле baz в структуре fooBar? А если написать foo_barBaz или fooBar_baz, то становится понятно.

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @willbasky)

a discussion (no related file):
CHANGELOG


@willbasky
Copy link
Contributor

В строчках 127-152, templete haskell?

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @willbasky and @cblp)


ff-core/lib/FF/Upgrade.hs, line 14 at r8 (raw file):

Previously, willbasky (Vladislav Sabanov) wrote…

Апргрейд базы данных будет происходить в ручном режиме или автоматическом?

Полное обновление формата — в ручном, если я правильно понял вопрос. По команде ff upgrade.

Но при любом изменении данных новая версия всегда записывается в самом новом формате.

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r14.
Reviewable status: all files reviewed, 3 unresolved discussions

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r15.
Reviewable status: all files reviewed, 3 unresolved discussions

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r16.
Reviewable status: all files reviewed, 1 unresolved discussion

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r17.
Reviewable status: all files reviewed, 1 unresolved discussion

@willbasky
Copy link
Contributor


ff-core/lib/FF.hs, line 323 at r16 (raw file):

                (Just eStart, Nothing        , Just end) -> Just (eStart, end)
                (Nothing    , Just (Just end), _       ) -> Just (start,  end)
                (Just eStart, Just (Just end), _       ) -> Just (eStart, end)

что означает eStart, время начала редактирования?

@willbasky
Copy link
Contributor


ff-core/lib/FF.hs, line 346 at r16 (raw file):

    note_start_assign start'
    mend <- note_end_read
    case mend of

может mEnd?

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r18.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @willbasky and @cblp)


ff-core/lib/FF.hs, line 323 at r16 (raw file):

Previously, willbasky (Vladislav Sabanov) wrote…

что означает eStart, время начала редактирования?

Время начала задачи после редактирования пользователем. Оно же из editStart берётся.

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @willbasky)


ff-core/lib/FF.hs, line 346 at r16 (raw file):

Previously, willbasky (Vladislav Sabanov) wrote…

может mEnd?

Done.

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r19.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @willbasky)

@willbasky
Copy link
Contributor


ff-core/lib/FF/Types.hs, line 130 at r16 (raw file):

-}

$(let

Все-таки, мн не ясно, почему для объявления типов используется темплейт хаскель.

@willbasky
Copy link
Contributor


ff-core/lib/FF/Types.hs, line 185 at r16 (raw file):

omitted :: Sample a -> Natural
omitted Sample{..} = sample_total - genericLength sample_items

А для этих типов не используется.

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @willbasky and @cblp)


ff-core/lib/FF/Types.hs, line 130 at r16 (raw file):

Previously, willbasky (Vladislav Sabanov) wrote…

Все-таки, мн не ясно, почему для объявления типов используется темплейт хаскель.

Для того, чтобы из этой же схемы сгенерить типы и функции в других языках.

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @willbasky)


ff-core/lib/FF/Types.hs, line 185 at r16 (raw file):

Previously, willbasky (Vladislav Sabanov) wrote…

А для этих типов не используется.

Эти не входят в схему БД.

@willbasky
Copy link
Contributor


ff-core/lib/FF.hs, line 323 at r16 (raw file):

Previously, cblp (Yuriy Syrovetskiy) wrote…

Время начала задачи после редактирования пользователем. Оно же из editStart берётся.

А зачем засекать время начала и конца редактирования?

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @willbasky)


ff-core/lib/FF.hs, line 323 at r16 (raw file):

Previously, willbasky (Vladislav Sabanov) wrote…

А зачем засекать время начала и конца редактирования?

Никто его не засекает.

@willbasky
Copy link
Contributor


ff-core/lib/FF/Types.hs, line 130 at r16 (raw file):

Previously, cblp (Yuriy Syrovetskiy) wrote…

Для того, чтобы из этой же схемы сгенерить типы и функции в других языках.

То есть это задел на перспективу, чтобы другие из других языков могли пользоваться библиотекой?

Copy link
Member Author

@cblp cblp left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @willbasky)


ff-core/lib/FF/Types.hs, line 130 at r16 (raw file):

Previously, willbasky (Vladislav Sabanov) wrote…

То есть это задел на перспективу, чтобы другие из других языков могли пользоваться библиотекой?

Чтобы для других языков можно было написать другие библиотеки, совместимые с этими же типами.

@cblp cblp merged commit 82ae8ed into master Nov 3, 2018
@cblp cblp deleted the ron-storage branch November 3, 2018 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants