This Week in Programming: GitHub, Trade Sanctions, and Workarounds

There’s just something about when physical borders are imposed on the internet that feels so… wrong. Right?
Of course, the phenomena is not a new one, but this week brings a new instance, this time with restrictions coming to the world of developers, with ZDNet first reporting that GitHub had started blocking developers in countries facing US trade sanctions. The news first appeared with Anatoliy Kashkin, a 21-year-old Russian citizen who lives in Crimea, reporting that he was unable to create new private repositories and that his existing private repositories were disabled.
A byte is a byte, no matter where it is created. Regulating the "exporting" of bytes is ridiculous as it sounds. Remember Zimmerman and the pgp history? Take a look, learn something
— Claudio Cicali 🇪🇺 🇺🇦 (@caludio) July 28, 2019
Crimea is not alone on this list, with a GitHub statement noting that restrictions are currently in place for Crimea, Cuba, Iran, North Korea, and Syria. According to Techcrunch, GitHub has begun enforcing these “new restrictions to prevent users in sanctioned countries from accessing private repositories and GitHub Marketplace, as well as maintaining private paid organization accounts,” although a “selection of GitHub services such as access to public repositories will remain available to everyone.” The restrictions apply to even people simply traveling through these countries, though for some, the difficulties are a bit more dire.
I believe that we, the non-US rest of the world, need to slowly but surely move away from this dependence on US technology and services. It is no longer sustainable to hold 95% of the world "hostage" to the politics of the 5%. With a riskier climate we need to hedge our bets.
— Vlad Olaru (@vladpotter) July 27, 2019
One Iranian GitHub user started a repository asking the company not to ban users there, writing that “GitHub used to be an open and free platform for everyone, but it has decided to restrict Iranian accounts from contributing and being part of the open-source ecosystem. Although we understand GitHub might make this decision under the pressure of US government, we were expecting a more respectful action from GitHub.” Many users are calling on GitHub to take different actions, though the company says its hands are tied by U.S. trade laws. Similarly, many argue that the solution isn’t to make GitHub change course, but rather employ alternative, decentralized Git solutions (git itself, after all, is freely available for anyone to download and use worldwide).
Given that, again, we are dealing with a situation of imposing physical borders on the Internet, there are workarounds, which one Iranian developer had presciently laid out last month in a blog post about what it’s like to be a developer in Iran. Options run the gamut, from virtual private networks (VPNs) to proxies to virtual private servers (VPSs). The author writes that they “have configured bind/named to proxy few certain domain queries through shecan and privoxy to tunnel all supported domains by FOD through FOD, and others through TOR.”
How to export your private #Github repository:
– Make it public.
– Let your private stuff leaked and exposed to the whole world.
– Export or clone it.
– Delete the original GH repo.Dude, it's not wise. Just let them export their private repos. https://t.co/dHPRNVvu9u
— Mohamad Jahani (@mamal72) July 28, 2019
Given that we’re talking about restrictions being imposed on developers, of all people, surely numerous solutions will be found. After all, that’s what you do, right?
Sometimes I wonder why I chose to become a developer. And then I save my code and refresh the page and everything is broken and I continue to wonder.
— Kelly Vaughn (@kvlly) July 30, 2019
This Week in Programming
- GitHub’s Slack App Gets an Update: While we’re here talking about GitHub, let’s talk about talking about GitHub. That is, there’s some new stuff in the GitHub and Slack integration, such as added support for creating deployments, checks, and draft pull requests. According to the blog post, the GitHub and Slack app now uses the Deployments API to list and create deployments in your repositories from your Slack channel, as well as get the status of checks on pull requests, and get notified of new draft pull requests. These features come in the form of simple slash commands, which the GitHub organization owner or repository admin must allow by accepting updated permissions. If you don’t have it, here’s where you can get the GitHub and Slack app.
- One Way to Not Use GitHub: In case you were looking for a bad idea, look no further than the Korean company that offered a drinks-for-stars promo on GitHub, as related in a story by The Register. SK Telecom, the largest wireless communications company in South Korea, was offering free Starbucks drinks to anyone who would star its Metatron Discovery project. As for why this was happening, The Register summarizes the project owner as having said that “it was hard for an open-source project to survive inside a major company and that achieving a high star count would help to prove its worth despite internal company politics.” That post is now gone and replaced with an apology, with the company now saying it will reset the repository.
alias docvker="docker"
alias dovker="docker"
alias docekr="docker"
alias dockver="docker"— Joe Gardiner (@grdnrio) November 17, 2017
- Golang Talks Generics: It’s a topic that has been in discussion since the very beginning, according to a post on the Go Blog this week by Go principal engineer Ian Lance Taylor titled Why Generics? – to be specific, Taylor writes that “Go was released on November 10, 2009. Less than 24 hours later we saw the first comment about generics.” Of course, if you’re familiar with Go, you’ll recognize that this is a topic that’s been in hot debate for a long time, and now it’s back in the forefront, with the language’s march toward Go 2.0. Put simply, “generic programming enables the representation of functions and data structures in a generic form, with types factored out.” Taylor offers the example of a reverse function, which in Go requires two different functions for strings and integers, noting that “what some people new to Go find surprising is that there is no way to write a simple Reverse function that works for a slice of any type.” While most other statically typed languages provide generics for this type of issue, Go does not, and, although interface types offer a sort of workaround, the Go team is proposing another approach, which is laid out in a design draft for adding generics to Go. For a summary, see Taylor’s blog post on the topic, which comes from a talk he gave at GopherCon last week. And if you have any feedback, the team says they’re certainly looking forward to hearing it, though “to be clear, we’re much more interested in feedback on the semantics than on details of the syntax.” The overall goal, he writes, “is to arrive at a design that makes it possible to write the kinds of generic code I’ve discussed today, without making the language too complex to use or making it not feel like Go anymore.”
– We moved off Heroku. It lacked flexibility and we didn’t like being locked in!
– Oh nice! I guess you use containers now? Where do you run them? Google Cloud Run? Managed Kubernetes?
– We use AWS Lambda.
– 😐
– 😐— Fernando Mayo (@fernandomayo) July 31, 2019
- Add a Dash of AI/ML with AWS Amplify Framework: Amazon says it wants to “put machine learning in the hands of every developer,” which it says is now even easier with the latest Amplify Framework update that allows developers to quickly add machine learning capabilities to both Web and mobile apps. This latest update adds a Predictions category to the Amplify Framework, giving developers the ability to identify text, entities, and labels in images using Amazon Rekognition, convert text into a different language using Amazon Translate, text to speech using Amazon Polly, and speech to text using Amazon Transcribe, and interpret text to find the dominant language, the entities, the key phrases, the sentiment, or the syntax of unstructured text using Amazon Comprehend. To get started, check out the get-started tutorial.
- AI-Powered Code Autocompletion and Simple Web Hosting: Let’s leave this off on a happy note, with two nifty tools for developers. First, The Verge writes about an AI-powered autocompletion software that is “Gmail’s Smart Compose for coders”. Called Deep TabNine, this coding autocompleter “uses a deep learning text-generation algorithm called GPT-2, which was designed by the research lab OpenAI, to improve its abilities” and “is trained on 2 million files from coding repository GitHub.” Much like Gmail’s Smart Compose, Deep TabNine “finds patterns in this data and uses them to suggest what’s likely to appear next in any given line of code, whether that’s a variable name or a function,” currently supporting 22 languages. Next, there’s hostyoself, which makes it super simple to, well, “Host yo’ self from your browser, your phone, your toaster.” For the curious, all the code is available in the repository, but for the rest of you, just go to hostyoself.com, drag and drop what you want hosted, and it will spit out a URL for you. The site stays up and online as long as the browser tab is open.
"Can you let me know when you get there?"
"… No." pic.twitter.com/myDKyCGY30
— Chris (@Cyber_Cox) August 1, 2019
Feature image via Pixabay.