Continuous Delivery

No Gravatar

Fredrik Normén på Squeed kommer den 30:e April att prata om Continuous Delivery och hans erfarenheter kring området i det projekt han sitter i just nu för ett finansbolag. Ni kommer att få grundläggande förståelse kring begreppet Continuous Delivery, samt hur Fredrik och hans team har valt att lösa vissa problem i sitt utvecklingsteam, allt från process, källkodshantering, branchning, automatisering etc,  detta med hjälp av Microsoft Team Foundation Server 2012 och NuGet samt andra verktyg och hack!

Detta är ett event via Swenug som sponsras av Squeed AB.

Anmäl er här:

http://www.swenug.se/events/gbg-continuous-delivery

Version Numbers in Public APIs

No Gravatar

I’ve been playing with MangoSpring’s MangoApps Enterprise Edition Complete OpenAPI. It’s a fairly straight forward thing where you typically POST or PUT a JSON structure (or XML) that needs to match some spec and you get JSON (or XML) back.

I also see two, three things that I – in my very humble opinion – typically miss in most APIs.

Version Numbers

A year from now, or even two months, or tomorrow – I have no idea if I’m still complying with the current API. Sure, one way of solving this problem is to never remove anything, and never modify anything so that existing clients would have to change or update. I’m just not a fan of this approach.

Push

This is yet another API where you have to pull and pull and pull – there are no hooks for getting a notification pushed when something happens (such as a user posting a status update on a project wall).
(Workaround: start parsing e-mail content. Hopefully they contain custom headers that can be easily used.)

OAuth

To integrate with MangoApps, you need to store a base64 encoded version of an account’s password. I’d really prefer to use OAuth2 tokens and have that kind of control. It’s not a huge difference, but exposing the password exposes “everything” that user account has access to. With a token that limits access to the public Open API only, you know the limits of that API at least. Preferably, you could limit parts of the API as in having the client request access to parts of the API which can be granted or not, and revoked.

Protocol/Schema Validation

This is clearly a love/hate thing, but having spent too long on tracing down things like: “it’s not called `userid` in the protocol (as in the free text documentation), it’s `username`” without any proper error messages, you start longing for that JSON/XML schema …

Completeness

There’s a couple of things missing: “Ideas” and “Wikis” aren’t in there at all as far as I can see; when you post status updates you can’t control whether to enable/disable previews of the first URL in the post; “to [list] multiple users, send the User IDs as a comma separated string”; there are input fields marked REQUIRED which aren’t part of the example calls listed.

Reference Implementations

I assume MangoSpring do their regression testing of the OpenAPI using curl and diff. On one hand, I think that’s perfectly fine: that way you test your API at the lowest level and don’t accidentally miss out on bugs “covered” behind some client library. On the other hand, zero reference implementations typically means no-one is using this for anything useful. (Our stuff is not yet used for anything useful, but we hope for that to happen eventually. The currently very embryonic stuff/spike is at GitHub.)

Conclusion

It’s obvious their own clients use some other API. I didn’t set out to give a short review of the API here – it just ended up that way. :-)

I simply wanted to ask: “Do you think version numbers belong in an API, or an API’s endpoint URI?”

Øredev 2012

No Gravatar

We, Adam Lith and Magnus Härlin, from Squeed attended the Øredev conference this year, and we want to share our experience of this event.

How pairing adds value – Lisa Crispin (@lisacrispin)

Lisa Crispin made an excellent presentation on the subject of pair programming. She discussed why people might have a hard time starting to pair up, such as feeling uncomfortable and exposed. She also made several good arguments of the downside of pair programming as in the difficulty to get in the “zone”. She made one point which gave a nice transition to the next session we went to by Ryan McGeary, and that point was that even though you have a harder time getting into the zone as a pair, you will have a much more disciplined focus from not having your attention stolen from things such as Twitter, Facebook or emails.

Asynchronous Collaboration – Ryan McGeary (@rmm5t)

All in all this was one of the most thought provoking presentations, touching a very controversial subject, and therefore it deserved its very own blog post.

Software won – so what now? – David Rowan (@iRowan)

Volunteer your time and make great things. Lots of charity hacker groups have popped up and helped in different areas like maps with weather forecasts and videos from the New York storm.

Anything is possible. The tools and the platforms are here, the developers are the rock stars and can change the world.

Organizations where you can report if you paid a bribe to any official with all the data open so that everyone can see who are taking bribes and the extent of the corruption. With open data a lot can be achieved.

2 billion people currently connected to the internet, a number that is estimated to grow to 5 billion within 5 years. The reach of a good idea is endless.

Pure Functional Javascript – Christian Johansen (@cjno)

Informative session focusing on how to only use side effects and mutability where it is really necessary and the benefits that gives.

Pure functional functions are functions without side effects which make them easier to test and the risk for subtle bugs is reduced. The functions that have side effects should be isolated.

It is possible to use first class functions, functions that are declared as variables. That enables higher order functions that accepts functions as arguments or functions that return other functions. Utilizing that makes it easier to create small abstractions for common tasks.

For-loops can often be replaced with the foreach, map or reduce depending on the purpose of the loop. It gives a shorter more readable code.

Advanced Raven Db – Aeynde Rahien (@ayende)

Raven Db is a document database and compared to a lot of other document databases it has good tooling to view, update, import and export data. The size of the database only has a fractional impact on performance for read and write operations. The indexes are automatically created based on usage. First time a query is run a temporary index is created, it takes between 10 – 20 ms. If the same index is used multiple times it will be persisted as a permanent automatic index. All index updated and creates are done on the fly by a background thread. 

Any data that is stored can be queried. Raven utilizes Lucene so it is possible to make full text search as well as fuzzy search that gives suggestions if no matches are found. For data aggregation map reduce queries are used and they are created automatically and can also be updated without being recreated if the underlying data is changed. 

The Raven Db server can be run as a console application, in memory or as a Windows service. When running tests it’s very handy to use the in memory server. The only thing needed is to change to the connection string.

Micro-Services Architecture – Fred George (@fgeorge52)

As the session heading suggests, Micro-Service architecture consists of a lot of small services that only have one responsibility each which makes them quite small at about 100 lines of code in each service. This enables very rapid deployment of each service as soon as it is ready for release. Every service should be able to be deployed on its own. The messages that are passed around by the services are formatted in JSON. In the reference project that Fred referred to they had used Kafka for message passing. 

By using this setup the the micro services are made language agnostic. The services should be self monitoring and report problems that stops message processing. Multiple versions of the same service can exist, this way there won’t be any problems with several services needing to be updated at the same time.

Git scaling at GitHub – Vicent Martí (@vmg)

Vicent talked about the challenge of scaling the Github service. We won’t go into the details of this, but it was truly fascinating and we as windows users look forward to the future release of libgit2!

A note worthy to mention was that Vicent was excellent at rhetoric, and we would gladly listen to him again.

Exploring Datomic – Tim Ewald

This session blew our minds. Tim held a session about the Datomic database, with a very unique rethinking of the client-server architecture of most databases today. If this database is as promising as described by Tim, then you can expect a whole blog post about it in the future, once we have studied it more.

Build Web Apps Much Faster – Steve Sanderson (@stevensanderson)

Microsoft has release Windows Azure Mobile Services that is a backend service for simpler web applications, like mobile sites. By using the services you can just plug in authentication against Twitter, Facebook, Google and Microsoft Accounts. There is also a data store that is easy to use. It accepts json messages and automatically created the database structure based on the content. There is also the possibility to set up server side scripts that can be hooked in before an data manipulation to update the incoming request. The service runs on node.js and can use socket connections to make real time updates on the client.

Workshops at Øredev 2012

No Gravatar

We, Adam Lith and Magnus Härlin, from Squeed attended the Øredev conference this year, and we want to share our experience of this event.

Vim Masterclass workshop – Drew Neil (@nelstrom)

Since both of us are beginners of Vim we where unsure if the workshop would be suited for us, but we thought that it’s just a matter of holding your breath and diving straight in. And we are glad we did.

The focus of the workshop was on learning to use advanced features of vim to minimize the number of keystrokes required to perform different objectives. Even though we knew nothing of Vim, the fact that both of us where comfortable with functional programming and macros (from our use of them in Visual Studio), we where able to follow along at least as fast as the other participants, just with slightly different hurdles than them.

It was a very successful workshop and we have now decided to try to learn and master the VsVim extension to Visual Studio.

Git workshop – Tim Berglund (@tlberglund)

In this workshop all the basics of Git were covered as well as a lot of the underlying principles and how it works. Some useful tips on how to configure Git about using the “-u” flag when pushing to permanently add the mapping between the local and remote branch that you push to. Also a couple of handy settings to force git to use “pull –rebase” by setting:

  • git config --global branch.autosetuprebase always
  • git config branch.<branchname>.rebase true

Since Tim is employed by GitHub he also had a walk through of the Fork and Pull Request process that’s available on GitHub. It wasn’t that much to explain since it’s a quite easy process to understand and use but very useful for projects that want to limit the number of contributers while still accepting code.

Hg Init

No Gravatar

För den som är ny på Mercurial eller bara behöver en liten uppfräschning finns en mycket trevlig, pedagogisk och grafiskt tilltalande guide som heter Hg Init och finns på hginit.com.

Bild från http://hginit.com/

Hg är ju som bekant den kemiska formeln för kvicksilvermercury, och dessutom kommandot som används för att köra Mercurial på kommandoprompten. Härligt med lite keminördhumor :)

Verktyg för att visualisera ett Mercurial-repo

No Gravatar

hgview är ett trevligt verktyg för att visualisera historiken i ett Mercurial-repository. Verktyget är grafiskt och presenterar changesets i en riktad acyklisk graf på ett tydligt sätt.

För att få en grafisk och samtidigt enkel översikt över sina ändringar i repot kan man använda qct.Det är enkelt att se och välja vilka filer som ska committas och vilka ändringar som gjorts i varje fil.

Båda finns för Ubuntu och startas enkelt från kommandoprompten i det aktuella repot utan konfiguration!

Git-kurs

Git LogoJag har idag hållt en liten kurs (3 timmar) som introducerat utvecklare till Git och distribuerad versionshantering. Deltagarna jobbar dagligen i Windows och Visual Studio och trots att det inte är min dagliga hemvisst så flöt allt på bra, Git Extensions fungerade fint t ex och ingen av deltagarna fastnade på nyckelhantering eller andra “vanliga” uppstartsproblem.

Följande ämnen hanterades:

  • Grunderna: Vad är versionshantering egentligen? Vad är skillnaden mellan centraliserad och decentraliserad versionshantering? Vad är speciellt för Git?
  • Versionshanteringens bitar: blob, tree, commit, tag, branch. Repo, index, staging area och arbetsmapp
  • Installation, grundkonfigurering
  • Vardagsarbetet: commit, branch, merge, push & pull, clone & init
  • Server och dela kod via SSH, GitHub, Gitorous.

Kursen är i huvudsak praktisk och inriktad på att få den som redan jobbat med centraliserad versionshanteringssystem, såsom CVS, Subversion och Microsofts SourceSafe, att komma igång.

Det finns fler ämnen att hantera – de som ingick i kursen ger basen för det dagliga arbetet och troligen behöver man inte någonsin lära sig mer om man inte är intresserad.