Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Migrating to BitBucket: Lessons Learnt.

C20f7f4a8aa455aa6e0c2a0092883cd0?s=47 Roberto Aloi
November 08, 2016

Migrating to BitBucket: Lessons Learnt.

The talk I gave at "Riada Enterprise Day 2016 - The biggest Atlassian event in Scandinavia", Stockholm.

C20f7f4a8aa455aa6e0c2a0092883cd0?s=128

Roberto Aloi

November 08, 2016
Tweet

Transcript

  1. Roberto Aloi - Klarna AB MIGRATING TO BITBUCKET LESSONS LEARNT

  2. Roberto Aloi

  3. PAYMENT SERVICES FOR ONLINE BUSINESSES THE ART OF SIMPLIFYING THE

    PURCHASING PROCESS HEAVY USER OF ATLASSIAN PRODUCTS https://www.atlassian.com/customers/klarna
  4. Jira BitBucket Confluence …

  5. BitBucket at Klarna 150 PROJECTS 5K REPOS 70K PULL REQUESTS

    30K CLONES PER DAY
  6. Extremely happy about BitBucket. It Just Works.

  7. What is this talk about?

  8. Moving a massive legacy system to BitBucket CHALLENGES SOLUTIONS RANTING

  9. Say Hi to Kred Klarna’s main issuing and servicing platform

    for Nordics, DACH & NL The oldest piece of software at Klarna His name is a reminiscence of the original name Kreditor First Commit: Thu Dec 16 22:56:59 2004
  10. KRED A MONOLITHIC SYSTEM (IN TERMS OF DEPLOYMENT) TESTED AS

    A WHOLE RELEASED AS A WHOLE IMPLEMENTED IN ERLANG INCREDIBLY STABLE AND COMPLEX
  11. In BitBucket Terms?

  12. KRED 1 TOP-LEVEL REPO 250 ERLANG APPLICATIONS 100+ GIT SUBMODULES

    7 TEAMS 50 DEVELOPERS
  13. Migrating Kred to BitBucket BEFORE IT WAS GITOLITE + REVIEWBOARD

    + HOOKS - YEAR 2016 -
  14. ALIGN WITH THE REST OF THE ORGANISATION ADOPT A MORE

    MODERN DEVELOPMENT FLOW INCREASE QUALITY OF THE DEVELOPMENT FLOW THE MIGRATION HAD TO BE SMOOOTH. Why?
  15. The move was trivial. Details were not. Development Flow -

    Integrations - Pull Requests Default Reviewers - Code Ownership Compliance - Jenkins - Submodules - Iterative Reviews Communication - System Tests - Performance Tests Merge Checks - Hooks - Permissions Emergency Changes - Merging Strategies - Rollback Minimum Number of Approvals
  16. IS ABOUT THIS TALK THE DETAILS

  17. Settings

  18. HOW DO YOU CONFIGURE REPO SETTINGS?

  19. Use the UI!

  20. But we deal with 100+ repos…

  21. Use a Plugin! - Repository Templates - Settings Synchronizer

  22. WHICH ARE OK… … BUT …

  23. WE WANTED Trackable SETTINGS

  24. WE WANTED Reviewable SETTINGS

  25. WE WANTED Distributed SETTINGS

  26. We wanted our Settings in Git/Bitbucket.

  27. What If…

  28. project: KC repo: kred # Repository Details default-branch: master #

    Repository Permissions public: false groups: admin: - kred.core.e write: - engineering # Default Reviewers default-reviewers: - master: groups: - kred.core.e
  29. # Branch Restrictions branch-restrictions: - master: - fast-forward-only - no-deletes

    - pull-request-only - read-only: exceptions: groups: - kred.core.e # PR Restrictions pull-requests: requiredApprovers: 2 requiredSuccessfulBuilds: 1
  30. We still have 100+ repos… That’s a lot of duplication!

  31. What If…

  32. project: KC repo: {{ repo }} pull-requests: requiredApprovers: 2 requiredSuccessfulBuilds:

    1 repo: - foo - bar - baz - ...
  33. Guess What?

  34. $ ./bitbucket_erlang_client Usage: ./bitbucket_erlang_client [-h] [-c [<config>]] [-r [<repo_config>]] [-e

    [<enforce>]] [-k [<keep>]] [-v [<verbosity>]] -h, --help Show this help message -c, --config The Bitbucket Config File [default: bitbucket.config] -r, --repo_config The Repo Config to check or configure [default: undefined] -e, --enforce Enforce values when they do not match expectations [default: false] -k, --keep Keep going after the first error (always true when enforce == true) [default: false] -v, --verbosity Verbosity Level [default: 1]
  35. $ ./bitbucket_erlang_client Usage: ./bitbucket_erlang_client [-h] [-c [<config>]] [-r [<repo_config>]] [-e

    [<enforce>]] [-k [<keep>]] [-v [<verbosity>]] -h, --help Show this help message -c, --config The Bitbucket Config File [default: bitbucket.config] -r, --repo_config The Repo Config to check or configure [default: undefined] -e, --enforce Enforce values when they do not match expectations [default: false] -k, --keep Keep going after the first error (always true when enforce == true) [default: false] -v, --verbosity Verbosity Level [default: 1] Enforce VS Verify
  36. Erlang + Docker + The BitBucket API

  37. Is this Open Source? Not yet, but it will be.

    (hopefully soon)
  38. Default Reviewers

  39. – Me “Default reviewers do not work with monoliths.”

  40. Suggested Reviewers

  41. Of course there is a plugin for that! Bitbucket Server

    Reviewer Suggester
  42. But…

  43. We already had the logic to suggest reviewers, but in

    Erlang. Should we migrate it to a plugin?
  44. No! Use the BitBucket API to set the reviewers and

    reuse your logic!
  45. Merge Checks

  46. We already had the logic for the merge checks. Should

    we migrate it to a plugin?
  47. No! Implement a dumb merge check plugin that performs a

    HTTP call to a server and gets a boolean response.
  48. CONCLUSIONS BITBUCKET IS AWESOME MIGRATING TO BITBUCKET WAS SMOOOTH VERSION

    CONTROL YOUR SETTINGS AVOID CONFIGURATION THROUGH A UI AVOID REIMPLEMENTING THINGS THAT WORK
  49. Thanks! https://speakerdeck.com/robertoaloi

  50. @robertoaloi