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

Add level back to tinylicious #3668

Merged
merged 2 commits into from
Sep 28, 2020
Merged

Conversation

kurtb
Copy link
Contributor

@kurtb kurtb commented Sep 17, 2020

Being able to store ops on disk, rather than fully in memory, makes tinylicious scale better as a service. The functionality used to exist but was removed due to an NPM package security warning. A prior version of level-sublevel does not take a dependency on the package with the security warning.

Being able to store ops on disk, rather than fully in memory, makes tinylicious scale better as a service. The functionality used to exist but was removed due to an NPM package security warning. A prior version of level-sublevel does not take a dependency on the package with the security warning.
@ghost
Copy link

ghost commented Sep 17, 2020

CLA assistant check
All CLA requirements met.

Copy link
Contributor

@tanviraumi tanviraumi 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! Thanks for bringing it back 👍

private readonly db;

constructor(config: Provider) {
this.db = config.get("db:inMemory") ? new InMemoryDb() : new LevelDb(config.get("db:path"));
Copy link
Contributor

Choose a reason for hiding this comment

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

What will the default be? For back compat reasons with our existing usages the default should be inMemory

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point! Even though the config says inMemory: true, we will want to flip it have levelDb as an option. In every other case, use the inMemoryDB.

@kurtb: Can you do it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Default config is inMemory

Copy link
Contributor

@SamBroner SamBroner 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. @tylerbutler had feedback with regards to documentation and testing. I'll let him follow up.

@tylerbutler
Copy link
Member

@kurtb Thanks for the contribution! We're working to ensure all code introduced to the repo has documentation and some tests to help protect it from breaking. This seems especially important in this case since this code isn't exercised in any of our core scenarios today. Could you add some tests and update the Tinylicious readme with information about how to use this?

@markfields
Copy link
Member

markfields commented Sep 25, 2020

If not too much trouble I'd love to see the corresponding @types/ packages pulled in so we can have less any. https://www.typescriptlang.org/dt/search?search=types%2Flevel

@kurtb
Copy link
Contributor Author

kurtb commented Sep 26, 2020

This is simply an npm vulnerability fix and not the introduction of new functionality.

This PR is a revert of #3463 which was made due to "a moderate vulnerability in npm audit, leading to an unpleasant warning for new devs trying out our hello world flow." The only actual change made is using "level-sublevel": "6.6.4" rather than the previous version. Everything else isn't new code.

Latest level-sublevel itself does not have the npm audit warning but a package it depends on does. An earlier version of level-sublevel does not take a dependency on this package.

@tylerbutler
Copy link
Member

@kurtb Thanks for the clarification. Given the history of this code and the state of Tinylicious testing at the moment, testing isn't needed. I would like to update the README with some info about how to activate this. Or is it on by default? What config changes do I need to make? Do I need to specify the path for the db, for example?

I'll merge this in in a few hours. Feel free to push new commits here, or follow up with another PR readme update if that's easier.

Thanks for being patient with us! We're doing a lot of new things at the moment and I'm sorry for the lack of communication on this PR.

@tylerbutler tylerbutler self-assigned this Sep 28, 2020
@kurtb
Copy link
Contributor Author

kurtb commented Sep 28, 2020

Thanks @tylerbutler! I also noticed @markfields added some starter tests - thanks! Once you merge this I'll follow up in the next day or so with the README updates and hopefully some tests too.

This was referenced Sep 12, 2021
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.

6 participants