根据regexp规则自动标记github问题。

gitbot的Python项目详细描述


Travis StatusDocumentation Status

说明

应用程序将根据问题的标题、内容和/或 评论。标签由一组正则表达式规则决定。

文档

有关最新文档,请参阅documentation

PIP安装

pip install gitbot

还安装gitbot可执行文件。

运行测试

  • 克隆此存储库并在根目录中运行python setup.py test。 目录。默认情况下,需要验证的测试将是 从存储的betamax磁带重放。这应该足够了 案例。
  • 重新生成betamax磁带
    • 已填充auth_file环境变量并指向 auth.cfg文件。(请参见auth.cfg.sample示例内容)
    • 让文件auth.cfg充满凭据并运行 python setup.py test在根目录中
  • 通过pip download gitbot下载pip包。然后解压 gitbot-x.x.x.zip,cd进入目录并运行 python setup.py test。与上述相同的测试细节 申请。

建筑文档

要测试和构建gitbot文档,请执行以下操作: -将文件夹更改为docs。 -运行pip install -r requirements.txt。 -运行make html(或make.bat html在Windows上)生成文档,或 -运行make doctest(或make.bat doctest在Windows上)以运行文档测试。

操作模式

有两种运行bot的方法:

  • console-主动轮询github以查找新问题并基于给定的 选项标记它们。运行方式github_issues_bot.py console (...)

  • web app-被动地监听github的webhook通知 新问题或已更改的问题。监听github调用的端点是 /callback。可以从命令行运行 github_issues_bot.py web或使用 此wsgi配置:

    import sys path = '/path/to/script/folder'
    if path not in sys.path: sys.path.append(path)
    from web\_listener import app as application
    

快速单层

^{tt20}$ Will process only body of the issue report. Any further comments nor the title of the issue will not be matched against rules.

规则

Rules are located in file rules.cfg by default. Any other file needs to be passed as a command line option. The format for rules is regexp=>desired label.

认证

Bot needs an authentication token with permissions to label issues. Token is stored in auth.cfg file by default. See the example file for details.

For web usage, the webhook secret has to be set in auth.cfg as well as the repository to be handled. The script will not do anything if the security check fails.

控制台模式的详细参数

Usage: github_issues_bot.py console [OPTIONS] REPOSITORIES...

Options:
   -a, --auth TEXT Authentication file. See auth.cfg.sample.
   -v, --verbose Much verbosity. May be repeated multiple times. More v's, more
      info!
   -r, --rules-file TEXT File containing tagging rules.
   -i, --interval INTEGER Interval of repository checking in seconds. Default
      is 60 seconds. -d, --default-label TEXT Label to apply to an issue if no
      other rule applies. If empty, no label is applied. Defaults to no label.
   --process-title / --no-process-title Should the title of the issue be
      matched against the rules as well? Defaults to true. --comments /
   --no-comments Should comments be also matched against the rules?
      Defaults to true.
   --closed-issues / --no-closed-issues Should closed
      issues be still processed? Defaults to false.
   --skip-labelled / --no-skip-labelled Should issues that are labelled already be skipped?
      Defaults to true.
   --remove-current / --no-remove-current Should the
      current labels on an issue be removed if a rule matches? Defaults to
      false.
   --help Show this message and exit.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java gradle无法解析配置的任何依赖项:类路径   来自远程服务的java错误字符串解析   java如何在Tomcat之外运行TomcatSpring/Struts 2Quartz任务?   将Java字节转换为Perl   Java选项:返回值或执行某些操作并继续循环   java如何从对象中获取变量?   postgresql自动部署web服务java和glassfish服务器4.1.1?   使用泛型的java Resteasy重写方法   在另一个用户登录后显示上一个用户的java数据   JSP(Java):编码字节数组并在JavaScript中使用,与C中相同#   Java:如何知道jar在Linux中的位置   java模拟已标记为可访问的私有方法的返回值   java无法理解滚动窗格   java Spring Boot Starter Web依赖项提供缺少工件的错误   java从SQL表创建json文件,然后能够查询该文件   java线程时钟对象   Java实践编程问题   多线程Java GUI未更改   GL30库中不存在intellij idea GLGEnVertexArray()。(JAVA LWJGL)   二进制文件在java中编辑二进制文件