#microformats 2020-04-23

2020-04-23 UTC
kino joined the channel
#
gRegorLove
Makes sense
[jgmac1106] joined the channel
#
gRegorLove
So once this is in master, we could bump php-mf2 to 0.5.0 for the next release instead of putting it behind a flag
#
gRegorLove
Though we're still in that special zero major version, where anything can change at any time and API shouldn't be considered stable (according to semver)
[Kevin_Faaborg], [fluffy], [chrisaldrich], beko, chimo, KartikPrabhu and Sajesajama joined the channel
#
gRegorLove
[chrisaldrich] I found this, would appreciate your experience / examples https://github.com/microformats/microformats2-parsing/issues/14
#
Loqi
[Zegnat] #14 Should the specification imply properties for <link> elements?
KarlieKloss, [Aaron_Klemm], alexmingoia[dot], alexmingoia-dot-, alexmingoia, [KevinMarks], KartikPrabhu, [LewisCowles], [chrisaldrich], [tw2113], [mapkyca] and itsme1 joined the channel
#
Zegnat
Slept a solid right hours and now have the headspace to think about stuff again! I'll have a look at https://github.com/microformats/php-mf2/pull/218 again on my lunch break GWG. Let's see if we can get it merged today-ish!
#
Loqi
[dshanske] #218 Parse an image for src and alt
[jgmac1106], Feliciana, Sajesajama, KartikPrabhu, mauz555 and [mapkyca] joined the channel
#
GWG
Zegnat++
#
Loqi
Zegnat has 4 karma in this channel over the last year (64 in all channels)
[jeremycherfas] and [jgmac1106] joined the channel
#
Zegnat
GWG is it OK if I try to commit that patch I shared yesterday to your feature branch? I am not sure GitHub will let me, but I would like to try. But don’t want to get in your way if you’d rather commit all code yourself
#
GWG
Zegnat: I'm fine if you want to. I was going to do it last night, but I was in the HWC West Coast
#
Zegnat
Valid reason to drop it :D
#
Zegnat
Oh, cool, it let me push the commit!
#
Zegnat
I never actually tried pushing straight to someone else’s branch before
KartikPrabhu, itsme1 and [grantcodes] joined the channel
#
GWG
pfefferle does it to me sometimes
#
GWG
Also, he apparently pointed out I'm using WP coding style
#
Zegnat
I don’t think we have a coding style on mf2 parser? Is a bit all over the place
#
Zegnat
I think there are both tabs and spaces for indent throughout those files? Maybe we should set a code style at some point, but I am not too bothered.
#
Zegnat
I pushed a series of 4 minimal commits now, GWG. Hopefully all very self-explanatory.
#
Zegnat
Added a breaking test for the Sally Ride implied h-card. Then a commit that fixes it. Then a commit that brings another test inline with the new code. And finally a commit where I rewrite a broken test to actually be 3 different tests.
#
Zegnat
3 different tests so we can test for no alt, empty alt, and an alt with content.
#
Zegnat
And Travis is done, all tests are green! Nice work on that change, GWG!
#
Zegnat
GWG++
#
Loqi
GWG has 4 karma in this channel over the last year (139 in all channels)
#
Zegnat
Please have a look at the pushes I did, maybe you will realise there is something more that needs to have tests created for it :)
#
Zegnat
I fear a little for https://github.com/microformats/php-mf2/pull/163/ as now all tests with images will need to be tweaked in the microformats/tests repo
[jgarber] joined the channel
#
[jgarber]
Zegnat: GitHub’s struggling again. What’s the change in the PR?
#
Zegnat
[jgarber]: In GWG’s PR? Mostly updating and adding tests to support img alt parsing
#
[jgarber]
Zegnat: Gotcha. Thanks! What are the implications for microformats/tests?
#
Zegnat
Do not know yet. But I do not think microformats/tests was updated with support for alt parsing at all yet? Or was it?
#
[jgarber]
This PR was merged this week. I think it may be related: https://github.com/microformats/tests/pull/109
#
Loqi
[jansauer] #109 Reflect the parsing rules for src and alt attributes on img elements
#
Zegnat
Oh, that might fix it all, yes!
#
Zegnat
I don’t know. The PHP parser is not actually tested against microformats/tests so it is hard to know sometimes.
#
sknebel
aw crap, those had still been open? oops
#
Zegnat
That last PR I linked is to get the PHP parser using microformats/tests, but last time I tried there were lots of incompatibilities.
#
Zegnat
Why did GitHub have to have troubles right now when I am having a bit of a break from work and want to do some mf stuff?!
#
[jgarber]
sknebel: With a little nudging this week, I was able to get a handful of microformats/tests PRs closed out. 😄
#
[jgarber]
Zegnat: I know, right? Rough week for the GitHub operations crew.
#
Zegnat
Tests: 383, Assertions: 849, Failures: 44, Skipped: 1. - when I run my microformats/tests in the PHP parser
#
Zegnat
Tests: 315, Assertions: 787, Skipped: 1. - when I run GWG’s branch with the img alt parsing
#
Zegnat
So there is why the tests are not yet run as part of the PHP parser ;)
#
[jgarber]
What’s the nature of the failures? (generally speaking)
#
Zegnat
Don’t know. First time I ran it in ~2 years
#
Zegnat
Last time I rebased the branch was Aug 24, 2018
#
sknebel
[jgarber]: yeah, but I had totally thought those had been already handled, otherwise I'd done it earlier :/
#
[jgarber]
Oh yeah, a thing or two may have changed since then. 😄
#
[jgarber]
sknebel: Not to worry! I only noticed them since I’ve been using the test suite against some code I’m writing. It got me interested and thinking about microformats/tests.
#
[jgarber]
Feels like it’s _supposed_ to be the canonical authoritative test suite, but it’s also not well-used by parser code bases (maybe?). Or, at least, parser code bases are very out-of-date against the repo.
#
[jgarber]
Those are some unrefined thoughts, though.
#
Zegnat
Aah, still seeing lots of problems with dates
#
Zegnat
I think originally when those tests were created some sort of normalisation was done that the PHP parser does not do: https://gist.github.com/Zegnat/acba170ffb3e1e9b5c983b94057186db
#
Zegnat
IIRC it is correct to *not* normalise
#
Zegnat
Hmm, I should log more of the exact test file and not just the name. Harder to find it in the tests repo now
#
Zegnat
Hmm, looks right in the repo :/ Maybe something else whacky on my end
[LewisCowles] joined the channel
#
Zegnat
Woop, I thought I was fixing how to display test names, and in the process I apparently got it to run (and fail) more tests :D
#
Zegnat
Tests: 432, Assertions: 898, Failures: 68, Skipped: 1.
[KevinMarks] joined the channel
#
Zegnat
[jgarber]: example test fail, microformats-v1/hfeed/simple. Seems to be because it expects to magically add example.com?
#
Zegnat
Do the tests expect all files to be parsed as if fetched from example.com?
#
[jgarber]
Zegnat: That appears to be the assumption, yeah. Not sure if that’s documented anywhere, though.
#
Zegnat
adds that assumption to the PHP test runner
#
Zegnat
https://github.com/microformats/php-mf2/pull/163 - 67 test failures. Feel free to take it for a spin if you want to see it, [jgarber] :)
#
[jgarber]
Zegnat: I’m about fifteen years out of practice on the PHP front… 😂
#
Zegnat
Ah, well, apart from having to run composer install, not a lot of changes in those last fifteen years ;)
#
Zegnat
Waiting for Travis to run the tests. That might give a nice browsable overview of what needs fixing
#
GWG
I see a lot of things going on as I work
#
Zegnat
is working from home today and has an easier time dropping in and out of IRC
#
Zegnat
[jgarber]: there we go, here are a couple of failures. Several I think will need patching for microformats/tests https://travis-ci.org/github/microformats/php-mf2/jobs/678624618
Sajesajama_ joined the channel
#
[jgarber]
Zegnat: If I’m reading that failure right, the PHP parser is _not_ returning `name` ?
#
[jgarber]
Sorry, the first failure at that link.
#
Zegnat
That is correct
#
Zegnat
As in, you are correct, PHP is not returning it but it is in the expected output from the test suite
#
Zegnat
name should only be implied if “no other p-* or e-* properties, and no nested microformats” exist. According to the spec. https://github.com/microformats/tests/blob/master/tests/microformats-v2/h-review/implieditem.html includes other p-* classes.
#
Zegnat
Although, hmm, that may still be a PHP parser bug
#
[jgarber]
Right. And I think the test is demonstrating implied name in the scope of `h-item` (not `h-review`)
#
Zegnat
The h-item has no properties defined at all, not sure why it thinks otherwise
#
[jgarber]
Right. The implied name is for the nested `h-item`, not the top-level `h-review` (where no name is implied in the output).
#
Zegnat
Yep. So probably some mixup there.
#
[jgarber]
No name is implied on the `h-review` because of the rules you noted above.
#
Zegnat
So yeah, now that we can run this again, it is time to go through all failures one by one
#
[jgarber]
So yeah, the test is demonstrating several things at once.
#
Zegnat
The worst are the ones like the third failure, where you have to be very careful in checking why an e- property was not parsed in the same way
#
[jgarber]
1. Don’t imply name when other p- or e- props,
#
[jgarber]
2. Don’t imply name when nested items exist
#
[jgarber]
3. Imply name when neither of the above two conditions are true
#
[jgarber]
Let me take a look.
#
[jgarber]
Oh, hahah, yeah, e- prop test failure output is murder.
#
[jgarber]
Trailing `\n` wasn’t stripped by the looks of it.
#
[jgarber]
Leading `\n` as well.
Sajesajama_ joined the channel
#
Zegnat
And also spacing within the plain text `value` is removed in the PHP parser but not in the test suite
#
[jgarber]
Error 11 looks to be related to sorting types arrays alphabetically.
#
[jgarber]
> `type: [array of unique microformat "h-*" type(s) on the element sorted alphabetically],`
#
Zegnat
Yep, so that definitely needs a PR in the test suite
#
[jgarber]
Re: e- parsing `value` … I think only leadiing/trailing space is to be removed.
#
Zegnat
I think I may look into this omission of implied name, that looks much more like a parser bug, and may get the number of total test failures down
#
[jgarber]
Which needs a PR in the test suite?
#
Zegnat
the alphabetical sorting of the classes
#
[jgarber]
That should be correct. At least in the test that’s breaking in the PHP tests: https://github.com/microformats/tests/blob/master/tests/microformats-v2/h-resume/education.json
#
[jgarber]
(Line 16)
#
Zegnat
is pretty sure we implemented sorting in the parser
#
Zegnat
sort($mfTypes);
#
Zegnat
$mfTypes = array_unique($mfTypes);
#
Zegnat
// Make sure things are unique and in alphabetical order
#
Zegnat
has no idea how that can fail
[tw2113] joined the channel
#
[jgarber]
Error 16 seems to refer to specs that aren’t in microformats/tests… “microformats-v2/h-news/all”
#
Zegnat
According to the test output there on Travis it is the test suite that was expecting the wrong order.
#
Zegnat
Can Travis have grabbed some older version of the tests?
#
[jgarber]
Could be a git submodule init problem…?
#
[jgarber]
(if that’s how the PHP parser is pulling microformats/tests)
#
Zegnat
It is a composer dependency, not a submodule
#
[jgarber]
Ah, gotcha. That’d do it, for sure.
#
Zegnat
Must be the lock file. Since the test suite isn’t versioned, we just point at master
#
Zegnat
After composer update I get https://github.com/microformats/tests/commit/92b5893, still not the very latest commit
#
Zegnat
Ah, I think it may need to be pushed to https://packagist.org/packages/mf2/tests to fetch the very latest stuff!
#
Zegnat
But even just the update to 92b5893 gets us down to 40 failures!
#
Zegnat
And only the first 11 are in mf2 tests, the others are in mf1 backcompat. And I know there are a few still open PRs from gRegorLove to fix some backcompat parsing
#
Zegnat
Ah, the PHP parser is never going to pass on whitespace differences between strings. Because it implements (a version of) https://wiki.zegnat.net/media/textparsing.html
#
Zegnat
Some day I still hope to land https://github.com/Zegnat/php-innertext in mf2. But that is a big oof.
#
Loqi
[Zegnat] php-innertext: 🏃🐉 Run. Here be dragons.
#
Zegnat
sknebel: everytime I am reminded of that innerText implementation I get flashbacks to the beach chairs at Tollwerk ^^^ :D
#
Zegnat
Alright, waiting for Travis to kick at it again. Now hard linked to the latest commit on the github repo
#
Zegnat
!tell aaronpk You are listed as maintainer on https://packagist.org/packages/mf2/tests , the package says it will auto-update, but dev-master has been stuck on a 2018 commit so something seems weird?
#
Loqi
Ok, I'll tell them that when I see them next
Sajesajama joined the channel
#
[jgarber]
Progress!
#
[jgarber]
Looks like whitespace is the primary cause for many of the remaining failures, yeah?
#
Zegnat
Yeah, wish I had a way of ignoring those, but I do not think I can
gRegorLove joined the channel
#
Zegnat
The problem is that I am comparing 2 JSON structures. And sometimes I want to ignore whitespace differences between 2 specific values.
[mapkyca] joined the channel
#
Zegnat
Alternatively I add a flag to the parser that lets you get the old behaviour again.
#
Zegnat
But didn’t the Python implementation also implement the newer whitespace behaviour? Maybe instead of patching how tests are run, we need to look at whether we want to move it forward in the parsing spec
#
GWG
Zegnat: I am saying we may need a custom Assert function then
#
Zegnat
Wouldn’t help because I do not know what items in the JSON output need to use it
#
Zegnat
Would need an entire custom parser
#
Zegnat
I guess I could do it for e-* properties, as those are always value properties next to html properties. And then just strip whitespace from both.
#
Zegnat
But does that guarantee that the test was supposed to pass in the first place? Unsure.
#
GWG
At least things got better
#
Zegnat
Oh definitely! So now it is interesting to just manually check the things that go wrong. And either fix the test suite or fix the PHP parser.
#
GWG
I'm looking forward to getting alt text in.
#
GWG
I think after that settles, srcset
jamietanna joined the channel
#
Loqi
[tantek] #7 Should u-* parsing special case img srcset?
[Aaron_Klemm] and [tantek] joined the channel
#
gRegorLove
Nice to see so much mf2 progress!
#
gRegorLove
It'd be cool if next php-mf2 release passes the test suite
#
GWG
gRegorLove: Is this PR mergable now?
[snarfed] joined the channel
#
KartikPrabhu
it'd be cool if the test suite passes php-mf2 ;)
#
gRegorLove
(scrollback) there is an .editorconfig so it should be all tabs now, thankfully. no coding style specified though. Previous discussion https://github.com/microformats/php-mf2/issues/188
#
Loqi
[gRegorLove] #188 Specify coding standard
#
gRegorLove
Looks good! Can someone review and merge 200, 201, 202?
#
gRegorLove
Think they've been reviewed but not merged.
Zegnat and sknebel joined the channel
#
[tantek]
I have a boring GitHub pull request review for you gRegorLove when you have a moment (timely would be good)
#
gRegorLove
Sure, which one?
#
GWG
Boring?
jamietanna, [mapkyca], vesper and [LewisCowles] joined the channel
#
Zegnat
I guess when we get to the point that all of them pass, we can simply take away the exclude line and we’ll be covered!
#
Zegnat
Added a cheat code, so the microformats/tests branch is now mergable. Rather than being tests that always run, they are tests you can chose to run: https://github.com/microformats/php-mf2/pull/163#issuecomment-618631387
#
[tantek]
ooh do at least some of them always run?
#
gRegorLove
I like it!
#
Zegnat
[tantek]: no, I did not add more granularity than splitting per folder.
#
Zegnat
If you have any ideas on how you’d want to manage that, please leave a comment :)
#
[tantek]
Zegnat, no idea, just worried about having zero tests run by default
#
Zegnat
Oh, no, we have lots of tests running!
#
Zegnat
Just not from the centralised test suite
#
Zegnat
Default when I run PHPUnit in that branch: Tests: 311, Assertions: 777, Skipped: 1.
[chrisaldrich] joined the channel
#
GWG
gRegorLove: Approved
#
gRegorLove
you can merge those as well
#
GWG
Okay. What else is left for a new major release?
#
GWG
Can you milestone?
[Aaron_Klemm] joined the channel
#
gRegorLove
Hasn't been reviewed in a while, so should check if we want to get any others in
#
gRegorLove
I've done some initial checking on 205 and might need to defer on it; could be a complex fix
#
gRegorLove
I think we also need to discuss if next release should be 0.5.0 instead of 0.4.7. img+alt is breaking change
#
gRegorLove
But maybe that doesn't matter since semver says anything can change < 1.0
#
gRegorLove
I think we jumped to 0.4 last time there was a breaking change
#
beko
Breaking change on Patch are bad. Nobody expects this no matter the Major. People look closer if Minor changes.
#
gRegorLove
Yeah, I'm referring to Minor
#
beko
👍
#
GWG
I think 0.50 makes sense