MBS-8393: Extend dynamic attributes to all entities
2019-06-07 15823, 2019
Sophist-UK has quit
2019-06-07 15845, 2019
Sophist-UK joined the channel
2019-06-07 15833, 2019
Nyanko-sensei joined the channel
2019-06-07 15803, 2019
D4RK-PH0ENiX has quit
2019-06-07 15809, 2019
Sophist_UK joined the channel
2019-06-07 15842, 2019
Sophist-UK has quit
2019-06-07 15825, 2019
Sophist_UK has quit
2019-06-07 15849, 2019
Sophist-UK joined the channel
2019-06-07 15832, 2019
Nyanko-sensei has quit
2019-06-07 15807, 2019
D4RK-PH0ENiX joined the channel
2019-06-07 15849, 2019
Wizzup has quit
2019-06-07 15848, 2019
Sophist_UK joined the channel
2019-06-07 15856, 2019
Sophist-UK has quit
2019-06-07 15844, 2019
Wizzup joined the channel
2019-06-07 15825, 2019
Cyna
reosarevok, yvanzo : where does the main rendering file sit ? I mean the one with the headers
2019-06-07 15823, 2019
Sophist_UK has quit
2019-06-07 15809, 2019
yvanzo
mo’’in’
2019-06-07 15822, 2019
yvanzo
Cyna: see root/layout
2019-06-07 15801, 2019
yvanzo
SothoTalKer: development suspended for months, should get back to it after schema change 2019 Q2 features
2019-06-07 15854, 2019
alastairp has quit
2019-06-07 15857, 2019
Cyna
yvanzo: I mean the index.html type of file
2019-06-07 15813, 2019
alastairp joined the channel
2019-06-07 15839, 2019
yvanzo
root/layout.tt file when rendering Perl templates, root/layout/index.js when rendering JS templates
2019-06-07 15848, 2019
yvanzo
homepage is root/main/index.js
2019-06-07 15832, 2019
Nyanko-sensei joined the channel
2019-06-07 15827, 2019
D4RK-PH0ENiX has quit
2019-06-07 15829, 2019
Nyanko-sensei has quit
2019-06-07 15805, 2019
D4RK-PH0ENiX joined the channel
2019-06-07 15835, 2019
ferbncode
spellew: I think it makes sense to keep it in CB. Why: in CB we can't directly use functions in entities.py if they are present in BU. For example, `get_multiple_entities` fetches data for multiple mbids of different primary entities. get_primary_entities would call specific functions for each entity and we would very much want to get the cached versions to avoid db queries.
2019-06-07 15817, 2019
Cyna
where is the index.html file which usually includes headers where the script for jqueryUi at client exist
2019-06-07 15837, 2019
yvanzo
Cyna: there is no index.html file, jQuery UI is included in root/static/scripts/common.js which is included in root/layout/components/Head.js (which is included i both root/layout.tt and root/layout/index.js mentioned above)
Hi akhilesh ! AS far as I can see, you refactored to use expect instead of should. I think it's a good thing, but that's not the solution that was suggested in the github issue comment I sent yesterday.
2019-06-07 15802, 2019
Mr_Monkey
The fix suggested was to use a try-catch block around your `await chai.request(app).get(…` promise calls, and do your test in the catch block.
2019-06-07 15802, 2019
Mr_Monkey
This is equivalent to saying 'I expect this code to throw an error, and I expect the error to be code XXX and message YYY'
2019-06-07 15848, 2019
Mr_Monkey
Try that out and see if that helps the CI
2019-06-07 15830, 2019
akhilesh
I was also tried that solution, but it was failing at my system.
2019-06-07 15835, 2019
akhilesh
May you try for one test please, if it will work then I will refactor whole. Mr_Monkey
akhilesh: After some research, this commit has one 404 test I modified to pass on the CI server. You can apply the same logic for the other tests.
2019-06-07 15856, 2019
Mr_Monkey
The trick is to use the callback form chai-http`chai.get(…).end(error, response)` instead of using promises (either `chait.get(…).then(response).catch(error)` or using a try…catch block around `await chai.get(…)` ).
2019-06-07 15856, 2019
Mr_Monkey
That also requires we use the callback form for the mocha test itself, and manually call `done()` (don't forget to pass the done callback in the test: `it('should do something', function (done) {…`)
That one test I modified is now passing both locally and on the CI server
2019-06-07 15804, 2019
akhilesh
Ok, thanks Mr_Monkey !
2019-06-07 15838, 2019
Mr_Monkey
No problem !
2019-06-07 15802, 2019
akhilesh
Mr_Monkey: Should I use same logic for all tests? Or only on, which was failing at CI?
2019-06-07 15837, 2019
Mr_Monkey
Only the ones where you need to test an error response. Any valid response (200) you can test 'normally'
2019-06-07 15856, 2019
akhilesh
Ok
2019-06-07 15813, 2019
Mr_Monkey
akhilesh: To answer your earlier question, I think the error handling in `makeEntityLoader` is fine as it is. I tested manually (with postman), and I'm getting the correct errors and messages.
Mr_Monkey: please suggest some more test cases for existing endpoint. What kind of test, I can implement for strong testing?
2019-06-07 15800, 2019
akhilesh
Mr_Monkey: I used postman previously, that is too good.
2019-06-07 15812, 2019
Mr_Monkey
Yes, that was my next step, let's combine efforts to think about as many use cases as possible
2019-06-07 15833, 2019
CatQuest
SothoTalKer: some of it coded, but it needs implementation and fixingbecause h code was a while a go
2019-06-07 15802, 2019
CatQuest
reosarevok: knows more
2019-06-07 15806, 2019
reosarevok
Oh no
2019-06-07 15824, 2019
reosarevok
Oh. yvanzo knows more than I do, obviously :)
2019-06-07 15842, 2019
reosarevok
But yeah, the SQL is already in, there's unfinished code implementation but it probably needs updating
2019-06-07 15851, 2019
SothoTalKer
yvanzo: are multiple test URLs possible?
2019-06-07 15854, 2019
gr0uch0mars has quit
2019-06-07 15859, 2019
Freso
SothoTalKer: Just add multiple entries/tests.
2019-06-07 15821, 2019
Freso
Look at how it’s done for other cleanups.
2019-06-07 15835, 2019
alastairp
Mr_Monkey: hi
2019-06-07 15859, 2019
Rotab has quit
2019-06-07 15817, 2019
alastairp
> Authors obviously have considerable experience with the creation of large-scale and *open* MIR datasets. While any dataset can be criticized for some feature (or absence thereof), this dataset is brilliant for having all the pieces readily accessible notwithstanding the different sources. The genre problem represented in this paper is also nicely considered (i.e., multi-label, variant, etc.).
2019-06-07 15805, 2019
alastairp
we just had a paper accepted which contains ~1m feature files from AcousticBrainz along with genre annotations from 4 different sites for use in automated genre classification algorithms
OK, there's quite a bit of feedback, I'll try and get to it on the weekend
2019-06-07 15830, 2019
aidanlw17
Ok thanks alastairp, I mainly was having a tough time with passing the feature paths into the postgres query.
2019-06-07 15853, 2019
alastairp
yeah! that's a bit complex
2019-06-07 15814, 2019
alastairp
I think what you did is basically the best way to do it
2019-06-07 15835, 2019
aidanlw17
Yeah, especially because I wanted them all to be in a single query
2019-06-07 15856, 2019
aidanlw17
It just got a bit hard to follow
2019-06-07 15811, 2019
alastairp
sqlalchemy has a feature where you can write queries using a syntax that looks like class methods. we don't use it, but I like it for things like this because you can write a loop that generates these types of computational queries
2019-06-07 15845, 2019
aidanlw17
Yeah I've used the class method syntax with sqlalchemy before, do you choose to write the raw queries for speed or other reasons?
2019-06-07 15808, 2019
alastairp
not for speed, just to remove complexity.
2019-06-07 15825, 2019
alastairp
also most of us in the musicbrainz ecosystem are more used to writing sql
2019-06-07 15837, 2019
alastairp
it allows us to write a specific query and get all the data that we want
2019-06-07 15802, 2019
alastairp
instead of having to work around limitations of the ORM implementation
2019-06-07 15857, 2019
aidanlw17
Okay I see. In most cases I find the raw query is clearer to work with
Yeah I can look into doing it that way, it might clean things up a bit
2019-06-07 15852, 2019
aidanlw17
When I was writing the query, using the `:features` syntax then passing the parameters as a dict for the second argument of `connection.execute(query, {"features": features})`, I wasn't able to get the correct paths because they were processed with extra double quotes around them
2019-06-07 15817, 2019
alastairp
yeah, that's correct
2019-06-07 15830, 2019
aidanlw17
So they looked like `SELECT "llj.data->'feature'"` rather than `SELECT llj.data->'feature'`
2019-06-07 15832, 2019
alastairp
the parameters for .execute are to escape and quote user input
2019-06-07 15835, 2019
aidanlw17
Okay, so that's why you need to use the placeholder %s and write as "select %(feature)s . ..." % feature instead?
2019-06-07 15805, 2019
alastairp
right
2019-06-07 15818, 2019
alastairp
but be really careful with that query (I'm about to write a comment on it)
2019-06-07 15834, 2019
alastairp
you should _never_ pass in user-provided data with string formatting
2019-06-07 15854, 2019
aidanlw17
For sql injection security?
2019-06-07 15857, 2019
alastairp
and you're passing in the recording ids, this could potentially cause a security vulnerability
2019-06-07 15858, 2019
alastairp
yes
2019-06-07 15832, 2019
alastairp
so we have to use string formatting for the columns that we return, but use the params argument to execute for the recording ids