如何跟踪超多的 Github 项目
Github 是一个非常好的代码协作平台,对于我自己来说,我几乎全部的代码工作都是在 Github 上面完成,虽然 Github 的 Web 界面做的非常的不错,但我发现,如果项目太多,如何很好的跟人协作就成了一个问题。
譬如对于我来说,我现在最关注的项目是 tikv,然后工作中还需要关注 PD,raft-rs,grpc-rs,rust-prometheus,rust-rocksdb 等多个项目,同时,我还需要关注我自己的几个开源项目 go-mysql,go-mysql-elasticsearch,ledisdb。粗略算下来,我一天至少要在十几个工程中穿梭,对这些项目进行追踪,review 一打的 PR,提 comments,然后看相关的 comments 的反馈,看 team 成员最近的工作进展。虽然 Github 的 notifications 机制能帮我减轻很多的工作,但我仍然觉得疲于应付。
为了让我在这么多个项目中游刃有余的进行切换工作,我一直在寻找相关的工具。不过可能是因为我需要的工具定制性太强,所以一直没找到合适的。但程序员的优点就在于没有工具,自己造一个。于是就有了 github-cli。
首先来说说我想要的是什么样的工具,它只是一个 CLI,也就是只需要命令行运行就成,没啥 Web 的东西,这样我用键盘就能操作了。当然,以后能做成 Web 更好,毕竟有时候点鼠标这事情还是很方便的。
其次,这个工具其实不需要特别复杂,只需要干几件事情:
- 获取一段时间不同语言在 Github 上面的 trending,这样我就能知道 Rust,Go 等我关心的语言的一些项目的情况。我并不需要知道特定人的 trending
- 能够获取一批项目的 Pull Requests 情况,譬如最近一段时间 closed 的 PR,或者是还是 open 状态但有更新的 PR 等。也能够对特定的 PR 进行查看,显示出详细的 comments 信息。
- 上面提到了 Pull Requests,自然也需要有同样的功能对 Issues 进行追踪。
- 能够对我自己,或者某个用户进行追踪,譬如他/她最近一段时间提交了什么 PR,review 了哪些 PR,回复了哪些 Issue 等。
对于 github-cli,使用也很简单,首先需要一个配置文件,配置文件大概的格式如下:
account = "siddontang"
[[repos]]
owner = "tikv"
name = "tikv"
[[repos]]
owner = "pingcap"
name = "pd"
最开始就是 account,通常就是使用者本人了。然后就是需要关注的工程列表,owner 就是这个工程所在的用户或者组织名字,name 则就是工程名字了。我们可以把这个文件放在 ~/.github-cli/config.toml
,这样 github-cli 工具就会默认读取。
你也可以在 ~/.github-cli/token
里面存放你自己的 Github token,不过因为 github-cli 工具现在都是只读的操作,要不要 token 都无所谓。
配置好之后,我们就可以操作了。首先,我想关注下最近一周的 trending 情况,直接运行
github-cli trending
[JavaScript] https://github.com/antvis/f2 📱📈An elegant, interactive and flexible charting library for mobile.
https://github.com/trimstray/test-your-sysadmin-skills A collection of *nix Sysadmin Test Questions and Answers for Interview/Exam (2018 Edition).
[C] https://github.com/aergoio/litetree SQLite with Branches
[JavaScript] https://github.com/felixrieseberg/windows95 💩🚀 Windows 95 in Electron. Runs on macOS, Linux, and Windows.
反正无论怎么运行,JavaScript 的项目都是排在前列的 :-)
或者只是关注下 Rust 的情况
github-cli trending rust
[Rust] https://github.com/tikv/tikv Distributed transactional key-value database, originally created to complement TiDB
[Rust] https://github.com/rust-lang/rust A safe, concurrent, practical language.
比较幸运,TiKV 这个项目经常在 trending 里面。
我想关注下 TiKV 最近还没合并的 PR 情况,按照 update 的时间逆序排序
github-cli pulls tikv
tikv/tikv
2018-09-01 06:26:48 https://github.com/tikv/tikv/pull/3554 coprocessor/dag/expr: add un-pushed builtin UDFs(md5)
2018-09-01 06:05:44 https://github.com/tikv/tikv/pull/3535 docs: add TiKV Coprocessor config doc
2018-09-01 06:02:46 https://github.com/tikv/tikv/pull/3495 Move coprocessor test utilites to test_coprocessor library
或者是近期已经 closed 掉的 PR
github-cli pulls tikv --state closed
tikv/tikv
2018-09-01 04:28:05 https://github.com/tikv/tikv/pull/3526 docs: Add RocksDB option config doc
2018-08-31 09:46:20 https://github.com/tikv/tikv/pull/3545 store/util: human readable expired time
2018-08-31 08:31:29 https://github.com/tikv/tikv/pull/3502 docs: add TiKV Control User Guide
然后看看某一个 PR 具体的情况
github-cli pull tikv 3344
Title: Separate Mvcc Reader
Created at 2018-07-24 15:44:07
Message:
<!--
Thank you for contributing to TiKV! Please read TiKV's [CONTRIBUTING](https://github.com/pingcap/tikv/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.
-->
## What have you changed? (mandatory)
This PR separates the `mvcc::MvccReader` into multiples:
- [x] `mvcc::PointGetter`: Provides mvcc point get operation.
- [x] `mvcc::ForwardSeeker`: Provides mvcc forward seek operation.
- [x] `mvcc::ReverseSeeker`: Provides mvcc reverse seek operation.
- [x] `mvcc::CFReader`: Other mvcc operations not listed above are managed by this struct.
当然 issue 也是一样的操作,譬如最近更新的 issue 情况
github-cli issues tikv
tikv/tikv
2018-08-31 06:09:34 https://github.com/tikv/tikv/issues/3550 Log cleaning
2018-08-31 01:26:30 https://github.com/tikv/tikv/issues/3549 remove many box creations in the nested callbacks
2018-08-30 13:38:16 https://github.com/tikv/tikv/issues/3548 Reload configuration at runtime
当然,也可以追踪下我自己这段时间干了啥事情
github-cli events
2018-09-01 06:45:02 - IssueComment: https://github.com/slog-rs/stdlog/pull/6 what do you think @dpc
2018-08-31 07:57:43 - PullComment: https://github.com/pingcap/pd/pull/1222 what does fixPeer mean?
2018-08-31 07:18:25 - IssueComment: https://github.com/pingcap/rust-rocksdb/issues/217 PTAL @DorianZheng
2018-08-31 01:26:30 - Issues: opened https://github.com/tikv/tikv/issues/3549 remove many box creations in the nested callbacks
可以看到,使用 github-cli,能让我通过 CLI 就知道多个项目的进展情况。当然,这还只是一个简单的工具,还有很多需要做的。以后如果能直接在 CLI 上面回复 issue,给 PR 提 comment 那就最好,然后可以支持更多的 filter 操作,譬如只看 assignee 是某几个人的 issue 或者 PR 这些,或者查看长时间挂着一直没有更新的 issue 或者 PR 这些,后面有时间在慢慢完善吧。