Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

[#250] Full refactoring (Draft) #271

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

kamilongus
Copy link
Contributor

Now this PR is WIP. Not compiling.

package codesearch.core.index.indexer

import cats.effect.{ContextShift, Sync}
import codesearch.core.index.directory.СindexDirectory.HaskellCindex
Copy link
Member

@neongreen neongreen Jul 2, 2019

Choose a reason for hiding this comment

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

Please fix the Cyrillic C in "CindexDirectory" while you're at it, and all other Cs in the codebase.

Copy link
Contributor Author

@kamilongus kamilongus Jul 7, 2019

Choose a reason for hiding this comment

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

@neongreen Thanks for finding mistake.

@@ -19,27 +19,35 @@ db {

languagesConfig {
haskell {
repository = "hackage"
repoIndexUrl = "http://hackage.haskell.org/packages/index.tar.gz"
Copy link
Member

Choose a reason for hiding this comment

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

Can you change this to https?

repoArchivePath = "./data/meta/ruby/ruby_index.gz"
repoJsonPath = "./data/meta/ruby/ruby_index.json"
scriptPath = "./scripts/update_index.rb"
concurrentTasksCount = 30
}
javascript {
repository = "npm"
Copy link
Member

Choose a reason for hiding this comment

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

Is this a tab? Please no tabs

def upsert(name: String, version: String, repository: String): F[Int] = {
sql"""
INSERT INTO package(name, version, repository, updated_at)
VALUES ($name, $version, $repository, now())
Copy link
Member

Choose a reason for hiding this comment

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

Will this escape name? Because otherwise we might get an SQL injection.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I will check it.

repoArchivePath = "./data/meta/rust/archive.zip"
repoPath = "./data/meta/rust/"
concurrentTasksCount = 30
ignoreFiles = ["test-max-version-example-crate", "version-length-checking-is-overrated", "config.json", "archive.zip", ".git"]
Copy link
Member

Choose a reason for hiding this comment

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

Why is config.json excluded? (Not saying it shouldn't be, just asking why)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@neongreen I can't answer why is so =( but it was originally. I will remove it, thanks.

def batchUpsert(packages: List[PackageIndexTableRow]): F[Int] = {
Update[PackageIndexTableRow](
"""
|INSERT INTO repository_index(name, version, repository)
Copy link
Member

Choose a reason for hiding this comment

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

What are the pipes doing here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@neongreen it's Scala multi-row strings definition syntax.

@neongreen neongreen changed the title [#250] Full refactorng (Draft) [#250] Full refactoring (Draft) Jul 2, 2019
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.

2 participants