#metabrainz

/

      • legoktm
        I added the hi-res versions of the logos, if someone has a hi-res display to test that they get a bigger logo, that would be nice :)
      • stanislas
        Leo_Verto: Yeah, I do
      • LeoVerto: I can use testing db, i am not familiar with POST and PUT html requests
      • Gentlecat
      • LordSputnik
        stanislas: don't test POST, that comes under /creator/
      • Gentlecat
        doesn't look very hi-res :(
      • LordSputnik
        (not /creator/:id)
      • stanislas
        LordSputnik: why ?
      • LordSputnik
        POST is for submitting a new creator entity - to test it you would do the post request with some data, and make sure the new creator existed in the database afterwards
      • stanislas
        LordSputnik: But it's a part of the task
      • LordSputnik: and PUT ?
      • LordSputnik
        stanislas: No, the task only asks you to do GET, PUT and DELETE
      • PUT is for updating an existing entity
      • stanislas
        LordSputnik: ok, didn't see that
      • LordSputnik
        Which is why it works for /creator/:id and POST doesn't (there's not BBID allocated when you make a POST request)
      • stanislas
        seems logical
      • LordSputnik
        So for PUT, you'd want to get an entity, and do a PUT request with some data for one field at a time, and after each PUT, check that the corresponding field in the model has been updated correctly
      • (err, by "get an entity" I mean, set one up in the database, not make a GET request!)
      • stanislas
        I understand
      • LordSputnik
        For DELETE, you'd simply do the request and make sure the master revision for the entity has no data anymore
      • (That's how deleting things in BB works)
      • If we were to actually delete the entity rows, it wouldn't be possible to revert the deletion
      • stanislas
        LordSputnik: To do a PUT request should I just make something like : self.client.put('something') ?
      • legoktm
        Gentlecat: hm, can you use the inspector to see which image is being loaded there?
      • stanislas
        LordSputnik: and what should i put there (as an argument) ?
      • Gentlecat
        background-image: url(/-/images/a/a7/MusicBrainz_logo_135x135.png);
      • LordSputnik
      • stanislas
        werkzeug ?
      • opatel99
        Freso: I already submitted pull request for that branch
      • stanislas
        is it something german ?
      • LordSputnik
        stanislas: no it's written in English
      • stanislas: That's the documentation for self.client
      • stanislas
        I know it is, just funny name for a class
      • LordSputnik
        You need to pass in JSON data as a string to the data parameter. You may also have to set the Content-Type header
      • stanislas: yeah I don't know how the name came about. Perhaps the author is German
      • legoktm
        Gentlecat: weird, okay, I'll mess with it more
      • Gentlecat
        same in safari
      • stanislas
        LordSputnik: And what do you think about the tests i've done so far ?
      • Freso
        opatel99: Yes, I know.
      • That is how I became aware of it.
      • LordSputnik
        stanislas: I've just been looking at it
      • stanislas
        ok
      • LordSputnik
        I would advise splitting out the major bits of testing into separate methods
      • opatel99
        So... what needs to be done by me Freso
      • LordSputnik
        So have one method for the core data, one for aliases, one for relationships
      • Freso
        opatel99: Did you see Mineo's coment on IRC?
      • opatel99
        yeah
      • Freso
        So I'd do that.
      • LordSputnik
        stanislas: your looping over Creator instances is a good way to test differently configured entities though - it'll be useful to set up some entities to have aliases, others to have relationships, and some to have neither and both
      • opatel99
        Freso: I already submitted the branch.
      • stanislas
        I've added Franz Kafka and Metamorphose but they have relationships
      • LordSputnik: Do I have to test relationships?
      • LordSputnik: like aliases ?
      • LordSputnik
        stanislas: If you could. But only test aliases and relationships in GET (the way we create and update them is changing, so no point testing PUT/POST for those at the moment)
      • stanislas: but I'd say focus on splitting the function up and adding PUT and DELETE tests before focusing too much on aliases and relationships
      • stanislas
        LordSputnik: I mean there are annotations, identifiers, disambiguation too
      • LordSputnik
        I'd rather have tests for just the core data for GET, PUT and DELETE than have a GET test with aliases and relationships well covered
      • Freso
        opatel99: Did the task get closed?
      • opatel99
        Nope
      • LordSputnik
        stanislas: same for identifiers - annotations and disambiguation are fairly simple though, so I'd consider that "core"
      • opatel99
        Submitted for review
      • stanislas
        LordSputnik: GET has been covered already (without relationships)
      • Freso
        opatel99: Link me? :)
      • LordSputnik
        stanislas: OK
      • opatel99
      • gcibot
        Picard-226: Cluster new files automatically || 3 days || Code, User Interface || MetaBrainz Foundation
      • stanislas
        LordSputnik: Should I check things like 'ended' ?
      • opatel99
      • LordSputnik
        stanislas: yup, and dates
      • stanislas
        dates are checked actuallly
      • Leftmost
        LordSputnik, I'd say it makes sense to test aliases as well, since they're subresources of that same resource.
      • stanislas
        I am testing all aliases already
      • Freso
      • gcibot
        MB: Include tag name on user/tag/tagname pages || 3 days || Code, User Interface || MetaBrainz Foundation
      • opatel99
        Freso: We are talking about different things.
      • Oh just got the notif
      • Thanks!
      • Freso
        ;)
      • LordSputnik
        stanislas: OK, so, I'd say to split test_creator_get into at least test_good_bbid, test_bad_bbid and test_aliases, then keep going with test_put and test_delete
      • Freso goes to create Picard-226 pt. 2.
      • opatel99
        Freso: Perhaps my solution didnt even deserve to be part 1 and a new comer could probably solve it without my work...
      • LordSputnik
        zas: how's MB OAuth for discourse doing? Would you still like me to help out?
      • zas
        yes
      • LordSputnik
        OK, I can put in a few hours on it, what's the current state of things?
      • zas
        discourse is ready, just need to hook oauth
      • ariscop_ is now known as ariscop
      • LordSputnik
        zas: OK, I think I we can do it via a plugin, I can have a go at writing some Ruby for it. Which server is this hosted on?
      • zas
        cartman
      • gcibot has quit
      • installed under docker, with 3 containers, one dedicated to web, one to data (postgresql), one to redis
      • LordSputnik
        zas: OK, I don't have access to that yet, I think, could you set me up on there?
      • gcibot joined the channel
      • Freso
        opatel99: Tell Mineo that. But bitmap already stated that he didn't think the task was suited for GCI to begin with.
      • opatel99: And you did learn a bunch of stuff trying to figure it out.
      • opatel99
        Freso: True... On to new adventures now!
      • Freso
        🙌
      • opatel99
        LordSputnik: You think I can top stanislas plugin name with `CaliBrainz`?
      • stanislas
        opatel99 : You mean to change CaliBBre to CaliBrainz ?
      • LordSputnik
        opatel99: hehe, I'm not too worried about the name at this point, if you make a plugin with cool features, you may be able to do better than stanislas, but it'd be a challenge ;)
      • stanislas
        It would, I am still working on this plugin :)
      • opatel99
        I am thinking of putting that on backburner for me. I want to try out the other Brainz and other prog styles than just Python by now. Maybe some JS.
      • Freso
        Btw, I would love if someone would poke at https://codein.withgoogle.com/tasks/46471339447... soonishly... ^^;
      • gcibot
        CB: Add indication of review language || 3 days || Code, User Interface || MetaBrainz Foundation
      • LordSputnik
        opatel99: BB has 6 JS tasks
      • zas: I'm going to set up Discourse locally for now, get it working with MB OAuth, then we can try it out on your configured instance
      • opatel99
        LordSputnik: I will start on the theme task.
      • zas
        ok
      • LordSputnik
        opatel99: OK, but that one probably doesn't have a huge amount of JS in
      • opatel99
        LordSputnik: I can play around with the file structure to start ;)
      • Two birds, 1 task
      • stanislas
        opatel99: before you write the plugin, backup your books somewhere else. I've only Harry Potters, Golden Compasses and 'STH's in my calibre library :)
      • (after testing the plugin on my library)
      • opatel99
        stanislas: thanks! I do have quite a few entries in Calibre
      • triggerwarning joined the channel
      • IGLC joined the channel
      • dcentral joined the channel
      • stanislas
        Leftmost, LordSputnik: I am getting 301 error, when trying to : relationships_response = self.client.get('/entity/{}/relationships'.format(creator_gid))
      • opatel99
        LordSputnik: What pages would you like to see for the Flatly test before custom styling?
      • IGLC has quit
      • Is GCi upload working?
      • LordSputnik
        stanislas: hmm, you'll probably have to authenticate
      • stanislas
        LordSputnik: But it is working on the website
      • LordSputnik
        stanislas: To do that, you'll need to set up an OAuthClient in the test fixtures, and link it to a user. Then send a POST request to the authentication endpoint with client_id, grant_type, username and password
      • stanislas
        Why is it working on the website (without authentication) and not here ?
      • LordSputnik
        Ohh, you're using GET
      • Ignore what I said then, let me have a think for a sec
      • (also 401 is Unaothorised, not 301!)
      • 301 is a redirect. try adding a trailing slash
      • stanislas
        another one ?
      • LordSputnik: I have one already in relationships_response = self.client.get('/entity/{}/relationships'.format(creator_gid))
      • ok, misunderstood
      • LordSputnik: It works now
      • thanks
      • LordSputnik
        Good to hear :)
      • stanislas
        LordSputnik: But when trying to delete, I got 401 so your previous thoughts may be helpful now
      • Leftmost
        DELETE will require that you authenticate.
      • stanislas
        How to set up an OAuthClient ?
      • is it OAuth or OAuth2 ?
      • opatel99
        Leftmost: I submitted the flatly before custom styling pictures to the GCi page.
      • OAUTH2
      • dcentral has quit
      • LordSputnik
        stanislas: It's OAuth2 - you'll want to set up the client_id field - the others can probably be left as default
      • triggerwarning has quit
      • opatel99: Those screenshots look quite good with flatly :) how did you get them? manually go to each page, or is there a tool that can do it?
      • opatel99
        LordSputnik: I wrote a little script that went to the urls and fetched a screenshot.
      • I thought 15 minutes writing that would be easier than doing it manually two or three times..
      • LordSputnik
        opatel99: wonderful :)
      • opatel99
        LordSputnik: Here is what I have for the custom so far