保姆级教程:如何成为 Apache Linkis 文档贡献者


不会写代码,也能为社区做贡献
大家好,我是 WeDataSphere 小助手,平时有些刚刚接触开源项目的同学找我聊天,问到一个有趣的问题:开源项目都是开发大佬,但我不会写代码,我还能为开源社区做贡献么?
小助手的答案非常明确:不会写代码,也可以给社区做出很多贡献的。
首先我们立体的看待开源项目和开源社区,除了代码以外,我们是不是还需要:
完善的安装部署文档、技术博客、官网文档指引、视频教程;
组织社区活动、推广开源项目、撰写宣传文案、设计精美的社区图案;
参与用户交流、QA 答疑、社区投票、发现 BUG、提出建议;
每一个社区用户都可以结合自己的兴趣爱好和擅长的领域,为社区做贡献。
文档作为项目很重要的一部分,需要不断的更新迭代。因此今天小助手准备了保姆级教程,手把手教大家如何做文档贡献者,成功为 Linkis 项目贡献文档,还能够成为 Apache 项目的文档贡献者,获得社区定制的贡献者证书哦~~

(证书系列)

文档贡献实践案例
这次的教程,我们的实践场景是:在 Linkis 官网中增加“如何参与开发者例会”菜单和对应的文档内容。
- 官网链接(英文):https://linkis.apache.org/community/how-to-contribute-to-website/
- 官网链接(中文):https://linkis.apache.org/zh-CN/community/how-to-contribute-to-website/

当前是没有“如何参与开发者例会”的菜单,请跟小助手一步一步来操作,走起~~

实践操作步骤
第一步:Fork 官网仓库
步骤 1:打开官网对应的 GitHub 链接:https://github.com/apache/incubator-linkis-website/

步骤 2:点击 Fork 按钮,把官网的项目 Fork 到自己的仓库中

第二步:同步源仓库 &创建临时开发分支
步骤 1:打开自己 fork 的仓库 https://github.com/{you githubid}/incubator-linkis-website/。
步骤 2:切换到 dev 分支,点击【Fetch upstream】;如果你的 dev 分支不是上游源仓库 dev 分支最新的代码,可以点击【Fetch and Merge】进行同步,将上游源仓库 dev 分支代码同步 fork 的 dev 分支上。

步骤 3:基于 dev 分支创建 dev-fix 分支,修改开发基于 dev-fix 分支进行 ,如果存在上一次提交 PR 使用的 dev-fix 分支,如果 PR 已经被 merge,可以先删除,再创建 dev-fix 分支;或则创建 dev-fix2 分支。

第三步:Clone 到本地
首次克隆,参考步骤 1-4;后续的更新,参考步骤 5。
步骤 1:点击“code”按钮,选择“Open with GitHub Desktop”。大家可以提前下载安装好 GitHub 的桌面客户端,链接:https://desktop.github.com/。

步骤 2:确认克隆配置链接和本地文件夹。

步骤 3:等待克隆完成。通过 GitHub 客户端下载代码到本地,首次需要的时间会比较长。

步骤 4:克隆完成,在本地可以看到对应的文件与 GitHub 上的是一致的。

步骤 5:获取远程分支,同步到本地。如果已经克隆过,后续修改直接获取远程分支即可。

由于 dev 是基于多人协作,开发者会同时提交多处修改。因此在做修改前,一定要基于最新版本的分支,否则会导致版本冲突等异常情况。
第四步:修改内容
包含了增删改查的操作,对于本次的实践,是增加“如何参与开发者例会”的内容,因此我们只需要添加对应文档即可。
步骤 1:找到对应的官网文档目录。我们是在顶部“社区”导航下添加内容,因此找“/community/”目录。官网分为中英文版本,所以需要找到中英文对应的目录。
- 英文目录:/community/
- 中文目录:/i18n/zh-CN/docusaurus-plugin-content-docs-community/current/

(中文目录)
步骤 2:在中文和英文的路径目录中增加文件“how-to-participate-in-developer-meetings.md”
步骤 3:编写文件内容,需要中英文版本,使用 markdown 的格式来写;

第五步:Commit 到仓库
步骤 1:中文和英文两个文件都修改完毕后,我们可以看到 GitHub 客户端左边会出现对应修改的文件。左下角有 Commit 的功能,填写 Commit 的相关内容,点击按钮。
注意点:要在 dev-fix 分支上进行提交,不要选择 master/dev,不要选择 master/dev,不要选择 master/dev。

步骤 2:点击“Push origin”,把提交的 Commits 内容 Push 到 GitHub 项目中

第六步:创建 Pull Request
步骤 1:Push 完毕后,客户端会出现“Create Pull Request”按钮。

步骤 2:创建 Pull Request。
有两种方式进行创建 PR,提交自己的 dev-fix 分支的 PR 到上游源仓库的 dev 分支。
第一种:通过点击客户端出现的“Create Pull Request”按钮进行创建
第二种:打开 GitHub 网页直接进行创建,链接:https://github.com/apache/incubator-linkis-website/compare/master...Andywli:master

步骤 3:创建 PR 成功

第七步:等待 Review 和 Merge
(1)提交 PR 成功后,需要等待官方开发同学进行内容 Review。如果提交的内容有问题,官方开发同学会在 PR 上进行留言,根据反馈进行修改文档内容。
(2)如无修改,则等待 Merge。Merge 成功后,会收到邮件通知。

(3)PR 被 Merge 后,状态也会发生改变;

经过千辛万苦,终于完成了 7 步,成功把文档内容提交到 GitHub,后续就留意项目开发者的 Merge 进度了。
第八步:更新官网内容
负责官网的开发同学,会定期把代码更新到测试环境,在测试环境中测试通过后就会更新到正式环境的官网。
- 测试官网:https://linkis.staged.apache.org/zh-CN/community/community:how-to-participate-in-developer-meetings/
- 正式官网:https://linkis.apache.org/zh-CN/community/community:how-to-participate-in-developer-meetings


成为 Apache Linkis 贡献者
很高兴,我们成功把“如何参与开发者例会”的文档更新到官网啦!
所以,不会写代码,也是可以为开源社区做贡献的。对于成功贡献的小伙伴们,我们也能看到自己的劳动成果。
在 GitHub 项目中的 Contributors 列表中可以看到自己的头像。

在 Linkis 官网中也可以看到自己已经被添加到“Contributors of Apache Linkis WebSite”中。
官网贡献者列表:https://linkis.apache.org/zh-CN/team

最后,参考文章【请领取贡献者证书】WeDataSphere社区贡献名单公布的内容,填写调查问卷,获取您的贡献者证书。
【贡献指引】
Apache Linkis 官网贡献指引:https://www.bilibili.com/video/BV1qr4y1s7pv?share_source=copy_web
Apache Linkis 项目贡献指引:https://www.bilibili.com/video/BV1MZ4y1b7Km?share_source=copy_web
官网项目新手任务列表:https://github.com/apache/incubator-linkis-website/issues/270
评论