MBS-8393: Extend dynamic attributes to all entities
Sophist-UK has quit
Sophist-UK joined the channel
Nyanko-sensei joined the channel
D4RK-PH0ENiX has quit
Sophist_UK joined the channel
Sophist-UK has quit
Sophist_UK has quit
Sophist-UK joined the channel
Nyanko-sensei has quit
D4RK-PH0ENiX joined the channel
Wizzup has quit
Sophist_UK joined the channel
Sophist-UK has quit
Wizzup joined the channel
Cyna
reosarevok, yvanzo : where does the main rendering file sit ? I mean the one with the headers
Sophist_UK has quit
yvanzo
mo’’in’
Cyna: see root/layout
SothoTalKer: development suspended for months, should get back to it after schema change 2019 Q2 features
alastairp has quit
Cyna
yvanzo: I mean the index.html type of file
alastairp joined the channel
yvanzo
root/layout.tt file when rendering Perl templates, root/layout/index.js when rendering JS templates
homepage is root/main/index.js
Nyanko-sensei joined the channel
D4RK-PH0ENiX has quit
Nyanko-sensei has quit
D4RK-PH0ENiX joined the channel
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.
Cyna
where is the index.html file which usually includes headers where the script for jqueryUi at client exist
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.
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.
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'
Try that out and see if that helps the CI
akhilesh
I was also tried that solution, but it was failing at my system.
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.
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(…)` ).
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
akhilesh
Ok, thanks Mr_Monkey !
Mr_Monkey
No problem !
akhilesh
Mr_Monkey: Should I use same logic for all tests? Or only on, which was failing at CI?
Mr_Monkey
Only the ones where you need to test an error response. Any valid response (200) you can test 'normally'
akhilesh
Ok
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?
Mr_Monkey: I used postman previously, that is too good.
Mr_Monkey
Yes, that was my next step, let's combine efforts to think about as many use cases as possible
CatQuest
SothoTalKer: some of it coded, but it needs implementation and fixingbecause h code was a while a go
reosarevok: knows more
reosarevok
Oh no
Oh. yvanzo knows more than I do, obviously :)
But yeah, the SQL is already in, there's unfinished code implementation but it probably needs updating
SothoTalKer
yvanzo: are multiple test URLs possible?
gr0uch0mars has quit
Freso
SothoTalKer: Just add multiple entries/tests.
Look at how it’s done for other cleanups.
alastairp
Mr_Monkey: hi
Rotab has quit
> 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.).
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
aidanlw17
Ok thanks alastairp, I mainly was having a tough time with passing the feature paths into the postgres query.
alastairp
yeah! that's a bit complex
I think what you did is basically the best way to do it
aidanlw17
Yeah, especially because I wanted them all to be in a single query
It just got a bit hard to follow
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
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?
alastairp
not for speed, just to remove complexity.
also most of us in the musicbrainz ecosystem are more used to writing sql
it allows us to write a specific query and get all the data that we want
instead of having to work around limitations of the ORM implementation
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
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
alastairp
yeah, that's correct
aidanlw17
So they looked like `SELECT "llj.data->'feature'"` rather than `SELECT llj.data->'feature'`
alastairp
the parameters for .execute are to escape and quote user input
aidanlw17
Okay, so that's why you need to use the placeholder %s and write as "select %(feature)s . ..." % feature instead?
alastairp
right
but be really careful with that query (I'm about to write a comment on it)
you should _never_ pass in user-provided data with string formatting
aidanlw17
For sql injection security?
alastairp
and you're passing in the recording ids, this could potentially cause a security vulnerability
yes
so we have to use string formatting for the columns that we return, but use the params argument to execute for the recording ids