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

Adding Lua Toolbox to MoonRocks #18

Closed
leafo opened this Issue Oct 12, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@leafo

leafo commented Oct 12, 2014

I'd like to start adding the functionality of Lua Toolbox to MoonRocks.

Our stacks are a bit different, you have a pure Lua implementation and use Redis as a database. I'd definitely like to migrate the data you have into Postgres for MoonRocks. I'd also prefer to keep things in MoonScript on my end as well. I don't mind doing all the programming to get the functionality moved over. If you want certain things to work a certain way, like if you have a grand plan for how the ideal Lua Toolbox works, then you should definitely tell me though.

I have two questions:

How do labels work. Have you manually applied all of them?

Endorsements are tied to user accounts, should we have a system to migrate accounts? Are there few enough users where it can be done manually?

@catwell

This comment has been minimized.

Owner

catwell commented Oct 12, 2014

Labels

For now I have applied all the labels myself. I have a flag I can set on any user to add this to module pages:

label

The plan was to make that feature available to everyone eventually but in a more sophisticated form on the UI side (something like autocomplete from existing labels) to prevent errors and proliferation of duplicate labels. See #14.

Eventually I think it would be nice if users could:

  • add existing labels to modules,
  • create new labels, and
  • remove labels from modules (to fix mistakes).

The reason I haven't done it is that I am not sure how to deal with potential abuse of this system. But maybe I'm just worrying too much and we should just trust it won't happen for now...

Users

As of today there are 92 users, of which only 50 have endorsed modules. The only personal information I have about them is their email address (private), username (public) and a bcrypt hash of their password. I have no idea how many of them are also users of MoonRocks (probably most?).

If we can match those users to MoonRocks users it should not be too hard to migrate endorsements once you will have the feature available.

Database

The model is not very complicated and if you move to postgres you don't even need to care about the way I deal with indexes or Redis at all. I have a script that exports the whole DB to a format like this:

{
  labels = {
    {
      name = "network",
      id = 1
    },
    {
      name = "math",
      id = 2
    },
    [...]
  },
  modules = {
    {
      labels = {
        "52"
      },
      version = "0.2-1",
      id = 461,
      url = "https://github.com/mjolnir-io/mjolnir-core",
      dependencies = {
        "462",
        "463"
      },
      name = "mjolnir.screen",
      description = "Mjolnir module to inspect and manipulate screens (i.e. monitors)."
    },
    {
      labels = {
        "8"
      },
      version = "0.1.0-1",
      id = 22,
      url = "http://github.com/lua-nucleo/lua-nucleo",
      dependencies = {
      },
      name = "lua-nucleo",
      description = "A random collection of core and utility level Lua libraries"
    },
    [...]
  },
  users = {
    [...]
    {
      pwhash = "bcrypt hash",
      id = 92,
      email = "...@gmail.com",
      trust_level = 0,
      fullname = "leaf leaf",
      endorsements = {
        "1",
        "14",
        "25",
        "94",
        "262",
        "327"
      }
    },
    [...]
  }
}

I think it would be simplest for you to import data from this.

@leafo

This comment has been minimized.

leafo commented Oct 13, 2014

That database dump looks great.

I think opening up labels up to everyone with an account is probably okay.

I'll get back to you when I have an endorsement system build and then we can figure out the import.

@catwell

This comment has been minimized.

Owner

catwell commented Dec 22, 2016

Closed by luarocks/luarocks-site#86

@catwell catwell closed this Dec 22, 2016

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