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

Fetch all entries to transform #83

Merged
merged 2 commits into from
Apr 9, 2018
Merged

Fetch all entries to transform #83

merged 2 commits into from
Apr 9, 2018

Conversation

connor-baer
Copy link
Contributor

Fixes #82.

@connor-baer connor-baer changed the title Fetch all entries to transform [WIP] Fetch all entries to transform Apr 6, 2018
Copy link
Contributor

@TimBeyer TimBeyer left a comment

Choose a reason for hiding this comment

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

Thanks, this is great 👏
If possible I'd like to see some tests added to https://github.com/contentful/migration-cli/blob/master/test/unit/lib/fetcher.spec.ts which currently doesn't seem to cover entry fetching at all. 😞

Just a quick one where the first request returns one entry, and then the second request also returns one entry with a total of two.

That of course requires skip to be using response.items.length.

})

entries = entries.concat(response.items)
skip += 100
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer not to have a magic number here and use response.items.length.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point!

@connor-baer
Copy link
Contributor Author

connor-baer commented Apr 6, 2018

@TimBeyer I'll add some tests after lunch.

Update: done ✅

@connor-baer connor-baer changed the title [WIP] Fetch all entries to transform Fetch all entries to transform Apr 6, 2018
@Khaledgarbaya
Copy link
Contributor

LGTM although at some point we will change the code to not have all entries in memory at once.
@zcei I think we can merge this.

@Khaledgarbaya Khaledgarbaya merged commit 2c270e5 into contentful:master Apr 9, 2018
@Khaledgarbaya
Copy link
Contributor

@connor-baer Thanks for the PR we'll release a next version soon

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.

3 participants