#musicbrainz-devel

/

      • luks
        1) I don't see why the modules need to depend on each other (with Python's dynamic typing)
      • 2) I don't think modules depending on each other is a big problem
      • yalaforge
        re 1) even a "dynamic" dependency is still a dependency that violates your usual design principles
      • re 2) that's a matter of taste :)
      • luks
        are we talking about the dumb model classes here?
      • yalaforge
        yup
      • luks
        where do you need a reference to the Release class in Artist?
      • yalaforge
        when you request an artist from the web service and set the include parameter to include releases?
      • then you'll want to access the releases (or release groups) using Artist.releases
      • luks
        and where do you need to call Release in the code?
      • (I really don't see it, not just acting stupid :))
      • yalaforge
        I don't have to reference the Release symbol from within the Artist class, that's right
      • hmm.
      • I think to me a logical dependency is just as bad as a real one. and you don't care, that's the difference :)
      • in practice there won't be much of a problem, that's where we agree
      • yalaforge is just looking for a decomposition that would work for strictly typed languages, too
      • after all, I want to create a reference model again. not just one for python
      • luks
        in java you would simply import Artist in Release.java and Release in Artist.java
      • in C++ you would need to use forward declarations, like libmb3 already does
      • yalaforge
        yup. but like I said, there are no modules in java (and also none in c++)
      • in java I'd just throw all model classes into one package and that's it
      • no need to import anything because it's all the same package
      • luks
        right
      • but the classes still depend on each other
      • I honestly don't see the difference :)
      • yalaforge
        if I did cross package boundaries with my imports then you usual architectural metrics reports would detect that
      • well, what's a package in java is more like a module in python
      • (and python packages are something else entirely)
      • that's why pymb2 threw all model classes into one module (1500 LoC, *shudder*)
      • see what I mean?
      • luks
        what about importing all the subpackages into musicbrainz2.models and leave that as an implementation detail
      • yalaforge
        interesting idea
      • luks
        the individual subpackages would work with models, not the subpackages
      • yalaforge
        hmm, then you'd have bidirectional dependencies between __init__.py and the modules, right?
      • luks
        yes
      • but that's hidden :)
      • yalaforge
        :)
      • at least one thing I'm sure of: users of the API should import the package and where the individual classes come from (which modules) shouldn't matter to them
      • ijabz joined the channel
      • so even if we have cycles, we don't have them between packages
      • and that's something really important, IMHO. I guess I can live with a few imperfections on module level
      • yalaforge will ponder about this some more
      • thanks luks!
      • luks
        it's basically the same as the java idea
      • yalaforge
        in a way, yes
      • aCiD2
        Hrm, that whole 10-11am thing didn't happen
      • warp
        :)
      • warp is doing something with revenue taxes
      • aCiD2
        that sounds like heaps of fun
      • warp
        in fact it is
      • because MetaBrainz isn't paying sales tax over the invoices I send there, but I do get sales tax back from the stuff I'm buying for my company here. (If I understand things correctly).
      • alastairp joined the channel
      • philip6137 joined the channel
      • Leftmost
        I'm looking at the schema for NGS and I'm not seeing how subscriptions are stored. I'm assuming I should be including that in my proposal if it's something I'd work on given time.
      • luks
        the current NGS version is very simplified compared to the live version
      • oh
      • subscriptions
      • that's almost identical to the live version
      • editor_subscribe_artist
      • or editor_subscribe_label, editor_subscribe_editor
      • they link to the editor and then the subscribed entity
      • Leftmost
        Very simple tables, I assume?
      • luks
      • the two important columns are editor and artist
      • Leftmost
        Okay, thank you.
      • djce joined the channel
      • djce joined the channel
      • aCiD2
        Some strong applications for GSoC this year!
      • warp
        there is quite some activity
      • ah, I see the first few proposals have been submitted, great!
      • aCiD2: anyway, what can I do regarding edit migration?
      • aCiD2
        warp: read the document!
      • or if you have, we can get talking
      • warp
        I'm reading it now (at 1.3).
      • I assume X under Read-only means that edit type is read-only?
      • aCiD2
        yea
      • warp
        aCiD2: so, what now? :)
      • aCiD2
        If you want to jump in, MOD_REMOVE_TRMID might be any easy one
      • Here's the way I've been developing. Look up the old type of the edit in ModDefs.pm (svn checkout) and then do a "SELECT * FROM public.moderation_closed WHERE type = <type> LIMIT 10"
      • Then try and create a Dict[] format 'data' in the edit type
      • Then write sub upgrade. Next, I run ./admin/MigrateEdits (I usually edit MusicBrainz::Script::MigrateEdits->run to only get edits with type = <type>, editing the SELECT)
      • and keep doing that until it stops erroring
      • warp
        can I do this on master, or should I get a fancy edit-migration branch from you?
      • aCiD2
        Then, I'll go back in and write related_entities, foreign_keys and build_display_data
      • You should do this off this commit:
      • a4c9d8603010f4997ed5b50fe16f400cb97443cc
      • so you might want to do: "git checkout -b read-only-edit-types a4c9d86"
      • Then "git checkout -b blah read-only-edit-types"
      • and it seems that REMOVE_TRMID got purged when we dropped them... so... maybe MOD_EDIT_TRACKTIME?
      • or perhaps MOD_CHANGE_ARTIST_QUALITY
      • warp doesn't know where that commit is.
      • you need to fetch from acid2 first
      • warp
        ok, that worked.
      • aCiD2
        warp: here's a template too:
      • warp
        is anything in Edit/Historic a good example?
      • aCiD2
        yea, they all are probably - but you'll have to check them out one by one, as each one has its own branch atm
      • warp
        there's five files in that directory now, but those aren't edit types I guess.
      • aCiD2
        one of them is
      • warp
        EditReleaseName
      • aCiD2
        yep
      • warp
        ok
      • djce
        I have a couple of quick q's about how mb_server runs under fcgi...
      • First q: how horrible would it be if static resources weren't all directly under /static/
      • say, under /static/$someinteger instead.
      • ?
      • Next q: how can one restart / reload the fcgi processes (e.g. to get them to re-run any "at first start" code), and how quickly can that happen (e.g. would it interrupt service)?
      • anthonynonso joined the channel
      • I think I'm out of questions for now :-)
      • aCiD2
        djce: will $someinteger change?
      • djce
        at release time.
      • aCiD2
        hrm, probably doable...
      • djce
        With regards to static things actually not being static (i.e. at release, they might change), you can do one of two things:
      • (a) ignore it. Put up with the fact that clients might use stale assets.
      • (b) Don't change things, e.g. if you want a different foo.js then call it foo2.js, and one release later you can delete foo.js.
      • (sorry, s/two/three/)
      • (c) Always include a release ID in the URL, so that at each release, the URLs used are all new, thus not cached by clients.
      • anthonynonso
        hi all, i'm new here. looking to apply for GSoC
      • djce
        I see some code along the lines of 'if href=="/static/..."' though.
      • warp
        djce: if it's just to prevent stale data being served, we can just append ?t=$someinteger, the actual resources don't have to be served any differently.
      • djce
      • OK. So, just for stylesheets, or for all "static" assets?
      • aCiD2
        djce: it's not quite the same as MBH-7
      • djce listens
      • warp means that instead of changing the file name, we just change how we request the file (by appending query parameters on)
      • djce
        Yes...
      • which is what MBH-7 is about.
      • aCiD2
        UpdateStyleSheetLinks is about changing file names
      • I thought, anyway
      • anthonynonso
        i've never programmed python, but i'm pretty good with ruby
      • djce
        Yes, but the two things are related, aren't they.
      • aCiD2
        related, but not the same
      • warp
        djce: they are.
      • aCiD2
        anthonynonso: best to ask in #musicbrainz, we're a little busy atm :)
      • anthonynonso
        aCid2: thanks, i'll do that!
      • djce
        MBH-7 is *exactly* what this is about. So, if we're happy to possibly serve stale (say) images, but we can force fresh css, then that's fine:
      • all we need is for UpdateStyleSheetLinks to exist in NGS, then for layout.tt to request main.css?t=$( mtime of main.css )
      • warp
        aCiD2: as long as we are using c.uri_for everywhere, we should be able to extend it to include a release id, right?
      • djce
        where the mtime can either be checked for every request, or if you prefer, at fcgi startup time.
      • warp: sort of.... except for the cases where it's referred to in static assets.
      • warp
        ah, right.. the stuff in /static will have relative links to other stuff in /static. so what I just said is nonsense, or atleast not good enough.
      • aCiD2
        warp: I think so
      • djce
        i.e. static referring to static.
      • aCiD2
        djce: I'm not sure we have that very often though
      • djce
        e.g. root/static/scripts/switch.js: if ($(this).attr("src") == "/static/images/release_editor/edit-off.gif") {
      • root/static/scripts/switch.js: src: "/static/images/release_editor/edit-off.gif",
      • aCiD2
        ah, hrm
      • warp
        ofcourse, we can easily create a c.uri_for equivalent for javascript.
      • not so easy for .css
      • aCiD2 still thinks ETag is a nicer solution, even if it does mean an extra request