#metabrainz

/

      • reosarevok
        I mean, the whole MB.GuessCase is a mess and I'm not sure how to make it less messy tbh
      • 2021-08-04 21617, 2021

      • bitmap
        which, to get gc in Input/Output, you'll have to import if from Main I guess, which hopefully doesn't introduce its own cycle
      • 2021-08-04 21650, 2021

      • reosarevok
        Well, main doesn't use input/output at least
      • 2021-08-04 21607, 2021

      • bitmap
        yea this is one of the main things we can improve. we shouldn't be attaching modules to a 'gc' object and going through that, just import the modules
      • 2021-08-04 21640, 2021

      • reosarevok
        So, you're suggesting I import the export from Main in Input instead of passing it to the constructor
      • 2021-08-04 21607, 2021

      • reosarevok
        Which seems fine
      • 2021-08-04 21623, 2021

      • bitmap
        right
      • 2021-08-04 21624, 2021

      • reosarevok
        But there's also a *ton* of files that use gc.input.whatever rn
      • 2021-08-04 21639, 2021

      • reosarevok
        I guess the idea is that those would instead import Input and use that?
      • 2021-08-04 21606, 2021

      • bitmap
        yeah, how many files are there?
      • 2021-08-04 21625, 2021

      • reosarevok
        Only 8 or so, actually, they just use it a hundred times :)
      • 2021-08-04 21646, 2021

      • bitmap
        it should be a simple find/replace once you add the imports
      • 2021-08-04 21606, 2021

      • reosarevok
        Yeah
      • 2021-08-04 21610, 2021

      • reosarevok
        I'm wondering about stuff like
      • 2021-08-04 21622, 2021

      • reosarevok
        root/static/scripts/guess-case/MB/GuessCase/Handler/Artist.js adding stuff to gc.regexes
      • 2021-08-04 21629, 2021

      • reosarevok
        Should that be a problem at all?
      • 2021-08-04 21652, 2021

      • reosarevok
        Guess not, that's not even used outside that file
      • 2021-08-04 21620, 2021

      • bitmap
        possibly not a problem but they can really just be moved to constants in the file if they're only used there
      • 2021-08-04 21655, 2021

      • reosarevok
        Well, this basically seems to just check if gc.regexes.ARTIST_EMPTY already exists, and if not it adds all the artist regexes
      • 2021-08-04 21602, 2021

      • reosarevok
        Which seems like a weird way to build this
      • 2021-08-04 21609, 2021

      • reosarevok
        Did this make sense 10 years ago? :D
      • 2021-08-04 21612, 2021

      • bitmap
        yeah, it's checking to make sure it doesn't define them more than once, which isn't a problem if they're in the module scope
      • 2021-08-04 21636, 2021

      • bitmap
        a little, since proper modules didn't exist back then
      • 2021-08-04 21625, 2021

      • reosarevok
        So, all of these MB.GuessCase.artist and whatnot should rather be non default exports we can use?
      • 2021-08-04 21638, 2021

      • bitmap
        I was thinking we'd still put them all in some kind of guessCaseHandlers object and export that
      • 2021-08-04 21657, 2021

      • bitmap
        so we can still do stuff like guessCaseHandlers[entityType].guess()
      • 2021-08-04 21624, 2021

      • reosarevok
        So something like
      • 2021-08-04 21625, 2021

      • reosarevok
      • 2021-08-04 21626, 2021

      • reosarevok
        etc?
      • 2021-08-04 21621, 2021

      • bitmap
        yeah
      • 2021-08-04 21605, 2021

      • reosarevok
        Heh
      • 2021-08-04 21608, 2021

      • reosarevok
        MB.GuessCase.Handler[handlerName](self)
      • 2021-08-04 21623, 2021

      • reosarevok
        So there's a separate Handler[whatever] in the Handler folder
      • 2021-08-04 21651, 2021

      • bitmap
        heh...did you convert the handler files to Flow yet?
      • 2021-08-04 21604, 2021

      • reosarevok
        No
      • 2021-08-04 21613, 2021

      • reosarevok
        Haven't touched those
      • 2021-08-04 21621, 2021

      • reosarevok
        Maybe I should do those before Main? Dunno
      • 2021-08-04 21608, 2021

      • bitmap
        everything is circular so it might not matter where you start :P
      • 2021-08-04 21632, 2021

      • reosarevok
        Heh
      • 2021-08-04 21641, 2021

      • reosarevok
        Well, the current stuff up until Main can at least be done in one go
      • 2021-08-04 21611, 2021

      • reosarevok
        Maybe the next step can be trying to separate Input/Output from Main and import it separately, then?
      • 2021-08-04 21621, 2021

      • reosarevok
        And then worry about the rest of Main
      • 2021-08-04 21614, 2021

      • reosarevok
        Of course, importing from Main without flow is not safe etc :p
      • 2021-08-04 21616, 2021

      • CatQuest linking some casual bossanova to listen to while working https://archive.org/details/lp_new-beat-bossa-nova-means-the-samba-swings_zoot-sims-and-his-orchestra_0/disc1/02.05.+No+Juegues+Con+El+Amor+%3D+Don't+Fool+With+Love.mp3
      • 2021-08-04 21605, 2021

      • bitmap
        reosarevok: sounds good to me
      • 2021-08-04 21607, 2021

      • peterhil has quit
      • 2021-08-04 21620, 2021

      • samthursfield5 has quit
      • 2021-08-04 21659, 2021

      • samthursfield5 joined the channel
      • 2021-08-04 21651, 2021

      • reosarevok
        bitmap: so should Input actually export a new GuessCaseInput or should each page that uses it do that or?
      • 2021-08-04 21638, 2021

      • bitmap
        it should export a new instance
      • 2021-08-04 21611, 2021

      • bitmap
        we never actually create more than one
      • 2021-08-04 21616, 2021

      • reosarevok
        As in export default new GuessCaseInput(); ?
      • 2021-08-04 21620, 2021

      • bitmap
        yeah
      • 2021-08-04 21640, 2021

      • CatQuest
        ack why don't we have release-label label credits
      • 2021-08-04 21649, 2021

      • CatQuest
        it's even more glaring now that relationshis can have the m
      • 2021-08-04 21629, 2021

      • peterhil joined the channel
      • 2021-08-04 21633, 2021

      • CatQuest
        like this release i'm adding has a labelthat very clearl is called "Colpix Records". but mb be like: https://beta.musicbrainz.org/label/eea8df8d-fb12-…
      • 2021-08-04 21639, 2021

      • reosarevok
        bitmap: wait, wtf :D
      • 2021-08-04 21641, 2021

      • reosarevok
      • 2021-08-04 21652, 2021

      • reosarevok
        Why does output use this.gc.output inside it. Am I missing something
      • 2021-08-04 21607, 2021

      • CatQuest
        I'm certain that there must be ticket for this
      • 2021-08-04 21613, 2021

      • CatQuest
        hah
      • 2021-08-04 21615, 2021

      • CatQuest
      • 2021-08-04 21616, 2021

      • BrainzBot
        MBS-11179: Add "label credits" (analog to "artist credits") for label entities
      • 2021-08-04 21620, 2021

      • CatQuest
      • 2021-08-04 21621, 2021

      • BrainzBot
        MBS-10987: Add "label credits" in the release editor
      • 2021-08-04 21641, 2021

      • bitmap
        reosarevok: lol. no it looks silly to me too
      • 2021-08-04 21654, 2021

      • reosarevok
        Hmm
      • 2021-08-04 21654, 2021

      • CatQuest
      • 2021-08-04 21655, 2021

      • BrainzBot
        MBS-11055: Add a "credited as" field for release labels
      • 2021-08-04 21603, 2021

      • CatQuest
        (also a good argument for it)
      • 2021-08-04 21607, 2021

      • reosarevok
      • 2021-08-04 21615, 2021

      • Etua has quit
      • 2021-08-04 21627, 2021

      • reosarevok
        Wonder if this is again connected to the self.getWordsForProcessing = input.splitWordsAndPunctuation.bind(input); bit
      • 2021-08-04 21640, 2021

      • reosarevok
        bitmap: I'll put what I have up, can you take a quick look? Probably easier that way
      • 2021-08-04 21654, 2021

      • bitmap
        sure
      • 2021-08-04 21639, 2021

      • reosarevok
      • 2021-08-04 21620, 2021

      • bitmap
        do you still use the bind?
      • 2021-08-04 21607, 2021

      • bitmap
        not finding it with ctrl f
      • 2021-08-04 21625, 2021

      • reosarevok
        Yeah, it's in Base
      • 2021-08-04 21650, 2021

      • reosarevok
        Diff is too big there
      • 2021-08-04 21656, 2021

      • reosarevok
        Need to load it?
      • 2021-08-04 21658, 2021

      • bitmap
        oh yea
      • 2021-08-04 21616, 2021

      • bitmap
        oh, well
      • 2021-08-04 21641, 2021

      • bitmap
        gc is still a member variable on input but you're exporting new GuessCaseInput(); (no gc passed to the constructor)
      • 2021-08-04 21655, 2021

      • bitmap
        so I'm not sure that'll work until it can import gc
      • 2021-08-04 21601, 2021

      • reosarevok
        I was importing gc
      • 2021-08-04 21616, 2021

      • reosarevok
        and thought then I don't need to pass it to the constructor anymore
      • 2021-08-04 21600, 2021

      • reosarevok
        Since I'm importing it into the file I thought I could just assign it as this.gc = gc (the import)
      • 2021-08-04 21603, 2021

      • bitmap
        oh right
      • 2021-08-04 21610, 2021

      • bitmap
        then you shouldn't be using this.gc anywhere
      • 2021-08-04 21639, 2021

      • bitmap
        if gc is undefined that might mean there's still a circular import though
      • 2021-08-04 21653, 2021

      • reosarevok
        I changed those on both Input and Output
      • 2021-08-04 21610, 2021

      • reosarevok
        Now that doesn't break... but http://localhost:5000/static/scripts/tests/web.ht… just stops working mid-tests, it seems
      • 2021-08-04 21637, 2021

      • reosarevok
        Pushed that version
      • 2021-08-04 21630, 2021

      • bitmap
        yeah firefox just hangs for me
      • 2021-08-04 21635, 2021

      • CatQuest
        oh no.
      • 2021-08-04 21649, 2021

      • reosarevok
        Fun
      • 2021-08-04 21652, 2021

      • bitmap
        while ((matches = regex.exec(output))) { <-- I think this is looping forever
      • 2021-08-04 21603, 2021

      • bitmap
        must've broken some logic there
      • 2021-08-04 21659, 2021

      • peterhil has quit
      • 2021-08-04 21610, 2021

      • reosarevok
        Hmm.
      • 2021-08-04 21617, 2021

      • yvanzo
        we cannot let you alone for a while...
      • 2021-08-04 21600, 2021

      • reosarevok
        bitmap: any idea what changed? :/
      • 2021-08-04 21630, 2021

      • yvanzo
        I continued breaking stuff in MB Docker on my side :)
      • 2021-08-04 21639, 2021

      • CatQuest
        do you mean "we can't leave you alone for one minute!(before somthing bad happens)" ?
      • 2021-08-04 21607, 2021

      • yvanzo
        exactly ;)
      • 2021-08-04 21635, 2021

      • CatQuest
        ah
      • 2021-08-04 21651, 2021

      • reosarevok
        But what broke is a while, so I assume that was the joke :D
      • 2021-08-04 21619, 2021

      • yvanzo
        because we do metajoke at metabrainz ;)
      • 2021-08-04 21611, 2021

      • bitmap
        reosarevok: previousOutput = inputString; <-- should be previousOutput = output; I imagine
      • 2021-08-04 21615, 2021

      • reosarevok
        Sigh. That it should.
      • 2021-08-04 21641, 2021

      • BrainzGit
        [listenbrainz-server] 14alastair opened pull request #1574 (03master…listen-userid): LB-866 (I): Add user_id column to listen table https://github.com/metabrainz/listenbrainz-server…
      • 2021-08-04 21650, 2021

      • reosarevok
        Ok, that seems to fix it, thanks bitmap
      • 2021-08-04 21602, 2021

      • bitmap
        yay
      • 2021-08-04 21622, 2021

      • reosarevok
        Well, that looks like a good place where to leave this (no longer as WIP) then :) for now.
      • 2021-08-04 21653, 2021

      • reosarevok
        Oh, but flow hates this, of course
      • 2021-08-04 21607, 2021

      • CatQuest
        wait flow like the js thing?
      • 2021-08-04 21628, 2021

      • MRiddickW has quit
      • 2021-08-04 21658, 2021

      • yvanzo
        More seriously, tests in dev setup not as straightforward as I thought: Some services (like db) can be shared because there are separate (database) definitions for tests, but some other cannot (like search) and need separate instances. So I'm striving to allow using local clones of our own services. Will discuss that another time, just a note about WIP.
      • 2021-08-04 21624, 2021

      • lucifer
        bitmap: yvanzo: can we plan to deploy this https://github.com/metabrainz/docker-server-confi… ? ideas about downtime needed and any other considerations.
      • 2021-08-04 21657, 2021

      • reosarevok
        Hmm
      • 2021-08-04 21658, 2021

      • reosarevok
        bitmap:
      • 2021-08-04 21659, 2021

      • yvanzo
        lucifer: you don't need to take it down, configs can be changed through the commandline tool.
      • 2021-08-04 21600, 2021

      • reosarevok
      • 2021-08-04 21622, 2021

      • reosarevok
        I guess if I export this instead of the class itself, it's no longer that happy for some reason...
      • 2021-08-04 21639, 2021

      • lucifer
        yvanzo: oh! that's super nice. because we want to test this out first and see if it actually solves our issues.
      • 2021-08-04 21618, 2021

      • bitmap
        reosarevok: that's funny. does (new GuessCaseInput(): GuessCaseInput) work?
      • 2021-08-04 21640, 2021

      • reosarevok
        Yup
      • 2021-08-04 21654, 2021

      • reosarevok
        Thanks
      • 2021-08-04 21620, 2021

      • reosarevok
        Ok, flow happy, now I do think it's time to leave it here :)
      • 2021-08-04 21632, 2021

      • reosarevok
        Thanks! I'll look into it more on my own, and ask if I get stuck
      • 2021-08-04 21604, 2021

      • bitmap
        do you wanna continue the refactoring in this pr, or merge this and open another?
      • 2021-08-04 21626, 2021

      • bitmap
        assuming tests pass
      • 2021-08-04 21639, 2021

      • reosarevok
        Either way works really
      • 2021-08-04 21649, 2021

      • bitmap
        ok, let's merge it if tests pass since some diffs no longer expand by default :)
      • 2021-08-04 21651, 2021

      • reosarevok
        bitmap: so should we just mark https://tickets.metabrainz.org/browse/MBS-11844 as resolved by the new rel editor code?
      • 2021-08-04 21652, 2021

      • BrainzBot
        MBS-11844: The "Add another relationship" button doesn't include attributes when used under two or more relationships
      • 2021-08-04 21605, 2021

      • reosarevok
        (if you have a ticket for that yet, if not maybe add one :D )
      • 2021-08-04 21618, 2021

      • bitmap
        sure. I'll add a ticket
      • 2021-08-04 21631, 2021

      • lucifer
        yvanzo: can you point to me where its described? i couldn't find how to do this one using cli.
      • 2021-08-04 21650, 2021

      • reosarevok
        Thanks!
      • 2021-08-04 21609, 2021

      • yvanzo
        lucifer: rabbitmqctl eval application:set_env
      • 2021-08-04 21634, 2021

      • lucifer
        ah! i see. thanks!! :D
      • 2021-08-04 21658, 2021

      • yvanzo
        lucifer: you can test it (with get_env) on rabbitmq-clash first.
      • 2021-08-04 21643, 2021

      • lucifer
        yes makes sense. i'll also first test on a local instance of rabbitmq.
      • 2021-08-04 21624, 2021

      • lucifer
        yvanzo: I tested all of these but each one return undefined. i haven't yet used `set_env` but i think the value by docker run should at least show up, right? https://www.irccloud.com/pastebin/ZPvUyDZR/
      • 2021-08-04 21656, 2021

      • opal has quit
      • 2021-08-04 21621, 2021

      • opal joined the channel
      • 2021-08-04 21636, 2021

      • MRiddickW joined the channel