如何成为一名优质的 Contributor

关于本文

本文主要是为了,记录给 Druid-io / Apache Eagle / Apache Flink / Apache HBase / Apache Kafka / Apache Superset / Apache Zookeeper / TensorFlow 开源社区贡献代码,尽自己一点绵薄之力的过程

文章最后一节,是一些经验之谈,期冀能帮助到 同样热爱开源、也想成为 Contributor 的小伙伴们

开源贡献纪实

Druid-io / Druid

Pull Request

TitleStatusCreate DateMerge Date
Some code refactor for better performance of Avro-Extension #4092Merged2017-03-222017-04-25
Explain Avro´s unnecessary EOFException (#4098) #4100Merged2017-03-232017-03-24
Improve collection related things that reusing a immutable object instead of creating a new object #4135Merged2017-03-302017-05-17
Increment the resource of JVM and the number of threads in Travis instead of default #4139Open2017-03-31
Update outdated RLE paper and improve some code refactoring #4286Merged2017-05-172017-05-19

Issues

All issues in Druid
Open / Close / Total : 1 / 3 / 4


Apache / Eagle

Pull Request

TitleStatusCreate DateMerge Date
[EAGLE-981] GC overhead limit exceeded #896Merged2017-03-302017-04-18
[EAGLE-982] The log length has exceeded the limit of 4 MB in Travis #897Merged2017-03-302017-04-18
[EAGLE-992] HBase Naming that unify Hbase and HBase into HBase#905Merged2017-04-062017-04-18
[EAGLE-1009] Fix return inside finally block may result in losing exception #920Merged2017-04-182017-04-19
[MINOR] Fix some project construction problems about test sources #922Open2017-04-19
[EAGLE-1012] Some language level problems #925Open2017-04-19
[MINOR] Fxi sprk/egle issues in JPM module #943Open2017-06-07

Issues

All issues in Eagle
Open / Close / Total : 5 / 4 / 9


Pull Request

TitleStatusCreate DateMerge Date
FLINK-6868[build] Using scala.binary.version for flink-streaming-scala in Cassandra Connector #4087Merged2017-06-082017-06-25
FLINK-7369: Add more information for Key group index out of range of key group range exception #4474Merged2017-08-042017-08-04

Issues

All issues in Flink
Open / Close / Total : 1 / 1 / 2

Tips: How to Contribute to Flink


Apache / Flume

Pull Request

TitleStatusCreate DateMerge Date
Using volatile + ConcurrentHashMap + LongAdder instead of syncrhonzied + HashMap + AtomicLong for CounterGroup #194Open2018-01-17

Tips: How to Contribute to Flume


Apache / HBase

Pull Request

TitleStatusCreate DateMerge Date
HBASE-18470: Fix a bug in RetriesExhaustedWithDetailsException#getDesc describe#56Merged2017-07-282017-08-03

Apache / Kafka

Pull Request

TitleStatusCreate DateMerge Date
[MINOR] Improve runtime / storage / metrics / config parts #4525Merged2018-02-052018-02-14
MINOR: Catch null pointer exception for empty leader URL when assignment is null #4798Open2018-03-30
MINOR: Remove magic number and extract Pattern instance from method as class field #4799Merged2018-03-302018-04-09

Landoop / Kafka-Connect-UI

Pull Request

TitleStatusCreate DateMerge Date
Fix #69 Cannot parse automatically the right configurations in PROPERTIES mode when we create a new connector #70Merged2018-03-132018-03-16
Add new feature: restart task #72Merged2018-03-162018-03-21

Issues

All issues in Kafka-Connect-UI


Apache / Phoenix

Pull Request

TitleStatusCreate DateMerge Date
PHOENIX-3961 Should delete tableOutputPath in completebulkload #264Open2017-06-20

Apache / Superset

Pull Request

TitleStatusCreate DateMerge Date
little code refactor in models.py #2124Merged2017-02-072017-02-07
Fix werkzeug instance was created twice in Debug Mode (#2135) #2136Merged2017-02-082017-02-14
Fix ExtDeprecationWarning (#2137) #2138Merged2017-02-082017-02-09
Some code refactoring #2139Merged2017-02-082017-02-09
Using the time zone with specific name for querying Druid #2143Merged2017-02-092017-02-10
Aggregate data outside of topN into a single category #2176Open2017-02-15
Fix UNKNOWN option in setup.py #2199Open2017-02-17
fix timezone issues in slices (#2354) #2370Open2017-03-08
Fix unicode issues (#2308 #2282) #2401Merged2017-03-142017-03-15
Fix rst grammar problems #4116Merged2017-12-262017-12-26
Fix invaild gitter url #4125Merged2017-12-272018-01-05
Hanization #4126Merged2017-12-272018-01-13

Issues

All issues in Superset
Open / Close / Total : 13 / 7 / 20


Apache / Zookeeper

Pull Request

TitleStatusCreate DateMerge Date
ZOOKEEPER-2784: Add same sid config problem check #257Open2017-05-18
ZOOKEEPER-2789: Reassign ZXID for solving 32bit overflow problem #262Open2017-05-23
ZOOKEEPER-2815: 1. Using try clause to close resource; 2. Others code refactoring for PERSISTENCE module #283Merged2017-06-162017-06-26
ZOOKEEPER-2816: Code refactoring for ZK_SERVER module #288Merged2017-06-202017-06-26
ZOOKEEPER-2817: Using Collections.singletonList instead of Arrays.asList(oneElement) #290Open2017-06-22
ZOOKEEPER-2821: 1. Fix spell issues; 2. Remove unnecessary boxing / unboxing; 3. Simplify return clause; 4. … #293Open2017-06-27
ZOOKEEPER-2822: Wrong ObjectName about MBeanServer in JMX module #294Open2017-06-27
ZOOKEEPER-2823: 1. Fix spell issues; 2. Standardize StringBuilder#append usage; 3. Using try clause for … #295Open2017-06-28
ZOOKEEPER-2824: FileChannel#size info should be added to FileTxnLog#commit to solve the confuse that reason is too large log or too busy disk I/O #296Merged2017-06-282018-02-02
ZOOKEEPER-2825: 1. Remove unnecessary import; 2. contains instead of indexOf > -1 for more readable … #297Open2017-06-29
ZOOKEEPER-2826: Code refactoring for CLI module #298Open2017-06-29
ZOOKEEPER-2835: Run server with -XX:+AlwaysPreTouch jvm flag #301Open2017-07-04
ZOOKEEPER-2837: Add a special START_SERVER_JVMFLAGS option only for start command to distinguish … #302Open2017-07-04
ZOOKEEPER-2840: Should using System.nanoTime() ^ this.hashCode() for StaticHostProvider #303Open2017-07-05
ZOOKEEPER-2892: Improve lazy initialize and close stream for PrepRequestProcessor #361Open2017-09-06

Issues

All issues in Zookeeper
Open / Close / Total : 15 / 3 / 18


Tensorflow / Tensorflow

Pull Request

TitleStatusCreate DateMerge Date
Add .idea/** into .gitignore for JetBrains IDE #12094Merged2017-08-082017-08-10

如何成为一名优质的 Contributor

通用技巧

保持 Diff 信息最简

PR 中不应该做无关的 Code Format(import / 代码缩进 等)

保持 PR 的相关性

不做无关的 代码优化,尤其是对其他不相关的类(可以另起 PR 进行优化)

保持 代码风格一致

关闭 IDE 自动优化 import 合并为通配符 * 的功能(如,import java.io.* 等)

因地制宜

Druid-io

遵照 Druid 编码规则,比如 参数列表,需要分行写 等

Apache Eagle

Apache Eagle 需要 squash PR 中的 commits 等等

Apache HBase

HBase 是以 Patch + Jira 为主的代码维护模式,Github 里面只是代码镜像,所以提交代码不需要创建 PR

Aapche Superset

Superset / Tensorflow 之类的 Python 项目,需要注意 PEP 规范

Apache Zookeeper

参照官方给出的提交代码的文档即可 How to Contribute to Zookeeper

好的习惯

  • 在提交之前,先更新 master 分支,并通过 git rebase -i master 命令,将自己的提交**置顶**(主分支,也可能不叫 master,比如 Kafka 的主分支是 trunk)
  • 保证自己的代码,能够被单元测试覆盖到。如果原本的测试用例,无法覆盖到,则需要自己编写对应的单元测试
  • 提交性能提升型 PR,需要自己写好 benchmark,并贴出压测结果

小技巧

  • 提交 PR 的时候,在标题的前面增加 [JIRA](对应的 Jira 号)、[MINOR](微小的改动) 和 [WIP](未完成的修改) 之类的标示,可以帮助 Committer 更高效地处理 PR

Tips: 关于 Git 的相关操作,详见我的另一篇博客:《Git 高级玩法

欢迎加入我们的技术群,一起交流学习 🎉 🎉

Technical Discussion Group:(人工智能 1020982(高级)& 1217710(进阶)| BigData 1670647)

  • 本文作者: Benedict Jin
  • 本文链接: https://yuzhouwan.com/posts/19631/
  • 版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处!
显示 Gitment 评论