#dev 2019-05-28

2019-05-28 UTC
jjuran, [fluffy], [jgarber], nloadholtes, snarfed, dmartzol, KartikPrabhu, mblaney, loicm and cweiske joined the channel; mblaney left the channel
#
Zegnat
“guineapig for hcards” someone call my name?
[Rose] joined the channel
#
[Rose]
In this case you're unhelpful though
#
[Rose]
Because your website is your hcard
#
Zegnat
Hmm. So what you are saying is I need a bigger sub-h-card?
#
[Rose]
I mean, what is your height in moose? Your weight in IndieWebCats?
#
Zegnat
Interesting, new posting API by Ghost CMS that apparently launches with support in Ulysses and iA Writer https://blog.ghost.org/admin-api/
#
Ruxton
I am approximately 7.5 IndieWebCats tall
#
Zegnat
I weigh 18.6474 IndieWebCats
#
Zegnat
… approximately
#
Zegnat
Woops, this should have gone to chat
#
[Rose]
[manton] posted a good point about why didn't Ghost use MicroPub?
#
Loqi
Disappointed that Ghost created a custom posting API instead of adopting Micropub, which is a W3C recommendation. It’s okay to have Ghost-only APIs as long as you start with standards as a baseline. Now we have fragmented client apps.
#
Zegnat
Ghost to me has always felt like they are just doing their own thing
#
Zegnat
But would definitely have been nice if they had used Micropub
loicm, [frank], [jgmac1106], [tonz], jeremych_ and [calumryan] joined the channel
#
[calumryan]
I know one of their developers comes to my local web meetup group, will bring up Micropub with them and encourage them on here
[kevinmarks] joined the channel
#
Zegnat
That would be awesome, [calumryan]!
loicm joined the channel
#
Zegnat
petermolnar: I believe it is type/subtype where subtype can be identifier+parsableas
#
petermolnar
re formars, re sknebel: http://www.easyrdf.org/converter - add https://petermolnar.net/gopher/index.json into uri, select turtle as output, LET YOUR EYES BLEED
#
Zegnat
E.g. image/svg+xml ; it is svg, but can be parsed with XML parsers
#
petermolnar
interesting
#
petermolnar
because I see ld+json in examples LD, but also json+oembed for oembed
#
Zegnat
oh, interesting, I would have expected oembed+json
#
Zegnat
But maybe oembed defines its own parsing spec
#
Zegnat
Why does the easyrdf converter add XSD type declarations on every one of your values, petermolnar :S
#
Zegnat
I do not think that is a turtle requirement at all
#
petermolnar
^^^ famous last words before diving into RDF specs :D
#
Zegnat
Lets just say I know it is an option, but I do not remember seeing anyone actually doing it back when I was looking at turtle for a SOLID implementation
swentel and [Rose] joined the channel
#
[Rose]
Does anyone have a good link they can share which is basically "crash course in unit tests"? PHP specifically if that helps, the program I need to create them for did not use a framework
[tonz] and [coreagile] joined the channel
#
[coreagile]
While I have practiced TDD for many years, I'm not a PHP programmer. So, take this recommendation with a grain of salt. 🙂.. https://course.testdrivenlaravel.com/
#
[coreagile]
[Rose], you might like...
#
cweiske
you don't need laravel
#
cweiske
just phpunit
#
Zegnat
I would definitely recommend PHPUnit. But I am unsure about a good crash course resource
#
Zegnat
I mostly learned by mucking about
#
[Rose]
My boss and I already found PHPUnit and were planning on using that
#
Zegnat
Correct find there :P
#
[Rose]
I just have very little experience with unit tests, and was hoping to find some good practice guides
#
Zegnat
One thing I like to do is enable the coverage analyser. That’ll tell you what parts of your code aren’t touched by tests yet.
#
[Rose]
Aha, I hadn't found their getting started site yet!
#
[Rose]
Or rather, somehow I was on the wrong one 🙂
#
cweiske
(replace 7 with 8 in that url if you have php 7.2)
#
[Rose]
We're on PHP 7.1 right now on this project
#
aaronpk
IIRC the phpunit getting started guide is what I used to figure it out too
#
aaronpk
but now mostly i copy from examples from my other projects
#
aaronpk
[Rose]: here's a commit where I added phpunit to an old PHP repo that isn't using any framework at all so you can see what it takes to set up some minimal tests https://github.com/aaronpk/oauth.net/commit/b2a655be16b3c0efe9e61cddff8194598fa550c9
#
[Rose]
Thanks! I like having examples to get me started.
#
Zegnat
I have opinions about that test!!!
#
aaronpk
send me a PR to fix it
#
Zegnat
I could
#
Zegnat
It is a good example of how minimal first tests can be :) I would personally avoid loops within single tests. Instead I would have wanted to create a data provider that read all the separate JSON files and then have the test method run on each separate file that way
#
Zegnat
But I will not claim to know what actual best practices are.
#
aaronpk
oh yeah that sounds like a thing
eli_oat joined the channel
#
Zegnat
The single method should really only test 1 thing, separation of concern. Though yours just test the validity of the JSON, so that seems right. But then the test method itself should not busy itself with having to fetch data to test.
swentel joined the channel
#
Zegnat
Not sure if other people do it like that, but it is how I have been approaching it. cweiske probably has better opinions
#
cweiske
our tests always fetch the data they are validating
#
cweiske
do not start with data providers
#
aaronpk
one of the reasons I *dont* like things like that, while "better", is that it makes it harder to figure out what's going on by reading the code
#
cweiske
once you got a basic understanding of writing tests, you can dig deeper and try to use data providers
#
cweiske
but not at first
#
Zegnat
Oh, sure, I just thought the one aaronpk had there was a clear case for a dataprovider
#
cweiske
oh, I thought we were still talking about rose
[jgmac1106] joined the channel
#
Zegnat
Example: https://github.com/microformats/php-mf2/pull/163/files#diff-91cc8480e73d8542730b88fd199de459 - the actual test (testFromTestSuite) just compares parsed HTML with expected JSON. A data provider is used to actually find those pairs on the file system.
[kevinmarks786], [davidmead], [cleverdevil], [tonz], [eddie] and snarfed joined the channel
#
Zegnat
aaronpk as requested, up to you to decide if you think it makes sense: https://github.com/aaronpk/oauth.net/pull/195
#
Loqi
[Zegnat] #195 Use PHPUnit Data Providers to run the test once for every data file
[jgmac1106] joined the channel
#
sebsel
I got my first testing experience from the php-comments IndieWeb library I believe :)
#
sebsel
After that, this is also a nice series of series: https://laracasts.com/skills/testing (will cost money to watch though)
#
sebsel
In general, I like tests as stories about what an application does.
#
sebsel
I would not read in JSON with data for that reason: it tells no story
#
sebsel
but then again, you don't need to adopt the tests-as-documentation mindset to have benefit from it :)
#
sebsel
I have a document, somewhere, but it is scoped to my previous employer and also not in my copyright therefore :(
#
sebsel
closedsource--
#
Loqi
closedsource has -1 karma over the last year
[tbc] and [tantek] joined the channel
#
[tantek]
What is eat
#
Loqi
Food is a post type that represents eating or drinking particular food or drink https://indieweb.org/eat
#
[tantek]
[davidmead] ^^^
[Rose] and benwerd joined the channel
#
aaronpk
Thanks Zegnat!
#
aaronpk
The reason i have that test there is because people hand make those JSON files and send pull requests and I want to make sure the JSON is valid before someone can make the PR
benwerd, [davidmead] and snarfed joined the channel
#
Zegnat
Makes sense!
#
aaronpk
Cool not really important benefit of the new data provider thing is that now each file shows up as a separate test!
gRegorLove_ joined the channel
#
GWG
Afternoon
jbove, benwerd, [kevinmarks], [kevinmarks786], gRegorLove__, [tonz], [chrisaldrich], snarfed, KartikPrabhu and [tantek] joined the channel
#
sebsel
So, for authentication, Microsub points to Micropub. Then enter into the real of tokens and all that stuff. To verify a token, I should check the token endpoint. Should I check for *every* microsub request made to my server?
#
sebsel
does not want to read Aperture source code
#
sebsel
For Micropub that seems fine, because who's posting more than 20 posts a day? (:'D) but for microsub... it's easy to spam token endpoints when scrolling feeds.
KartikPrabhu joined the channel
#
sknebel
true, it's a different rate - for now, we generally assume requests are cheap. if you don't, revocation would not be immediate. I'd suggest a) measuring your request patterns and b) then see how much a really short-term cache does
snarfed and [jgmac1106] joined the channel
#
[jgmac1106]
well I think I did my note correctly (ignore the styling) http://testkirby.jgregorymcverry.com/notes/test but can't reproduce it a second time....the p-content always comes up blank
#
Loqi
test post of a note
#
[jgmac1106]
and then fix the page of notes...but not a bad day of almost progess
snarfed, [kevinmarks786] and [eddie] joined the channel
#
sebsel
so re private posts from the main channel
#
sebsel
I was planning on just implementing something for myself soon
#
sebsel
just showing private posts in the feed if you are logged into my site
#
[eddie]
Ahh that's smart. That's actually related to something else I was gonna tell Jacky
#
sebsel
to me that seems to be the first step, but still a step no-one (but past-aaronpk) has taken
#
[eddie]
There's basically two approaches: Log someone in via IndieAuth
#
[eddie]
The good news that a lot of my internal code that I've built works with both
#
sebsel
(at least I think private posts where a feature of aaronpk's previous site, but it has never returned)
#
[eddie]
Essentially the question is "how do you confirm a person is said url"
#
[eddie]
then after that, the question is "How do you present posts for a person at said url"
#
[eddie]
I've already finished displaying posts for a person at said url
#
[eddie]
If I "masquerade" as Zegnat, I can see a test post I created for him to be able to see
#
jacky
Adding support for letting people remotely log in to my site is definitely doable
#
sebsel
yes. I would say the first part is already solved... you can just use indieauth for that
#
jacky
I'm curious more about the "headless"/reader approach
#
sebsel
the harder part is when readers are involved
#
jacky
lol yupo
#
sebsel
about the displaying of private posts in a feed: I wrote this about it some while ago https://seblog.nl/2018/11/06/3/exploring-queries-for-private-feeds
#
sknebel
a simpler test case might be private webmnetions
#
[eddie]
Correct, you can use IndieAuth to do part one, and then AutoAuth is the proposal for headless part one
#
[eddie]
I should finish up both of those things (IndieAuth and AutoAuth) because I have part two complete so I'm close
#
sebsel
jacky: yea but although the fun and hard part is in the readers, I think you really have to make the first step on your own site first :)
#
jacky
that's not a problem
#
Loqi
I agree
#
jacky
I can add this logic for testing into my site's test suite
#
jacky
has like ~600 tests so far, lol
#
sebsel
tests++
#
Loqi
tests has 4 karma in this channel over the last year (5 in all channels)
leg joined the channel
#
GWG
Re private posts, I would need some underlying infrastructure to get that working on WordPress
#
GWG
So many things, so little time
#
GWG
Can someone come and do my laundry so I can fill that time with Indieweb?
snarfed joined the channel
#
GWG
Maybe I need a donation page for that
snarfed joined the channel
#
snarfed
jacky++ for 600 tests!
#
Loqi
jacky has 13 karma in this channel over the last year (56 in all channels)
#
snarfed
you may appreciate this from ~3y ago: https://snarfed.org/2016-07-14_18206
#
Loqi
[Ryan Barrett] Bridgy hit 1000 unit tests last night! 436 in Bridgy itself, 508 in granary, 56 in webutil. Silly milestone, but I still got excited. Go team. Next up, 2000!
#
jacky
wow! the things we do to make sure nothing goes bump in the night
#
jacky
that video re: private posts UI is good
[tonz] joined the channel
#
jacky
wow lol this talk went from private posts to lowkey talking about CRUD operations for groups
#
jacky
addressing things are hard no matter what you do
#
jacky
yeah that gave me a bit of enough context for what I want to do
#
jacky
might write it up (the thought) before coding it out
jbove, benwerd, [schmarty] and [jgmac1106] joined the channel
#
jacky
for those curious re: private posts, this is how I might go about implementing them
#
jacky
with a note on addressing multiple people
[eddie] joined the channel
#
[eddie]
jacky I like the documentation you just added to /koype
#
[eddie]
hahaha I just read that
#
[eddie]
That's VERY close to how I've started it in abode
#
Loqi
ahahaha
#
sknebel
yeah, similar to how mine works too
#
jacky
trying to be more docs-first then code-immediately-later
#
sknebel
one thing to consider (which I need to call out in AutoAuth spec) is if you want to reveal a URL has hidden content or not
#
sknebel
there's arguments in both directions
#
jacky
sknebel: my way around that might be preventing those posts from using slugs (in Koype, it's either a slug or the internal post UUID that's shown which is meaningless to humans)
#
sknebel
(e.g. Github shows 404 for repos you can't acess, but they have names in there that might have strong relevance)
#
jacky
[eddie]: you have docs about that in abode?
#
[eddie]
It's funny I've done a mixed approach. The visual HTML I return looks like a post doesn't exist, but the code I send back to the client 403
#
jacky
might consider adding this to /private-posts
#
[eddie]
I don't yet
#
[eddie]
I should doc more
#
sknebel
yeah, I also need to clean up bits and put the source with docs online
#
jacky
I think in terms of complexity docs > code
#
sknebel
depends(TM) :)
#
[eddie]
It's tough, because I'm thinking if I might have pages that I would send to family to login (like family photos or something), I would probably want the page to say "Login to view"
#
[eddie]
because my family would probably be confused if they reached a "This post doesn't exist" page before they were logged in
#
[eddie]
The other good thing (for me) is that a url doesn't give much away
#
sknebel
you could always say on post-like urls "there's nothing here you can see. Try logging in?"
#
sknebel
also that
#
[eddie]
currently my url slugs provide a published date, index number and the post type discovered by PTD
#
sknebel
so to be clear, I don't think there's a "right" answer to that, just wanted to point it out as a consideration
#
sknebel
right, in many ways you'll probably only leak "I've been active"
#
[eddie]
the PTD isn't required, but it does redirect you to the proper URL with the Post Type
#
[eddie]
Yeah definitely
#
[eddie]
It's an important thing to think about
#
[eddie]
Since it's still in the "probably only techy people will be dealing with my private posts" phase, that's why I currently return "Does not exist" in the HTML and 403 as the HTTP status
#
[eddie]
oh wait
#
[eddie]
I guess 401 would be more appropriate?
#
sknebel
unless someone has included credentials
#
[eddie]
Yeah, so 401 when not logged in, 403 when they are logged in and don't have access
#
[eddie]
actually I guess I might do 404 if they are logged in
#
sknebel
I need to look at it from the spec too, e.g. discovery should call out that a 404 might still have "you can auth" headers
#
[eddie]
ohhhh that would be interesting
#
[eddie]
So you could send WWW-Authenticate with a 404?
#
[eddie]
Is that what you mean?
#
sknebel
otherwise autoauth wouldn't work with "hidden" private posts
#
sknebel
because it needs to discover the details about *how* to auth for a url to do so
#
[eddie]
ahhh interesting.
#
sknebel
goes check if there's an issue already
#
[eddie]
I need to sit down and finish up my private posts soon. This convo has me itching to finish it up lol
#
sknebel
I really need to wait for other stuff to calm down, but same
#
aaronpk
Anyone want to coordinate on finishing up private posts enough to demo them working between a couple sites by Summit?
snarfed joined the channel
#
sknebel
I can maybe participate with what I already have, so posting (with manual effort)
#
sknebel
summit is darn close
#
sebsel
oh, yes, goals, I like it
[tantek] joined the channel
#
sebsel
I am actually franticly hacking away at the moment
#
jacky
sknebel: I like that enabling language re: "Try logging in"
#
jacky
I've opted for 403 because it's explicitly a "Forbidden". the content _exists_; you (the logged in user) just aren't allowed
#
jacky
that would be sick re: collabs :)
#
sebsel
yea, I do 401 for non logged in users and 403 for logged in users who don't have the right permissions
#
[eddie]
I won't be AT the summit in person, so I can't really show viewing anyone else's stuff. My mine is close enough to being finished that I could post private content including a private reply that could be used in a collaboration demo
#
sknebel
same here
arush, snarfed and [arush] joined the channel
#
sebsel
ok, it's way to late here now, but... committed and deployed :D
#
sebsel
All my checkins are now private
#
sebsel
and you can do the indieauth dance and you get to see them
#
sebsel
also, you will see posts that are visible to you in the feed
#
sebsel
also, there is a /private which will show you all the posts that are specificly shared with you (as opposed to public or private-but-everyone)
#
sebsel
Will try to blog about it somewhere this week :)
#
sebsel
nice, and because of code reuse and filters, my /photos page is now way different if you are logged in vs logged out
#
Loqi
sebsel has 4 karma in this channel over the last year (25 in all channels)
#
doubleloop
sebsel++ nice!
#
jacky
sebsel: sick!
#
GWG
[eddie]: Sorry you aren't coming
snarfed and [jgmac1106] joined the channel
#
Loqi
sebsel has 5 karma in this channel over the last year (26 in all channels)
#
[jgmac1106]
2019 year of"well you don't know what it is the year off because it is a private post"
#
GWG
[jgmac1106]: That's a long name
[tantek] joined the channel
#
[tantek]
sebsel++ whoa that's great! definitely one of my goals for checkins is private by default
#
Loqi
sebsel has 6 karma in this channel over the last year (27 in all channels)
benwerd, snarfed and eli_oat joined the channel
#
[jgmac1106]
Gwg login with Indieauth to see short version
snarfed joined the channel