SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
GitBucket
Open source self-hosting Git server built by Scala
Naoki Takezoe
@takezoen
Who am I?
Naoki Takezoe
● Software Engineer at Treasure Data
○ Presto (Trino) and Spark
● 10 years experience with Scala
○ GitBucket, Scalatra, Apache PredictionIO, etc
○ Japanese edition of Scala Puzzlers
GitBucket is...
GitBucket is...
● Open source self-hosting Git server
● Initial commit was April 2013
● Built by Scala and Java technologies
Current status (Feb 6, 2021)
● 8266 stars
● 158 contributors
● 719 gitter users
● 98 releases
Start GitBucket right now!
● Download gitbucket.war from
○ https://github.com/gitbucket/gitbucket
● Run
● Official Docker image is available
$ java -jar gitbucket.war
$ docker run -d -p 8080:8080 gitbucket/gitbucket
Motivation
Motivation
● In-house Git repository
○ Due to company's security policy?
○ Due to contract with customers?
● Solutions
○ GitHub Enterprise was expensive
○ GitLab installation was awkward
I must make it myself! by
Why ?
From First Principles: Why Scala? by Li Haoyi
https://www.lihaoyi.com/post/FromFirstPrinciplesWhyScala.html
● "A Compiled Language that feels Dynamic"
○ Compiled language + Scripting launguage
○ Easy to write with safety
● "A Broad and Deep Ecosystem"
○ Existing Java resources can be leveraged
○ JGit: Pure Java Git implementation
○ Zero dependencies (except JVM) inspired by Jenkins
Personal reasons:
● Wanted to write a real-world applications in Scala
● Just for fun :-)
Tour of GitBucket
Repository viewer
Issues
Pull requests
Major Features
● Public and private repository hosting
● Dashboard includes activity timeline
● Repository viewer which supports online file editing
● Markdown available Wiki
● Issues and pull requests
● Comment on source code
● Notification via E-mail
● User and group management
● LDAP integration
● Gravator integration
● GitHub compatible Web API
● Plugin system
● External database support (MySQL and PostgreSQL)
Kanban and Gantt chart
Continuous Integration
Major plugins
Name Description
Gist plugin Add code snippet Gist-like functionality to GitBucket
Asciidoc plugin Add AsciiDoc support to GitBucket
Bugspots plugin Apply Google Bugspots to code in GitBucket repositories
Pages plugin Publish repository contents as web sites
Network plugin Add the commit graph view to GitBucket
Emoji plugin Emoji support in Wiki or Issues
RST plugin Add ReStructuredText support to GitBucket
Explorer plugin Add the tree view for repositories on GitBucket
PlantUML plugin Render PlantUML files on GitBucket
Jupyter plugin Render Jupyter or IPython files on GitBucket
Fess Plugin Add full text search capability to GitBucket
Maven repository plugin Host in-house maven repositories on GitBucket
Visit https://gitbucket-plugins.github.io/ to find other plugins!!
Technology
Technology stack
Git Repository
RDBMS
(H2 / MySQL / PostgreSQL)
JGit Slick
Apache MINA SSHD
Jetty
GitServlet (JGit) Scalatra + Twirl
Git Client Web Browser
SSH HTTP
Core technologies are Java components
● Jetty
● H2
● JGit
● Apache MINA SSHD
Technology stack (Java parts)
Git Repository
RDBMS
(H2 / MySQL / PostgreSQL)
JGit Slick
Apache MINA SSHD
Jetty
GitServlet (JGit) Scalatra + Twirl
Git Client Web Browser
SSH HTTP
Key to minimize development cost
Minimizing dev cost is very important for sustainability of
personal OSS projects
● Java interoperability
○ Scala has good Java interoperability
○ Benefit from existing Java software resources
● Plugin architecture
○ Keep core features minimum for maintainability
○ Leverage community resources
Because GitBucket users are not necessarily mature Scala users, we
avoid too much FP flavor in GitBucket in order to open the door to
contribution and plugin development to them.
Challenges in
long-life application with Scala
Upgrading Scala and libraries
Scala's source code level backward compatibility is great, but…
● Need to rebuild libraries for new Scala major version
● Abandoned or not-well maintained libraries can be blockers
● Some libraries changed its public interface significantly
(e.g. Slick2 -> Slick3)
Experienced Scala major upgrade 3 times
● 2.10 -> 2.11
● 2.11 -> 2.12
● 2.12 -> 2.13
The most painful upgrade!
Why upgrading to Scala 2.12 was so painful?
Git Repository
RDBMS
(H2 / MySQL / PostgreSQL)
JGit Slick
Apache MINA SSHD
Jetty
GitServlet (JGit) Scalatra + Twirl
Git Client Web Browser
SSH HTTP
Scalatra development was going down
Destructive change in Slick3
Scalatra
● Simple we framework for Scala inspired by Ruby's Sinatra
○ Traditional Java servlet based framework
○ Declarative input validation and mapping framework like Play2
○ json4s based JSON support
Scalatra development is going down
● Rise of reactive and functional programming in Scala
○ Emerge of new frameworks such as finagle, http4s and akka-http
○ Main Scalatra developers shifted to http4s
● Became a Scalatra committer
○ Boosted migration to Scala 2.12, and eventually Scala 2.13
● Reduced maintenance cost to make it sustainable
○ Dropped minor features and library dependencies
○ Forked abandoned libraries, took some into Scalatra source tree if
small enough
Slick
● Advanced Type-safe SQL builder (former Scala-Query)
○ Very powerful and flexible type-safe API
○ Sometimes generated SQL can cause performance issues,
especially on MySQL, though...
● Super painful upgrade in Slick2 -> Slick3
○ Monadic DBIO introduced in Slick3 affected all existing code
Slick2 -> Slick3 migration
● Amount of code that needs to be migrated
○ Affected all existing Slick2 based code including community
developed plugins
● Difficulty of DBIO for GitBucket users
○ GitBucket users are not mature Scala programmers
○ We wanted to keep the bar low
● Scala 2.12 version of Slick2 was not available back then
○ Eventually Scala 2.12 version of Slick2 was released, though
○ Scala 2.13 version has not been released
How we migrated to Slick3?
● Created blocking-slick library
○ Slick2 compatible blocking API on the top of Slick3
https://github.com/takezoe/blocking-slick
● We could migrate to Slick3 with minimum effort
https://github.com/gitbucket/gitbucket/pull/1381/files
○ Also, minimized the negative impact on plugin developers
Created Java libraries, not Scala libraries
● Markedj (GitHub flavored markdown parser, Java-port of marked.js)
● Solidbase (Multi-tenant and multi-database supported migration tool
based on Liquibase)
● If the library interface is simple enough, no benefit to write in Scala
for library users.
● We don't need to rebuild a library for each major Scala version.
Effective strategy for long-term maintenance
● Minimize library dependencies
● Use Java libraries if possible
● Fork or take over library maintenance if needed
These strategies would be effective even for migration to Scala3!
Try GitBucket!
● GitHub: https://github.com/gitbucket/gitbucket
● Demo site: https://gitbucket.herokuapp.com/
● Gitter: https://gitter.im/gitbucket/gitbucket
● Blog: https://gitbucket.github.io/gitbucket-news/
● Community Plugins: https://gitbucket-plugins.github.io/
Appendix:
How to create GitBucket plugin
Create project
● build.sbt
● project/plugins.sbt
This sbt plugin adds necessary library dependencies to the project
and provide configuration and sbt task useful for GitBucket plugin
development.
Define plugin manifest
● Plugin.scala (plugin manifest)
Register new controller via
extension point
Implement plugin
● HelloWorldController.scala (Typical Scalatra controller)
Bunch of extension points are available, such as:
● Add menus and tabs
● Inject JavaScript
● Register event hooks
● etc
Build and Test
● Create a package
● Install to local GitBucket
● Template project
○ https://github.com/gitbucket/gitbucket-plugin-template
● Tutorial
○ https://gitbucket.github.io/gitbucket-news/gitbucket/2015/06/29/ho
w-to-create-plugin.html
$ sbt assembly
$ sbt install

Weitere ähnliche Inhalte

Was ist angesagt?

[db analytics showcase Sapporo 2018] B13 Cloud Spanner の裏側〜解析からベストプラクティスへ〜
[db analytics showcase Sapporo 2018] B13 Cloud Spanner の裏側〜解析からベストプラクティスへ〜[db analytics showcase Sapporo 2018] B13 Cloud Spanner の裏側〜解析からベストプラクティスへ〜
[db analytics showcase Sapporo 2018] B13 Cloud Spanner の裏側〜解析からベストプラクティスへ〜Insight Technology, Inc.
 
高速にコンテナを起動できるイメージフォーマット
高速にコンテナを起動できるイメージフォーマット高速にコンテナを起動できるイメージフォーマット
高速にコンテナを起動できるイメージフォーマットAkihiro Suda
 
CI/CDって何が良いの?〜言うてるオレもわからんわ〜 #DevKan
CI/CDって何が良いの?〜言うてるオレもわからんわ〜 #DevKanCI/CDって何が良いの?〜言うてるオレもわからんわ〜 #DevKan
CI/CDって何が良いの?〜言うてるオレもわからんわ〜 #DevKanKazuhito Miura
 
PCCC22:インテル株式会社 テーマ1「インテル® Agilex™ FPGA デバイス 最新情報」
PCCC22:インテル株式会社 テーマ1「インテル® Agilex™ FPGA デバイス 最新情報」PCCC22:インテル株式会社 テーマ1「インテル® Agilex™ FPGA デバイス 最新情報」
PCCC22:インテル株式会社 テーマ1「インテル® Agilex™ FPGA デバイス 最新情報」PC Cluster Consortium
 
YugabyteDBを使ってみよう(NewSQL/分散SQLデータベースよろず勉強会 #1 発表資料)
YugabyteDBを使ってみよう(NewSQL/分散SQLデータベースよろず勉強会 #1 発表資料)YugabyteDBを使ってみよう(NewSQL/分散SQLデータベースよろず勉強会 #1 発表資料)
YugabyteDBを使ってみよう(NewSQL/分散SQLデータベースよろず勉強会 #1 発表資料)NTT DATA Technology & Innovation
 
Rdraモデリングをしよう
RdraモデリングをしようRdraモデリングをしよう
RdraモデリングをしようZenji Kanzaki
 
YugabyteDBの実行計画を眺める(NewSQL/分散SQLデータベースよろず勉強会 #3 発表資料)
YugabyteDBの実行計画を眺める(NewSQL/分散SQLデータベースよろず勉強会 #3 発表資料)YugabyteDBの実行計画を眺める(NewSQL/分散SQLデータベースよろず勉強会 #3 発表資料)
YugabyteDBの実行計画を眺める(NewSQL/分散SQLデータベースよろず勉強会 #3 発表資料)NTT DATA Technology & Innovation
 
Apache Airflow入門 (マーケティングデータ分析基盤技術勉強会)
Apache Airflow入門  (マーケティングデータ分析基盤技術勉強会)Apache Airflow入門  (マーケティングデータ分析基盤技術勉強会)
Apache Airflow入門 (マーケティングデータ分析基盤技術勉強会)Takeshi Mikami
 
Mule Runtime のアーキテクチャコンセプト紹介
Mule Runtime のアーキテクチャコンセプト紹介Mule Runtime のアーキテクチャコンセプト紹介
Mule Runtime のアーキテクチャコンセプト紹介MuleSoft Meetup Tokyo
 
ビジネスリテラシーとしての統計 ビッグデータと統計の活用
ビジネスリテラシーとしての統計 ビッグデータと統計の活用ビジネスリテラシーとしての統計 ビッグデータと統計の活用
ビジネスリテラシーとしての統計 ビッグデータと統計の活用Rakuten Group, Inc.
 
3分でわかるAzureでのService Principal
3分でわかるAzureでのService Principal3分でわかるAzureでのService Principal
3分でわかるAzureでのService PrincipalToru Makabe
 
『データベースのどこが問題?』を時間かけずにレスポンス・タイム分析(RTA)!
『データベースのどこが問題?』を時間かけずにレスポンス・タイム分析(RTA)!『データベースのどこが問題?』を時間かけずにレスポンス・タイム分析(RTA)!
『データベースのどこが問題?』を時間かけずにレスポンス・タイム分析(RTA)!株式会社クライム
 
Infrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload DeploymentInfrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload DeploymentDatabricks
 
スケールアップファーストのNoSQL、ScyllaDB(スキュラDB)
スケールアップファーストのNoSQL、ScyllaDB(スキュラDB)スケールアップファーストのNoSQL、ScyllaDB(スキュラDB)
スケールアップファーストのNoSQL、ScyllaDB(スキュラDB)昌桓 李
 
Mixed RealityとAzure Digital Twinsを組合わせてデジタルツインを可視化するためのTips
Mixed RealityとAzure Digital Twinsを組合わせてデジタルツインを可視化するためのTipsMixed RealityとAzure Digital Twinsを組合わせてデジタルツインを可視化するためのTips
Mixed RealityとAzure Digital Twinsを組合わせてデジタルツインを可視化するためのTipsTakahiro Miyaura
 
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)NTT DATA Technology & Innovation
 
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用日本マイクロソフト株式会社
 
Selenium×PostgreSQL15×Grafanaで思い出を保存&分析するプロジェクト(第35回PostgreSQLアンカンファレンス@オンライン...
Selenium×PostgreSQL15×Grafanaで思い出を保存&分析するプロジェクト(第35回PostgreSQLアンカンファレンス@オンライン...Selenium×PostgreSQL15×Grafanaで思い出を保存&分析するプロジェクト(第35回PostgreSQLアンカンファレンス@オンライン...
Selenium×PostgreSQL15×Grafanaで思い出を保存&分析するプロジェクト(第35回PostgreSQLアンカンファレンス@オンライン...NTT DATA Technology & Innovation
 

Was ist angesagt? (20)

[db analytics showcase Sapporo 2018] B13 Cloud Spanner の裏側〜解析からベストプラクティスへ〜
[db analytics showcase Sapporo 2018] B13 Cloud Spanner の裏側〜解析からベストプラクティスへ〜[db analytics showcase Sapporo 2018] B13 Cloud Spanner の裏側〜解析からベストプラクティスへ〜
[db analytics showcase Sapporo 2018] B13 Cloud Spanner の裏側〜解析からベストプラクティスへ〜
 
高速にコンテナを起動できるイメージフォーマット
高速にコンテナを起動できるイメージフォーマット高速にコンテナを起動できるイメージフォーマット
高速にコンテナを起動できるイメージフォーマット
 
CI/CDって何が良いの?〜言うてるオレもわからんわ〜 #DevKan
CI/CDって何が良いの?〜言うてるオレもわからんわ〜 #DevKanCI/CDって何が良いの?〜言うてるオレもわからんわ〜 #DevKan
CI/CDって何が良いの?〜言うてるオレもわからんわ〜 #DevKan
 
Oracle Database (CDB) on Docker を動かしてみる
Oracle Database (CDB) on Docker を動かしてみるOracle Database (CDB) on Docker を動かしてみる
Oracle Database (CDB) on Docker を動かしてみる
 
PCCC22:インテル株式会社 テーマ1「インテル® Agilex™ FPGA デバイス 最新情報」
PCCC22:インテル株式会社 テーマ1「インテル® Agilex™ FPGA デバイス 最新情報」PCCC22:インテル株式会社 テーマ1「インテル® Agilex™ FPGA デバイス 最新情報」
PCCC22:インテル株式会社 テーマ1「インテル® Agilex™ FPGA デバイス 最新情報」
 
YugabyteDBを使ってみよう(NewSQL/分散SQLデータベースよろず勉強会 #1 発表資料)
YugabyteDBを使ってみよう(NewSQL/分散SQLデータベースよろず勉強会 #1 発表資料)YugabyteDBを使ってみよう(NewSQL/分散SQLデータベースよろず勉強会 #1 発表資料)
YugabyteDBを使ってみよう(NewSQL/分散SQLデータベースよろず勉強会 #1 発表資料)
 
Rdraモデリングをしよう
RdraモデリングをしようRdraモデリングをしよう
Rdraモデリングをしよう
 
YugabyteDBの実行計画を眺める(NewSQL/分散SQLデータベースよろず勉強会 #3 発表資料)
YugabyteDBの実行計画を眺める(NewSQL/分散SQLデータベースよろず勉強会 #3 発表資料)YugabyteDBの実行計画を眺める(NewSQL/分散SQLデータベースよろず勉強会 #3 発表資料)
YugabyteDBの実行計画を眺める(NewSQL/分散SQLデータベースよろず勉強会 #3 発表資料)
 
Apache Airflow入門 (マーケティングデータ分析基盤技術勉強会)
Apache Airflow入門  (マーケティングデータ分析基盤技術勉強会)Apache Airflow入門  (マーケティングデータ分析基盤技術勉強会)
Apache Airflow入門 (マーケティングデータ分析基盤技術勉強会)
 
Mule Runtime のアーキテクチャコンセプト紹介
Mule Runtime のアーキテクチャコンセプト紹介Mule Runtime のアーキテクチャコンセプト紹介
Mule Runtime のアーキテクチャコンセプト紹介
 
ビジネスリテラシーとしての統計 ビッグデータと統計の活用
ビジネスリテラシーとしての統計 ビッグデータと統計の活用ビジネスリテラシーとしての統計 ビッグデータと統計の活用
ビジネスリテラシーとしての統計 ビッグデータと統計の活用
 
3分でわかるAzureでのService Principal
3分でわかるAzureでのService Principal3分でわかるAzureでのService Principal
3分でわかるAzureでのService Principal
 
入門!Jenkins
入門!Jenkins入門!Jenkins
入門!Jenkins
 
『データベースのどこが問題?』を時間かけずにレスポンス・タイム分析(RTA)!
『データベースのどこが問題?』を時間かけずにレスポンス・タイム分析(RTA)!『データベースのどこが問題?』を時間かけずにレスポンス・タイム分析(RTA)!
『データベースのどこが問題?』を時間かけずにレスポンス・タイム分析(RTA)!
 
Infrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload DeploymentInfrastructure Agnostic Machine Learning Workload Deployment
Infrastructure Agnostic Machine Learning Workload Deployment
 
スケールアップファーストのNoSQL、ScyllaDB(スキュラDB)
スケールアップファーストのNoSQL、ScyllaDB(スキュラDB)スケールアップファーストのNoSQL、ScyllaDB(スキュラDB)
スケールアップファーストのNoSQL、ScyllaDB(スキュラDB)
 
Mixed RealityとAzure Digital Twinsを組合わせてデジタルツインを可視化するためのTips
Mixed RealityとAzure Digital Twinsを組合わせてデジタルツインを可視化するためのTipsMixed RealityとAzure Digital Twinsを組合わせてデジタルツインを可視化するためのTips
Mixed RealityとAzure Digital Twinsを組合わせてデジタルツインを可視化するためのTips
 
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)
 
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用
【de:code 2020】 アマダの Azure への取り組みと DevOPS・MLOPS 環境の構築と運用
 
Selenium×PostgreSQL15×Grafanaで思い出を保存&分析するプロジェクト(第35回PostgreSQLアンカンファレンス@オンライン...
Selenium×PostgreSQL15×Grafanaで思い出を保存&分析するプロジェクト(第35回PostgreSQLアンカンファレンス@オンライン...Selenium×PostgreSQL15×Grafanaで思い出を保存&分析するプロジェクト(第35回PostgreSQLアンカンファレンス@オンライン...
Selenium×PostgreSQL15×Grafanaで思い出を保存&分析するプロジェクト(第35回PostgreSQLアンカンファレンス@オンライン...
 

Ähnlich wie GitBucket: Open source self-hosting Git server built by Scala

GitBucket: Git Centric Software Development Platform by Scala
GitBucket:  Git Centric Software Development Platform by ScalaGitBucket:  Git Centric Software Development Platform by Scala
GitBucket: Git Centric Software Development Platform by Scalatakezoe
 
How to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applicationsHow to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applicationstakezoe
 
Upcoming features in Airflow 2
Upcoming features in Airflow 2Upcoming features in Airflow 2
Upcoming features in Airflow 2Kaxil Naik
 
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...Igalia
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
 
How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineElasTest Project
 
Workflows using Git GitHub | Edureka
Workflows using Git GitHub | EdurekaWorkflows using Git GitHub | Edureka
Workflows using Git GitHub | EdurekaEdureka!
 
GraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdfGraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdfohupalo
 
News from Git in Java Land
News from Git in Java LandNews from Git in Java Land
News from Git in Java Landmsohn
 
August OpenNTF Webinar - Git and GitHub Explained
August OpenNTF Webinar - Git and GitHub ExplainedAugust OpenNTF Webinar - Git and GitHub Explained
August OpenNTF Webinar - Git and GitHub ExplainedHoward Greenberg
 
Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO Chandan Kumar
 
Elephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsElephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsPostgreSQL Experts, Inc.
 
Elephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksElephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksCommand Prompt., Inc
 
The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0
The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0
The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0Miles Sabin
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!Cory Webb
 
How to manage Kubernetes at scale with just git
How to manage Kubernetes at scale with just git How to manage Kubernetes at scale with just git
How to manage Kubernetes at scale with just git Weaveworks
 
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...Nico Meisenzahl
 

Ähnlich wie GitBucket: Open source self-hosting Git server built by Scala (20)

GitBucket: Git Centric Software Development Platform by Scala
GitBucket:  Git Centric Software Development Platform by ScalaGitBucket:  Git Centric Software Development Platform by Scala
GitBucket: Git Centric Software Development Platform by Scala
 
How to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applicationsHow to keep maintainability of long life Scala applications
How to keep maintainability of long life Scala applications
 
Upcoming features in Airflow 2
Upcoming features in Airflow 2Upcoming features in Airflow 2
Upcoming features in Airflow 2
 
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
Multimedia support in WebKitGTK and WPE, current status and plans (GStreamer ...
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration Webinar : SVN to GIT Migration
Webinar : SVN to GIT Migration
 
How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipeline
 
Workflows using Git GitHub | Edureka
Workflows using Git GitHub | EdurekaWorkflows using Git GitHub | Edureka
Workflows using Git GitHub | Edureka
 
GraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdfGraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdf
 
News from Git in Java Land
News from Git in Java LandNews from Git in Java Land
News from Git in Java Land
 
August OpenNTF Webinar - Git and GitHub Explained
August OpenNTF Webinar - Git and GitHub ExplainedAugust OpenNTF Webinar - Git and GitHub Explained
August OpenNTF Webinar - Git and GitHub Explained
 
Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO
 
Elephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and VariantsElephant Roads: PostgreSQL Patches and Variants
Elephant Roads: PostgreSQL Patches and Variants
 
Elephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksElephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forks
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
 
Introduction to git & github
Introduction to git & githubIntroduction to git & github
Introduction to git & github
 
The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0
The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0
The Scala IDE for Eclipse - Retrospect and Prospect for 2.8.0
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
 
How to manage Kubernetes at scale with just git
How to manage Kubernetes at scale with just git How to manage Kubernetes at scale with just git
How to manage Kubernetes at scale with just git
 
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...
Gitlab Commit: How Containerized GitLab CI Pipelines Can Help You Streamline ...
 

Mehr von takezoe

Journey of Migrating Millions of Queries on The Cloud
Journey of Migrating Millions of Queries on The CloudJourney of Migrating Millions of Queries on The Cloud
Journey of Migrating Millions of Queries on The Cloudtakezoe
 
Testing Distributed Query Engine as a Service
Testing Distributed Query Engine as a ServiceTesting Distributed Query Engine as a Service
Testing Distributed Query Engine as a Servicetakezoe
 
Revisit Dependency Injection in scala
Revisit Dependency Injection in scalaRevisit Dependency Injection in scala
Revisit Dependency Injection in scalatakezoe
 
頑張りすぎないScala
頑張りすぎないScala頑張りすぎないScala
頑張りすぎないScalatakezoe
 
Non-Functional Programming in Scala
Non-Functional Programming in ScalaNon-Functional Programming in Scala
Non-Functional Programming in Scalatakezoe
 
Scala警察のすすめ
Scala警察のすすめScala警察のすすめ
Scala警察のすすめtakezoe
 
Scala製機械学習サーバ「Apache PredictionIO」
Scala製機械学習サーバ「Apache PredictionIO」Scala製機械学習サーバ「Apache PredictionIO」
Scala製機械学習サーバ「Apache PredictionIO」takezoe
 
The best of AltJava is Xtend
The best of AltJava is XtendThe best of AltJava is Xtend
The best of AltJava is Xtendtakezoe
 
Scala Warrior and type-safe front-end development with Scala.js
Scala Warrior and type-safe front-end development with Scala.jsScala Warrior and type-safe front-end development with Scala.js
Scala Warrior and type-safe front-end development with Scala.jstakezoe
 
Tracing Microservices with Zipkin
Tracing Microservices with ZipkinTracing Microservices with Zipkin
Tracing Microservices with Zipkintakezoe
 
Type-safe front-end development with Scala
Type-safe front-end development with ScalaType-safe front-end development with Scala
Type-safe front-end development with Scalatakezoe
 
Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016takezoe
 
Macro in Scala
Macro in ScalaMacro in Scala
Macro in Scalatakezoe
 
Java9 and Project Jigsaw
Java9 and Project JigsawJava9 and Project Jigsaw
Java9 and Project Jigsawtakezoe
 
Reactive database access with Slick3
Reactive database access with Slick3Reactive database access with Slick3
Reactive database access with Slick3takezoe
 
markedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVMmarkedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVMtakezoe
 
ネタじゃないScala.js
ネタじゃないScala.jsネタじゃないScala.js
ネタじゃないScala.jstakezoe
 
Excel方眼紙を支えるJava技術 2015
Excel方眼紙を支えるJava技術 2015Excel方眼紙を支えるJava技術 2015
Excel方眼紙を支えるJava技術 2015takezoe
 
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscalaビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscalatakezoe
 
GitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by ScalaGitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by Scalatakezoe
 

Mehr von takezoe (20)

Journey of Migrating Millions of Queries on The Cloud
Journey of Migrating Millions of Queries on The CloudJourney of Migrating Millions of Queries on The Cloud
Journey of Migrating Millions of Queries on The Cloud
 
Testing Distributed Query Engine as a Service
Testing Distributed Query Engine as a ServiceTesting Distributed Query Engine as a Service
Testing Distributed Query Engine as a Service
 
Revisit Dependency Injection in scala
Revisit Dependency Injection in scalaRevisit Dependency Injection in scala
Revisit Dependency Injection in scala
 
頑張りすぎないScala
頑張りすぎないScala頑張りすぎないScala
頑張りすぎないScala
 
Non-Functional Programming in Scala
Non-Functional Programming in ScalaNon-Functional Programming in Scala
Non-Functional Programming in Scala
 
Scala警察のすすめ
Scala警察のすすめScala警察のすすめ
Scala警察のすすめ
 
Scala製機械学習サーバ「Apache PredictionIO」
Scala製機械学習サーバ「Apache PredictionIO」Scala製機械学習サーバ「Apache PredictionIO」
Scala製機械学習サーバ「Apache PredictionIO」
 
The best of AltJava is Xtend
The best of AltJava is XtendThe best of AltJava is Xtend
The best of AltJava is Xtend
 
Scala Warrior and type-safe front-end development with Scala.js
Scala Warrior and type-safe front-end development with Scala.jsScala Warrior and type-safe front-end development with Scala.js
Scala Warrior and type-safe front-end development with Scala.js
 
Tracing Microservices with Zipkin
Tracing Microservices with ZipkinTracing Microservices with Zipkin
Tracing Microservices with Zipkin
 
Type-safe front-end development with Scala
Type-safe front-end development with ScalaType-safe front-end development with Scala
Type-safe front-end development with Scala
 
Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016
 
Macro in Scala
Macro in ScalaMacro in Scala
Macro in Scala
 
Java9 and Project Jigsaw
Java9 and Project JigsawJava9 and Project Jigsaw
Java9 and Project Jigsaw
 
Reactive database access with Slick3
Reactive database access with Slick3Reactive database access with Slick3
Reactive database access with Slick3
 
markedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVMmarkedj: The best of markdown processor on JVM
markedj: The best of markdown processor on JVM
 
ネタじゃないScala.js
ネタじゃないScala.jsネタじゃないScala.js
ネタじゃないScala.js
 
Excel方眼紙を支えるJava技術 2015
Excel方眼紙を支えるJava技術 2015Excel方眼紙を支えるJava技術 2015
Excel方眼紙を支えるJava技術 2015
 
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscalaビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
 
GitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by ScalaGitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by Scala
 

Kürzlich hochgeladen

What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptrcbcrtm
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 

Kürzlich hochgeladen (20)

What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.pptcpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 

GitBucket: Open source self-hosting Git server built by Scala

  • 1. GitBucket Open source self-hosting Git server built by Scala Naoki Takezoe @takezoen
  • 2. Who am I? Naoki Takezoe ● Software Engineer at Treasure Data ○ Presto (Trino) and Spark ● 10 years experience with Scala ○ GitBucket, Scalatra, Apache PredictionIO, etc ○ Japanese edition of Scala Puzzlers
  • 4. GitBucket is... ● Open source self-hosting Git server ● Initial commit was April 2013 ● Built by Scala and Java technologies
  • 5. Current status (Feb 6, 2021) ● 8266 stars ● 158 contributors ● 719 gitter users ● 98 releases
  • 6. Start GitBucket right now! ● Download gitbucket.war from ○ https://github.com/gitbucket/gitbucket ● Run ● Official Docker image is available $ java -jar gitbucket.war $ docker run -d -p 8080:8080 gitbucket/gitbucket
  • 8. Motivation ● In-house Git repository ○ Due to company's security policy? ○ Due to contract with customers? ● Solutions ○ GitHub Enterprise was expensive ○ GitLab installation was awkward I must make it myself! by
  • 9. Why ? From First Principles: Why Scala? by Li Haoyi https://www.lihaoyi.com/post/FromFirstPrinciplesWhyScala.html ● "A Compiled Language that feels Dynamic" ○ Compiled language + Scripting launguage ○ Easy to write with safety ● "A Broad and Deep Ecosystem" ○ Existing Java resources can be leveraged ○ JGit: Pure Java Git implementation ○ Zero dependencies (except JVM) inspired by Jenkins Personal reasons: ● Wanted to write a real-world applications in Scala ● Just for fun :-)
  • 14. Major Features ● Public and private repository hosting ● Dashboard includes activity timeline ● Repository viewer which supports online file editing ● Markdown available Wiki ● Issues and pull requests ● Comment on source code ● Notification via E-mail ● User and group management ● LDAP integration ● Gravator integration ● GitHub compatible Web API ● Plugin system ● External database support (MySQL and PostgreSQL)
  • 17. Major plugins Name Description Gist plugin Add code snippet Gist-like functionality to GitBucket Asciidoc plugin Add AsciiDoc support to GitBucket Bugspots plugin Apply Google Bugspots to code in GitBucket repositories Pages plugin Publish repository contents as web sites Network plugin Add the commit graph view to GitBucket Emoji plugin Emoji support in Wiki or Issues RST plugin Add ReStructuredText support to GitBucket Explorer plugin Add the tree view for repositories on GitBucket PlantUML plugin Render PlantUML files on GitBucket Jupyter plugin Render Jupyter or IPython files on GitBucket Fess Plugin Add full text search capability to GitBucket Maven repository plugin Host in-house maven repositories on GitBucket Visit https://gitbucket-plugins.github.io/ to find other plugins!!
  • 19. Technology stack Git Repository RDBMS (H2 / MySQL / PostgreSQL) JGit Slick Apache MINA SSHD Jetty GitServlet (JGit) Scalatra + Twirl Git Client Web Browser SSH HTTP
  • 20. Core technologies are Java components ● Jetty ● H2 ● JGit ● Apache MINA SSHD
  • 21. Technology stack (Java parts) Git Repository RDBMS (H2 / MySQL / PostgreSQL) JGit Slick Apache MINA SSHD Jetty GitServlet (JGit) Scalatra + Twirl Git Client Web Browser SSH HTTP
  • 22. Key to minimize development cost Minimizing dev cost is very important for sustainability of personal OSS projects ● Java interoperability ○ Scala has good Java interoperability ○ Benefit from existing Java software resources ● Plugin architecture ○ Keep core features minimum for maintainability ○ Leverage community resources Because GitBucket users are not necessarily mature Scala users, we avoid too much FP flavor in GitBucket in order to open the door to contribution and plugin development to them.
  • 24. Upgrading Scala and libraries Scala's source code level backward compatibility is great, but… ● Need to rebuild libraries for new Scala major version ● Abandoned or not-well maintained libraries can be blockers ● Some libraries changed its public interface significantly (e.g. Slick2 -> Slick3)
  • 25. Experienced Scala major upgrade 3 times ● 2.10 -> 2.11 ● 2.11 -> 2.12 ● 2.12 -> 2.13 The most painful upgrade!
  • 26. Why upgrading to Scala 2.12 was so painful? Git Repository RDBMS (H2 / MySQL / PostgreSQL) JGit Slick Apache MINA SSHD Jetty GitServlet (JGit) Scalatra + Twirl Git Client Web Browser SSH HTTP Scalatra development was going down Destructive change in Slick3
  • 27. Scalatra ● Simple we framework for Scala inspired by Ruby's Sinatra ○ Traditional Java servlet based framework ○ Declarative input validation and mapping framework like Play2 ○ json4s based JSON support
  • 28. Scalatra development is going down ● Rise of reactive and functional programming in Scala ○ Emerge of new frameworks such as finagle, http4s and akka-http ○ Main Scalatra developers shifted to http4s ● Became a Scalatra committer ○ Boosted migration to Scala 2.12, and eventually Scala 2.13 ● Reduced maintenance cost to make it sustainable ○ Dropped minor features and library dependencies ○ Forked abandoned libraries, took some into Scalatra source tree if small enough
  • 29. Slick ● Advanced Type-safe SQL builder (former Scala-Query) ○ Very powerful and flexible type-safe API ○ Sometimes generated SQL can cause performance issues, especially on MySQL, though... ● Super painful upgrade in Slick2 -> Slick3 ○ Monadic DBIO introduced in Slick3 affected all existing code
  • 30. Slick2 -> Slick3 migration ● Amount of code that needs to be migrated ○ Affected all existing Slick2 based code including community developed plugins ● Difficulty of DBIO for GitBucket users ○ GitBucket users are not mature Scala programmers ○ We wanted to keep the bar low ● Scala 2.12 version of Slick2 was not available back then ○ Eventually Scala 2.12 version of Slick2 was released, though ○ Scala 2.13 version has not been released
  • 31. How we migrated to Slick3? ● Created blocking-slick library ○ Slick2 compatible blocking API on the top of Slick3 https://github.com/takezoe/blocking-slick ● We could migrate to Slick3 with minimum effort https://github.com/gitbucket/gitbucket/pull/1381/files ○ Also, minimized the negative impact on plugin developers
  • 32. Created Java libraries, not Scala libraries ● Markedj (GitHub flavored markdown parser, Java-port of marked.js) ● Solidbase (Multi-tenant and multi-database supported migration tool based on Liquibase) ● If the library interface is simple enough, no benefit to write in Scala for library users. ● We don't need to rebuild a library for each major Scala version.
  • 33. Effective strategy for long-term maintenance ● Minimize library dependencies ● Use Java libraries if possible ● Fork or take over library maintenance if needed These strategies would be effective even for migration to Scala3!
  • 34. Try GitBucket! ● GitHub: https://github.com/gitbucket/gitbucket ● Demo site: https://gitbucket.herokuapp.com/ ● Gitter: https://gitter.im/gitbucket/gitbucket ● Blog: https://gitbucket.github.io/gitbucket-news/ ● Community Plugins: https://gitbucket-plugins.github.io/
  • 35. Appendix: How to create GitBucket plugin
  • 36. Create project ● build.sbt ● project/plugins.sbt This sbt plugin adds necessary library dependencies to the project and provide configuration and sbt task useful for GitBucket plugin development.
  • 37. Define plugin manifest ● Plugin.scala (plugin manifest) Register new controller via extension point
  • 38. Implement plugin ● HelloWorldController.scala (Typical Scalatra controller) Bunch of extension points are available, such as: ● Add menus and tabs ● Inject JavaScript ● Register event hooks ● etc
  • 39. Build and Test ● Create a package ● Install to local GitBucket ● Template project ○ https://github.com/gitbucket/gitbucket-plugin-template ● Tutorial ○ https://gitbucket.github.io/gitbucket-news/gitbucket/2015/06/29/ho w-to-create-plugin.html $ sbt assembly $ sbt install