MBS-12839: Allow searching for edits by kind of edit type
reosarevok
The description our template currently tries to find from the wiki (but AFAICT only exists for https://musicbrainz.org/doc/Edit_Types/314 because I added it last year to test)
MBS-12840: Revert lumping of historic edits into reused names
yvanzo
It would probably be better to help with keeping this documentation synced but there is nothing we cannot do about the current documentation from the wiki atm.
reosarevok
Well, I think we have pretty much no docs, so I was thinking we could decide to use hardcoded docs first, then start actually writing some :D
We can also start on the wiki, but hardcoding from the start makes them translatable, which is nice I guess
That's not even a link to the *appropriate* edit type page, just the generic list
yvanzo
Right, there is no validation for this kind of transclusion I guess?
reosarevok
Not unless you add the edit to the transclusion table, it's the same as with /doc
(I did that with the one I documented)
Guess I'll add a ticket to link to the specific edit type from the sidebar, that should be a trivial fix
alastairp
reosarevok: I'm here now too, tell me when you've finished up with your thing
yvanzo
If there is no edit type using it, it might be safer to shut it down then.
reosarevok
I'll also enter a ticket then to move from wiki to code for descriptions
jasje_ joined the channel
alastairp: as soon as I've entered the tickets I'm all yours
yvanzo
👍
reosarevok
Well, mostly.
yvanzo
To code or to the database.
reosarevok
Yeah. I'm thinking code for now because we don't have an edit type table
yvanzo
(Probably better to the code indeed, dunno)
reosarevok
But that's a bit puzzling, so eventually we might want to change that
yvanzo
We will have a schema change this year ;)
reosarevok
You literally told me you wanted no big changes :D
We'll see :) Something to talk at a team meeting too
yvanzo
It’s not big as it doesn’t affect replication.
(Or maybe it does but just by creating a new dispensable table.)
reosarevok
I mean, it would mean rewriting how we get and use edit data, I guess? Unless it's just kind of a copy of what's already in the code. But certainly doable
so there's a yaml specification which includes things like "this is an endpoint", "these are the parameters", "this is the output"
and it seems like much of this could be autogenerated from a simpler doc, however I'm not sure if it could be autogenerated from musicbrainz-server code
reosarevok
Well, we do have a lot of tests at the very least which are literally "URL, expected response"
alastairp
it looks like there's also a templating/reference syntax (in the editor example there's a bunch of `$ref: '#/components/schemas/Pet'`
So it's kinda there, but for example it doesn't have anything that specifically says the first of those is a search, second a collection browse, third a normal browse. Fourth being a lookup is listed at least
alastairp
that definitely seems like it might be possible to inspect this and generate the structure. Although I guess it has no textual descriptions in it
would it make sense to add textual descriptions directly to the perl code?
reosarevok
What should the descriptions look like?
Stuff like " description: Update an existent pet in the store" in the example?
Yes, I agree that pet is very much a basic thing for MB
lucifer
does that mean AnimalBrainz is on the cards as well?
alastairp
well, we already have a monkey
lucifer
given that AB is being retired we could also reuse the acronym.
alastairp
right. I've not got into parameter definitions in openapi yet, I wouldn't be surprised if it can properly handle it. but again it's a question of deciding if it's easier to auto-generate it from the code, or just carefully maintain the specification manually
reosarevok
I'm guessing the best option long term might be to have a yaml or json file with the definitions, then have code to make the required $ws_defs based on that
So have a specification, and use *that* to generate the code
But not sure if that'd work well
alastairp
oh yeah
lucifer
alastairp: lmk when you have a moment to talk about time zones.
vibhoo_24 joined the channel
reosarevok
Also, yes, I do know the API docs are mediocre
I was aiming for something kinda like this swagger thing but it's hard to do that decently on a wiki (I'm sure it could still be a lot better than what I ended up with, mind)
So do I understand correctly some of our APIs are already documented in Swagger? Where do they live?
I would like to take a quick look to what can be done
s/to/at/
(and to understand where we'd have the finished docs)
> To describe the parameter contents, you can use either the schema or content keyword. They are mutually exclusive and used in different scenarios. In most cases, you would use schema. It lets you describe primitive values, as well as simple arrays and objects serialized into a string.
lucifer
technically, its right but from the user perspective weird.
(see the timestamp of the 3rd, 4th, 5th listen)
alastairp
lucifer: you'll have to explain to me why the 4th has a timestamp of 2pm
lucifer
alastairp: because i submitted it in IST :), whereas the others in NZST.
and when listens are sorted by converting the times to utc, this is how it lines up.
alastairp
can you please give me a list of the timestamps as submitted for all 5 of them?
my initial response to this is "if the timezone changes, then of course the data will be different"