#metabrainz

/

      • Nyanko-sensei joined the channel
      • supersandro2000 has quit
      • supersandro20002 joined the channel
      • KindTwo joined the channel
      • KindOne has quit
      • KindTwo is now known as KindOne
      • Nyanko-sensei has quit
      • Nyanko-sensei joined the channel
      • d4rkie joined the channel
      • Nyanko-sensei has quit
      • ishaanshah[m]
        > from the endpoint docs, it's suggested that _only_ the msid and mbid are optional. is that accurate?
      • Zastai: AFAIK, yes only those two fields are optional.
      • Did you find any other field which has to be there but is missing?
      • d4rkie has quit
      • Nyanko-sensei joined the channel
      • thomasross has quit
      • mzfr joined the channel
      • BrainzGit
        [acousticbrainz-server] alastair merged pull request #371 (master…python-upgrade): Upgrade python dependencies https://github.com/metabrainz/acousticbrainz-se...
      • Nyanko-sensei has quit
      • [acousticbrainz-server] alastair opened pull request #375 (master…ab420-unicode-dataset): AB-420: allow unicode characters in MBIDs when uploading a dataset https://github.com/metabrainz/acousticbrainz-se...
      • BrainzBot
        AB-420: Import dataset from CSV error: 'ascii' codec can't decode https://tickets.metabrainz.org/browse/AB-420
      • BrainzGit
        [acousticbrainz-server] alastair opened pull request #376 (master…use-logger): AB-67, AB-366: Use the flask logger instead of print for informational messages https://github.com/metabrainz/acousticbrainz-se...
      • BrainzBot
        AB-67: Integrate new logging handlers from webserver into other parts of the application https://tickets.metabrainz.org/browse/AB-67
      • AB-366: Use flask logger instead of using the root logger or print in manage.py and dumps https://tickets.metabrainz.org/browse/AB-366
      • Nyanko-sensei joined the channel
      • BrainzGit
        [acousticbrainz-server] alastair opened pull request #377 (master…test-baseclass): AB-311: Use a single base test class for all tests https://github.com/metabrainz/acousticbrainz-se...
      • BrainzBot
        AB-311: Use a single base test class for all tests https://tickets.metabrainz.org/browse/AB-311
      • v6lur joined the channel
      • jmp_music joined the channel
      • Chinmay3199 has quit
      • BrainzGit
        [acousticbrainz-server] alastair opened pull request #378 (master…ab439-hl-threads): AB-439: Use concurrent.futures to manage threading in hl extractor https://github.com/metabrainz/acousticbrainz-se...
      • BrainzBot
        AB-439: Improve multithreaded code and speed up HL extractor https://tickets.metabrainz.org/browse/AB-439
      • alastairp
        woo. busy morning
      • ishaanshah[m]: hi, I'd like to talk to you about react in AcousticBrainz some time when you're available
      • Cyna[m]
        reosarevok: made the changes and pushed the PRs :)
      • ishaanshah[m]
        alastairp: Hi, yeah sure, I am free right now
      • alastairp
        ishaanshah[m]: cool!
      • we have a very small react tool in AcousticBrainz, the dataset editor: https://github.com/metabrainz/acousticbrainz-se...
      • it was originally written maybe 4 or 5 years ago, and so doesn't use the recent best-practises in how to set up a react app
      • I upgraded it last week to use the latest react, and to use webpack to compile it, but I'd like to improve it further. Maybe make a separate jsx file per component, and consider using ts
      • it's currently small enough that I think that this is the right time to do it, because if we keep adding more functionality it'll get more difficult to update
      • ishaanshah[m]
        Yep, makes sense, typescript definitely helps a lot in development
      • alastairp
        I thought that since you seem to have some good experience in this are you might want to mentor me with the task ;)
      • *this area
      • ishaanshah[m]
        Mentoring might be a strong word, but yes I would definitely like to help in any way I can :)
      • Mainly I see that multiple components are written in the same file as you said
      • alastairp
        I think I understand enough about the process to move components to a separate file. Is there a good guide or automated tool for migrating to typescript?
      • jmp_music
        alastairp: Good morning! I haven't yet received the dataset link to my email.
      • alastairp
        jmp_music: oh wow, sorry! I left the process copying on Friday afternoon and didn't look at my work computer on the weekend. I'll put that on my todo list today
      • ishaanshah[m]
        Typescript finally compiles to javascript
      • jmp_music
        alastairp: thanks! :)
      • alastairp
        ishaanshah[m]: I understand that typescript removes the requirement for proptypes? Does it use the same mechanism, or is there a different one?
      • ishaanshah[m]
        The way we have setup things on LB is
      • alastairp
        yes, I understand that it compiles to js, I want to know how to add ts features to the source files. Does this have to be done manually, or is there a tool that helps by rewriting some features to ts-specific code?
      • ishaanshah[m]
        There are two containers, one which transpiles all ts code to js and another which type-checks the code
      • I don't think there is a tool available for that
      • alastairp
        I found https://github.com/microsoft/TypeScript-React-C..., which seems to cover many common tasks
      • ishaanshah[m]
        We basically have to tell tsc about the shape of a particular object by defining types
      • alastairp
      • so this command will just tell you if it's found type errors or not?
      • ishaanshah[m]
        yes
      • alastairp
        will it fail to compile to js if there are errors?
      • ishaanshah[m]
        No it won't which aids greatly in development
      • alastairp
        OK, I see. Is this why you have it as two separate steps?
      • ishaanshah[m]
        Because you might wan't to try out some idea but typescript errors keep popping up
      • Refusing to compile
      • alastairp
        ok. right
      • ishaanshah[m]
        So basically we use babels typescript loader for compilation
      • alastairp
        cool, I'll see if I can look at this in the next week or so. If you're interested in helping with these steps then you're also welcome to make some changes!
      • ishaanshah[m]
        I read about it on a blog somewhere I will try and find a link
      • alastairp
        yes, I see that in your webpack config
      • ishaanshah[m]
        alastairp: Sure, I would love to help
      • While you are at I think you should also consider setting up ESLint+Prettier
      • alastairp
        perfect, that's the kind of feedback I want
      • ishaanshah[m]
        I can work on that if you want
      • alastairp
        the ticket we have open for this is AB-442
      • BrainzBot
        AB-442: Improve structure of dataset editor code https://tickets.metabrainz.org/browse/AB-442
      • alastairp
        we have a very small amount of other javascript in the project. We don't need to upgrade this to react, but more recent js standard, or typescript, and eslint/prettier here would also be good
      • ishaanshah[m]
        Yes we can do that
      • I will work on setting up ESlint then
      • alastairp
        how do you use prettier in LB? Do you have checks on PRs to see if it doesn't fulfil the guidelines, or do you have tools to automatically reformat the code when needed?
      • I use pycharm. I see that it has built-in support, but I need to see exactly what that means. Maybe I can configure it to reformat when I save
      • ishaanshah[m]
        It will format the code according to the prettier config that we have provided on save
      • alastairp
        OK, there's a config file that we add to the repo, then? That's fine
      • ishaanshah[m]
        Almost all modern ide have support
      • But we still do a check in travis CI to make sure everything is fine
      • I think there are github apps like pep8 speaks for JavaScript too but I havent looked into them yet
      • alastairp
        I use these github checkers in another project. they're very comprehensive
      • this is done with a github action. We should check what actions limits/resources the github plan that metabrainz has
      • reosarevok
        alastairp: oh, that PEP8 thing seems neat
      • (I just saw it keeps complaining about you)
      • alastairp
        reosarevok: I know, yeah?
      • reosarevok
        Wonder if there's a similar one for eslint
      • alastairp
        reosarevok: ^ the image that I just posted now
      • the more sophisticated gh apps will make comments inline on the PR
      • reosarevok
        Does it actually follow the projects' eslint config?
      • blinky43 joined the channel
      • alastairp
      • mueslo_ joined the channel
      • here's the example github action config that we use in the project that gave that warning
      • it looks like it will, because it's run on a checked-out version of your code
      • there's a question here about how many external worker services we want to use... jenkins, circleci, travis, github actions...
      • reosarevok
        bitmap, yvanzo ^ would this be a thing we'd want?
      • Zastai joined the channel
      • alastairp
        that is, you can definitely just tell jenkins to run eslint, but the only thing you'd get there is "check failed", rather than detailed in-line commentary
      • ishaanshah[m]
      • HenryG_ joined the channel
      • alastairp: ^ this might help
      • alastairp
        ishaanshah[m]: thanks, I'll add that to my reading list for the task
      • ishaanshah[m]
        Let me know if you run into any issues
      • I will try to open a PR for ESLint by tomorrow night
      • alastairp
        don't feel rushed to open a PR, any contribution by you at any time is welcome
      • oh, there are no minutes limitations for open source repositories
      • BrainzGit has quit
      • blinky42 has quit
      • HenryG has quit
      • mueslo has quit
      • ✖ 107 problems (100 errors, 7 warnings)
      • well thanks, eslint
      • ruaok
        moooin!
      • reosarevok
        alastairp: you don't want to know our eslint numbers :p
      • alastairp
        maybe don't set up that action yet, then ;)
      • Gazooo has quit
      • Gazooo joined the channel
      • reosarevok
        Well, I'd want to be pushed into fixing them
      • We have a ton of open PRs fixing a lot of them
      • ruaok
        I've wished for this a number of time, but I am not sure I really need to install this:
      • alastairp
        the question is how much python can you write in 1 line
      • zas
        meb forums down, I'm on it, upgrade failure, unexpected shit
      • ok, found the issue (and the solution)
      • Mr_Monkey
        prabal: pong
      • prabal
        Hello
      • What are up.sql and down.sql in sql/migrations?
      • To create tables for user-collections, I would have to add a script in migrations right? and also copy it in sql/schemas/bookbrainz.sql ?
      • Mr_Monkey
        Correct
      • Each migration has a file to bring in new changes (up.sql) and to revert back to the previous state (down.sal)
      • sql*
      • prabal
        Oh okay
      • So in my case, down.sql would be about deleting the tables
      • Mr_Monkey
        Correct
      • prabal
        Alright, thankss
      • yvanzo
        reosarevok: it would just complain about us all the time, given that current rules don't go along with current code.
      • reosarevok
        Well, we *should* be fixing eslint issues on files we touch, so
      • zas
        forums are back
      • yvanzo
        thanks zas!