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

enh/import from deck #4939

Merged
merged 20 commits into from
Aug 11, 2023
Merged

enh/import from deck #4939

merged 20 commits into from
Aug 11, 2023

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Jul 17, 2023

  • fixes Trello JSON Import Error #4818
  • Refactor import framework to support multiple board impoards
  • Basic implementation of importing deck json data
    • Boards
    • Stacks
    • Cards
    • Labels
    • Label assignments
    • User/group/circle assignments
  • Tests
    • Import from json
    • Re-import previously exported json
  • Documentation
    • Review documentation about import/export
    • limitations of import/export (attachments, comments, activity)
    • Document occ deck:import changes in changelog

Possible follow ups

  • UI for importing since the API is already there
  • Properly handle import issues and not fail but collect issues and still continue with the import

Notes

  • PHP 8.0 is fine since we need it for 26

  • Useful snipped for comparing the json export of a imported board

diff --git a/tests/integration/import/ImportExportTest.php b/tests/integration/import/ImportExportTest.php
index 00df316f..e3f75f3c 100644
--- a/tests/integration/import/ImportExportTest.php
+++ b/tests/integration/import/ImportExportTest.php
@@ -147,6 +147,8 @@ class ImportExportTest extends \Test\TestCase {
                $tmpExportFile = tempnam('/tmp', 'export');
                file_put_contents($tmpExportFile, $jsonOutput);

+               self::assertEquals(file_get_contents(__DIR__ . '/../../data/deck.json'), $jsonOutput);
+
                // cleanup test database
                $this->connection->rollBack();
                $this->connection->beginTransaction();

@cypress
Copy link

cypress bot commented Jul 17, 2023

Passing run #1261 ↗︎

0 15 0 0 Flakiness 0

Details:

Merge 20f0e8e into 863e729...
Project: Deck Commit: f8156e19b2 ℹ️
Status: Passed Duration: 01:48 💡
Started: Aug 11, 2023 4:53 PM Ended: Aug 11, 2023 4:55 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@juliusknorr juliusknorr force-pushed the enh/import-from-deck branch 3 times, most recently from 5c7116f to 3bf1de9 Compare July 18, 2023 09:49
@juliusknorr juliusknorr force-pushed the enh/import-from-deck branch 5 times, most recently from 26600db to 4f60595 Compare July 31, 2023 12:23
@juliusknorr juliusknorr force-pushed the enh/import-from-deck branch 2 times, most recently from 59614a6 to 5f3c262 Compare July 31, 2023 19:54
Copy link
Contributor

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

Looks good thus far. Added some minor comments that came to my mind.

Since this is very php heavy might be good to get a review from a more php savvy person.


Importing can be done using the API or the `occ` `deck:import` command.

Comments with more than 1000 characters are placed as attached files to the card.
Copy link
Contributor

Choose a reason for hiding this comment

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

Comments are not exported, right? At least it says so in the export section - so maybe this should move into the section for the sources that come with comments?

occ deck:import my-file.json
```

In case you are importing from a different instance you may use an additional config file to provide custom user id mapping in case users have different identifiers.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be good to add some more info about the config file here. At least from the docs right now i would not know what to do.

lib/Service/Importer/BoardImportCommandService.php Outdated Show resolved Hide resolved
lib/Service/Importer/Systems/DeckJsonService.php Outdated Show resolved Hide resolved
juliusknorr and others added 7 commits August 11, 2023 14:44
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliusknorr juliusknorr force-pushed the enh/import-from-deck branch from fc7e08f to 71801f3 Compare August 11, 2023 16:13
@juliusknorr juliusknorr marked this pull request as ready for review August 11, 2023 16:14
Signed-off-by: Julius Härtl <jus@bitgrid.net>

docs: Update import docs

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliusknorr juliusknorr force-pushed the enh/import-from-deck branch from e49a308 to 6672843 Compare August 11, 2023 16:24
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliusknorr
Copy link
Member Author

/backport to stable27

1 similar comment
@juliusknorr
Copy link
Member Author

/backport to stable27

@juliusknorr juliusknorr merged commit 390adc9 into main Aug 11, 2023
@juliusknorr juliusknorr deleted the enh/import-from-deck branch August 11, 2023 17:04
@backportbot-nextcloud
Copy link

The backport to stable27 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable27
git pull origin stable27

# Create the new backport branch
git checkout -b fix/foo-stable27

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants