dyweb / mos

MOOC & Open Source Group
Apache License 2.0
18 stars 1 forks source link

[idea] Weekly generator #1

Closed gaocegege closed 6 years ago

gaocegege commented 8 years ago

\cc @dyweb/mos

idea issuer: @at15 & @gaocegege & @arrowrowe

ref https://github.com/dyweb/web-stuff/issues/113#issuecomment-256715463

@gaocegege I think we can use a issue comment template like the following. (Attach the template to the issue so every one can copy and paste it since gh does not have issue comment template)

- tags: php, best-lang
- keywords: hybrid
- link: https://github.com/deuill/go-php
- comment: Use PHP with go
- cc: @ComMouse

(or maybe just use the yaml format) so the bot would be easier to implement

Also using a machine understandable language make it easier to do search and build an interactive gh-page for weekly, for search https://www.algolia.com/ seems to be a good solution.

外国友人 @at15 的 idea

目测要求:

  1. 了解 HTTP/HTTPS 请求
  2. 有一门顺手的比较快糙猛的语言(python, ruby, golang, js, ...)
  3. 可以阅读英文文档
gaocegege commented 8 years ago

进阶需求:

实现一个诸如 michael/github 的 API 抽象,便于之后为 bot 加 feature

gaocegege commented 8 years ago

可用的 library:

  1. https://github.com/PyGithub/PyGithub

ref

  1. https://developer.github.com/v3/activity/events/types/#issuecommentevent
  2. https://developer.github.com/webhooks/#events
gaocegege commented 8 years ago

这个 idea 可以分为两个部分

一部分是建立一个类似 hook 的机制,能够捕捉到 @ bot 的comment,然后拿到相应的 issue

另外一个部分是拿到 issue 所有的按照 https://github.com/dyweb/mos/issues/1#issue-186110914 的格式的 comment,把他们全部合并成一个 markdown,作为周报提交一个 PR

目标 repo 是 https://github.com/dyweb/weekly

arrowrowe commented 8 years ago

需要定义好 comment 格式和合并方式什么的

gaocegege commented 8 years ago

嗯不过我觉得比较麻烦是前面一个,没有一个针对 issue 中的 mention 的webhook

ComMouse commented 8 years ago

给 repo 加个 issue create 的 webhook 就可以了吧

arrowrowe commented 8 years ago

@ComMouse 诶? create 下一期周报 issue 时自动找上一期么?... 倒是也挺机智的 = =

gaocegege commented 8 years ago

忽然想到,不需要,可以按照时间来判断

捂脸

arrowrowe commented 8 years ago

......挺好... 每周三 23:59:59 启动, lock, push, close, open......

arrowrowe commented 8 years ago

关于 YAML,

arrowrowe commented 8 years ago

关于 comment 具体规范.

1. 简单投稿

仍然可以简单地投稿, 例如,

https://github.com/mhagger/git-when-merged the `git when-merged` utility.

被转换为

```yaml
name: https://github.com/mhagger/git-when-merged
link: https://github.com/mhagger/git-when-merged
description: >
    the `git when-merged` utility.
``​`

2. 完整投稿

完整的 Comment 则由 yaml 头和正文组成, 头有: name, type, link, description, quote, cc. 除 name 外都可选, 正文也可选.

3. 例子

完整的例子: (写的时候... 不熟悉的话还是在 Online YAML Parser 里写的好......)

```yaml
name: mhagger/git-when-merged
link: https://github.com/mhagger/git-when-merged
description: >
    the `git when-merged` utility.
quote: >
    `git when-merged` helps you figure out when and why a commit
    was merged into a branch.
cc: gaocegege
``​`
适用于 "为什么我 merge 了一下 master 编译就跪了 / 原来是这个 commit 的锅, 它怎么进 master 的"

处理后为:

gaocegege commented 8 years ago

LGTM,实现的时候可以先实现第二种完整投稿,再支持简单投稿

at15 commented 8 years ago

@arrowrowe for the yaml parser, we can have a naive web page like the weekly mail sender using gh-pages, so we can have more control and don't need to see all the ads

arrowrowe commented 8 years ago

@at15 agree :smiley:

ComMouse commented 8 years ago

A simple but more expressive version should also be taken into consideration, i.e.:

DongyueWeb
http://dongyueweb.com

The homepage for Dongyue Studio.

> Dongyue Studio is a studio in SJTU.
> - Freshman Friendly
> - Driven by Interest
> - Anything else

Tags: Dongyue, Project

Which is displayed as:

DongyueWeb http://dongyueweb.com

The homepage for Dongyue Studio.

Dongyue Studio is a studio in SJTU.

  • Freshman Friendly
  • Driven by Interest
  • Anything else

Tags: Dongyue, Project

Or, we may use <!--comment--> to distinguish from different blocks of meta.

codeworm96 commented 8 years ago

dibs

codeworm96 commented 8 years ago

Repository established. You can watch it, if you are interested.

gaocegege commented 7 years ago

Has there been any progress on that front? 😺

codeworm96 commented 7 years ago

@gaocegege All main functional requirements are completed. It can generate weekly for current issues. However, cc MUST be a yaml list for current version, otherwise this field will be skipped.

gaocegege commented 7 years ago

OK, I would be the first user :+1:

ComMouse commented 7 years ago

Close? @gaocegege

gaocegege commented 7 years ago

We should have a list, to know how many ideas have been implemented.

JasonQSY commented 7 years ago

@gaocegege Like PR and issue count which has been used in dyweb/web-stuff or count the total number?

arrowrowe commented 7 years ago

Hi @gaocegege, seems that @codeworm96 feel it still incomplete?

gaocegege commented 7 years ago

Yeah, I would reopen it.

ComMouse commented 7 years ago

Done? @gaocegege

at15 commented 7 years ago

@gaocegege @codeworm96 IMO this issue should be renamed to weekly generator? I was about to open a new issue for GitHub Bot but found this

Done after receiving ack from cece

at15 commented 6 years ago

@codeworm96 @gaocegege @ComMouse so, what about now?

codeworm96 commented 6 years ago

Considering to refactor and transfer the repo to dyweb... It there anyone still writes weekly?

at15 commented 6 years ago

well ... me?

xplorld commented 6 years ago

so this is a issue->gh page converter? maybe we do not need any hook or something, just a static github page reading from github API?

at15 commented 6 years ago

@xplorld https://github.com/codeworm96/dy-weekly-generator/blob/master/src/main.rs#L50-L75

xplorld commented 6 years ago

@at15 I mean, why do we even need a piece of server, instead of a static github page, using frontend js to fetch&parse&render?

at15 commented 6 years ago

@xplorld github API limit and it would be relatively slow to end user. The generator does not need a server, run locally or on a CI system like Travis also works, just publish to gh-pages branch or using https://www.netlify.com/

xplorld commented 6 years ago

@at15 sounds promising. However I do not think that we would have enough pageviews to trigger github api limit (逃

xplorld commented 6 years ago

is it online now?

at15 commented 6 years ago

@xplorld if the user has github plugin that show detailed information when hover, he can trigger client API limit easily, it has nothing to do with us, github limits the API rate based on user's ip

xplorld commented 6 years ago

cool, seen

gaocegege commented 6 years ago

Thank @codeworm96 for the implementation, although we have no weekly now.