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

[Mid v1.3] Backup & Restore Feature #77

Merged
merged 61 commits into from
Oct 24, 2018

Conversation

QzSG
Copy link

@QzSG QzSG commented Oct 24, 2018

Relevant #67
Integrated Expense Book into backup and restore #66

QzSG added 30 commits October 3, 2018 16:21
Add backup file path to user preferences model.

Modified equals to compare backup location

Modified string builder to include backup path
Modify ExtraValues json test file
Add `addressBookBackupFilePath` to typical user prefs json test file
[Model]
UserPrefs is required to be in model manager as commands run can affect user preferences which should be part of model.

Refer to original AB4 architecture diagram

Added getUserPref method to Model interface

Fix UserPref model returning wrong path in getAddressBookBackupFilePath

[Tests]
Fix Stubbed ModelManager in AddCommandTest
Make AddressBookStorage and XmlAddressBookStorage have the required backup methods
As long as AddressBook data are equal, userprefs can be different which is okay
Backup Command currently calls model.backupAddressBook, perhaps we should raise a backup request event from command direct and get handled by storage manager directly as we do not need to modify the model
Impossible to make exception to be thrown on linux even with mocking for invalid paths
Create generic online storage module
Implement working backup to github gist
Modify backup command to accept github backup
Runs worker thread when uploading to github gists

Ui popups with error if invalid access token provided and detected inside worker task.
If success, UI updated with success message and provides url to uploaded Gist
@QzSG QzSG added enhancement New feature or request type.epic A big feature which can be broken down into smaller stories e.g. search type.story A user story type.enhancement An enhancement to an existing story priority.High status.InProgress story.musthave Must have user story labels Oct 24, 2018
@QzSG QzSG added this to the v1.3 milestone Oct 24, 2018
@coveralls
Copy link

coveralls commented Oct 24, 2018

Pull Request Test Coverage Report for Build 144

  • 23 of 187 (12.3%) changed or added relevant lines in 18 files are covered.
  • 7 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-1.6%) to 58.956%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/seedu/address/logic/parser/RestoreCommandParser.java 0 1 0.0%
src/main/java/seedu/address/commons/events/storage/OnlineRestoreEvent.java 0 2 0.0%
src/main/java/seedu/address/logic/commands/BackupCommand.java 6 8 75.0%
src/main/java/seedu/address/commons/events/storage/OnlineBackupEvent.java 0 3 0.0%
src/main/java/seedu/address/storage/GitHubStorage.java 0 3 0.0%
src/main/java/seedu/address/commons/events/model/AddressBookLocalRestoreEvent.java 0 4 0.0%
src/main/java/seedu/address/commons/events/model/ExpenseBookLocalRestoreEvent.java 0 4 0.0%
src/main/java/seedu/address/commons/events/model/ExpenseBookOnlineRestoreEvent.java 0 4 0.0%
src/main/java/seedu/address/commons/events/model/UserPrefsChangedEvent.java 0 4 0.0%
src/main/java/seedu/address/commons/events/storage/LocalRestoreEvent.java 0 5 0.0%
Files with Coverage Reduction New Missed Lines %
src/main/java/seedu/address/logic/commands/BackupCommand.java 1 80.95%
src/main/java/seedu/address/model/ModelManager.java 1 44.68%
src/main/java/seedu/address/storage/GitHubStorage.java 1 0.0%
src/main/java/seedu/address/storage/StorageManager.java 4 19.85%
Totals Coverage Status
Change from base Build 128: -1.6%
Covered Lines: 1705
Relevant Lines: 2892

💛 - Coveralls

Copy link

@ChenSongJian ChenSongJian left a comment

Choose a reason for hiding this comment

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

LGTM

@ChenSongJian ChenSongJian merged commit 1f3cf2c into CS2113-AY1819S1-T13-1:master Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority.High status.InProgress story.musthave Must have user story type.enhancement An enhancement to an existing story type.epic A big feature which can be broken down into smaller stories e.g. search type.story A user story
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants