Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Conversation

@achingbrain
Copy link
Member

In order to successfully open a datastore we should accept config that tells us how to open the datastore.

Refs: ipld/explore.ipld.io#65

In order to successfully open a datastore we should accept config
that tells us how to open the datastore.

Refs: ipld/explore.ipld.io#65
@achingbrain
Copy link
Member Author

The merge target for this is v1.x.x but it'll require forward-porting to the v3.x.x line.

const latestVersion = migrations.getLatestMigrationVersion()
const repoOptions = {
... // the same storage backend/storage options passed to `ipfs-repo`
}

Choose a reason for hiding this comment

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

Is repoOptions still optional and we just need to make sure to pass it through if provided?

Copy link
Member Author

@achingbrain achingbrain Aug 6, 2020

Choose a reason for hiding this comment

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

It's been passed through by ipfs-repo since migrations were added.

Choose a reason for hiding this comment

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

The readme api methods mention repoOptions as always optional, this is not the case as this change will throw errors. This doesn't matter for ipfs-repo since it is providing passing repoOptions to migrate and revert, but we should remove the optional jsdocs/readme as this is required.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've removed the optional notes in the readme. Which is a bit odd because it makes the options object mandatory, but I think that's ok for now as we are the only consumer of this module and we pass an options object. When I re-PR this against master I'll move the repo options out of the options object to make the options optional again.

src/commands.js Outdated
}

async function migrate ({ repoPath, migrations, to, dry, revertOk }) {
async function migrate ({ repoPath, repoOptions, migrations, to, dry, revertOk }) {

Choose a reason for hiding this comment

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

This file isn't used anymore since the cli.js is deleted, this can go away right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, have removed.

Copy link

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

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

Changes look good.

For reference this is used by ipfs-repo@4.0.0 which is used in js-ipfs@0.48.x. (I looked this up to better understand the version migration paths since there are a couple major versions not yet being used)

@achingbrain
Copy link
Member Author

Yep, I'm going to release this as v1.0.1 which should fix anyone using ipfs@0.48.1 or below who is building from source, then release ipfs@0.48.2 with this in the dist build for anyone not building from source, then port this to merge against v3.0.0, skipping v2.0.0 as ipfs@0.49.0 will ship with v3 if the uint8array migration stuff serendipitously passes an ipfs build, or v1 if it doesn't.

@achingbrain achingbrain merged commit d1faaa2 into release/v1.x.x Aug 6, 2020
@achingbrain achingbrain deleted the fix/require-passing-repo-options-to-migrator branch August 6, 2020 13:34
achingbrain added a commit that referenced this pull request Aug 6, 2020
Adds the changes released in `1.0.1` to master.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants