News for hackers. Stuff that matters.
Re:Ask HN: Developer abused “sign in with GitHub”? by pydry on Friday December 09, 2022 @08:50AM (#33921175)
I can't see the need for an API to star repos at all. There shoulnt even BE a permission, let alone one that is opaquely labeled.
Re:Ask HN: Developer abused “sign in with GitHub”? by ROARosen on Friday December 09, 2022 @09:39AM (#33921631)
Just because you don't find any legitimate use case for this doesn't mean there is no use case. IMHO the more API coverage a platform can provide the better. Obvs only when it's possible to do so in a safe manner.

For instance I'm in the process of building a VScode and browser extension that would automatically star repo's of all npm packages and linked scripts used in your code (including dependencies). I think that's a basic gratitude thing for myself, and a tool some people might be interested in.

Re:Ask HN: Developer abused “sign in with GitHub”? by wpietri on Friday December 09, 2022 @11:37AM (#33923275)
> the more API coverage a platform can provide the better

This is a very common opinion of people who consume APIs, but people maintaining the APIs often feel differently. Every API endpoint is a promise, and it's also a constraint on future innovation. Firefox is a good example, in that their old API allowed extensions to "intimately intertwine" [1] themselves, which proved a huge barrier to improving the Firefox core.

[1] https://arstechnica.com/information-technology/2015/08/mozil...

Re:Ask HN: Developer abused “sign in with GitHub”? by ROARosen on Friday December 09, 2022 @11:48AM (#33923428)
>Every API endpoint is a promise, and it's also a constraint on future innovation.

I'm not referring to keeping any particular API endpoint alive. The problem you raise can be easily mitigated with a correctly built-out API versioning system and - more importantly - API deprecation policy.

I'm referring to just API coverage of platform features. In that sense maintaining API's can be viewed as not much different than maintaining the actual platform features themselves. Obviously the more feature you provide the more maintenance/resources will be required. That goes for both API's and the features themselves.

Re:Ask HN: Developer abused “sign in with GitHub”? by wpietri on Friday December 09, 2022 @11:52AM (#33923495)
Oh? If it's that easy, could you explain how you would have applied that in the Firefox case and avoided the massive problems they experienced?

Because in my view their problem wasn't about API versioning. They came out with a new version and deprecated the old, after all. It was that they provided way too much coverage early on.

Re:Ask HN: Developer abused “sign in with GitHub”? by ROARosen on Friday December 09, 2022 @01:35PM (#33924840)
I don't get your point. There will obviously be cased where API's are not needed or too complicated to maintain, which was presumably the case with Firefox, which BTW is a locally installed platform. I don't see how this affect the general discussion regarding (mostly) web platforms - which usually run on a client-server model anyway - maximizing their API footprint to expose the most functionality possible via their API.

Just because you or anyone working there doesn't see a useful use case for using that functionality over the API doesn't mean there won't be someone who will come up with something useful based on that in the future.

Re:Ask HN: Developer abused “sign in with GitHub”? by wpietri on Friday December 09, 2022 @02:02PM (#33925177)
My point is very simple. You said "the more API coverage a platform can provide the better". I'm saying that's not true because it can create large long-term costs that outweigh the benefits. I even gave an example. I get why you as an API consumer want maximum surface area. But API producers often feel differently, and they have good reason to. I think the better general strategy for API producers is to open up gradually based on actual need discovered via dialog with community.
Re:Ask HN: Developer abused “sign in with GitHub”? by Karellen on Friday December 09, 2022 @01:52PM (#33925057)
Service providers provide APIs.

Devs build apps that use APIs.

Users install apps that use APIs.

Users build their workflows around apps that use APIs.

Sometimes devs get bored/burn out/get a family/die/get a promotion, and stop building new features for apps. Sometimes, if users are lucky, they'll stay on top of security issues. But maybe, users install an app once and never update it even if it is getting updates. Which is risky, but if it works for them, whatever.

Service provider kills API endpoint.

App breaks.

User's workflow breaks. Worked yesterday, does not work today. :-(

Maybe, if the user is lucky, they connect with other users of the app, or users of other apps that are similarly affected, and they figure out workarounds, or someone creates a fork of the app(s) to use your new equivalent endpoint (if you even created one!) and, eventually, after much wailing and gnashing of teeth, they pick up the pieces of their workflow which you just broke and cobble together a new one.

But you caused them hours and hours of pain.

See also https://xkcd.com/1172/

Re:Ask HN: Developer abused “sign in with GitHub”? by mh- on Friday December 09, 2022 @09:58AM (#33921877)
Having seen some pretty deep npm trees, I worry what you're building could end up (accidentally) doing hundreds or thousands of stars.

I'd be careful to not make it recursive, at least - only look at direct dependencies.

Re:Ask HN: Developer abused “sign in with GitHub”? by askiiart on Friday December 09, 2022 @10:25AM (#33922235)
Sounds cool, except that people will get banned. I'd recommend making a menu where people can click on individual dependencies to star, or have a button to star all (but with a very clear warning about the possibilty if getting banned).
Re:Ask HN: Developer abused “sign in with GitHub”? by ROARosen on Friday December 09, 2022 @11:40AM (#33923321)
Great idea! will keep in mind.
Re:Ask HN: Developer abused “sign in with GitHub”? by pydry on Friday December 09, 2022 @10:13AM (#33922056)
Please dont. Your extension will probably get more people banned when they star 1200 repos.
Re:Ask HN: Developer abused “sign in with GitHub”? by AdrianB1 on Friday December 09, 2022 @12:23PM (#33923932)
>> the more API coverage a platform can provide the better

The more attack surface, the better?

Re:Ask HN: Developer abused “sign in with GitHub”? by quesera on Friday December 09, 2022 @10:02AM (#33921923)
Upvoted to counter others' apparent misunderstanding of your comment.

I absolutely agree -- starring repos should be a human act, not an automated one. No need for API exposure of this particular action.

Re:Ask HN: Developer abused “sign in with GitHub”? by matheusmoreira on Friday December 09, 2022 @10:13AM (#33922059)
There absolutely is a need for API endpoints for every single feature present on the web application. What if someone wants to make their own custom client for GitHub?

Curbing automation is not a valid reason for its omission. I can reverse engineer the web page, figure out how it does it and implement it in a script if I want. People have done this to YouTube and Twitter, they can do it to GitHub too and there's absolutely nothing they can do about it.

Re:Ask HN: Developer abused “sign in with GitHub”? by wpietri on Friday December 09, 2022 @02:05PM (#33925216)
Sure, people can do that. And people diving into janky private APIs know that they're taking a gamble, and that things may break at any time. That doesn't in any way oblige GitHub to support them.
Re:Ask HN: Developer abused “sign in with GitHub”? by KMag on Friday December 09, 2022 @10:16AM (#33922117)
There are advantages to opening up all of the functionality of the web front-end as an API to allow alternative front-ends.
Re:Ask HN: Developer abused “sign in with GitHub”? by necovek on Friday December 09, 2022 @09:22AM (#33921461)
In the modern web application architecture, a somewhat "static" frontend uses the API to talk to the backend, so an API is a requirement.

How publicised and easy to use an API is is a different matter, which is why captchas are a thing. Though tbh, I hate captchas.