为水母收集数据的代理
jf-agent的Python项目详细描述
JF U代理
可以在本地运行并收集要发送到Jellyfish的数据的代理。
用法
- 在python 3环境中,使用
pip
: 安装jf_代理
pip install jf_agent
或者,取决于python环境的设置方式,
pip3 install jf_agent
为吉拉:收集你的吉拉证书。您将需要一个jira用户名和对正确项目的读取权限,以及该用户的密码。
使用jira凭据设置环境变量。将
JIRA_USERNAME
和JIRA_PASSWORD
设置为上面找到的用户名和密码。对于Bitbucket:收集您的Bitbucket凭据。将
BITBUCKET_USERNAME
和BITBUCKET_PASSWORD
环境变量设置为适当的值。对于github:创建个人访问令牌(https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)。将
GITHUB_TOKEN
环境变量设置为令牌的内容。创建一个yaml配置文件,告诉jf_代理如何运行。示例配置文件可以是:
global:
# Location to put output files
out_dir: /tmp/agent
# Set this to True to skip verification of server SSL certificates. This might
# be useful if your Jira / Bitbucket server doesn't have a valid SSL certificate.
no_verify_ssl: False
jira:
# URL to jira
url: https://jira.yourcompany.com
# Uncomment this to print the list of available fields and exit
# print_fields_only: True
# GDPR mode: enable this if your Jira instance's API has User
# endpoints modified in order to support GDPR. This should be True
# for Atlassian Cloud hosted JIRA as of March 30, 2019.
gdpr_active: False
# only pull issues from specific projects. Comment this out
# to pull issues from all projects.
include_projects:
- PROJ1
- PROJ2
# Uncomment this to pull issues from all but specific projects.
# exclude_projects:
# - PROJ1
# Uncomment to pull issues from specific project categories only.
# include_project_categories:
# - Engineering
# Uncomment this to pull issues from all but specific project categories.
# exclude_project_categories:
# - Support
# Uncomment this to pull only issues matching a specific JQL filter
# issue_jql: 'text ~ pattern and issuetype != "Secret Type"'
# Uncomment this to pull only specific fields on issues.
# include_fields:
# - id
# - summary
# Uncomment this to pull all but specific fields on issues.
# exclude_fields:
# - description
# - comment
git:
# supported providers are `bitbucket_server` and `github`
provider: bitbucket_server
# URL to bitbucket or github. For github cloud, this should be https://api.github.com; otherwise, use the URL to your local git server.
url: https://bitbucket.yourcompany.com
# only pull from specific projects / organizations. Required for github; comment this out to pull from all projects for bitbucket server.
include_projects:
- PROJ1
# Uncomment this to pull from all but specific projects (not supported for github).
# exclude_projects:
# - PROJ1
# only pull from specific repos. Comment this out to pull from all repos.
include_repos:
- my_repository
# Uncomment this to pull from all but specific repos.
# exclude_repos:
# - repo_to_skip
# Strip out long-form text content (commit messages, PR text, etc)
strip_text_content: False
# Redact names and URLs for projects, repos, branches
redact_names_and_urls: False
- 使用配置文件的路径运行
jf_agent
,可以选择指定提取git数据的时间限制:
jf_agent -c jellyfish.yml [--since 2018-01-01] [--until 2019-04-02]
- 从指定的输出目录中收集生成的文件,并将它们发送到水母。
字段
可以将代理配置为从 吉拉。例如,如果某些字段包含 不想发送给水母的敏感数据。
这可以通过include_fields
和exclude_fields
来控制。
配置文件中的选项。但是,请注意,某些字段必须按顺序排列
让水母工作。这些必需字段是:
issuekey
project
reporter
assignee
creator
issuetype
resolution
resolutiondate
status
created
updated
subtasks
一些jira敏捷特性是在水母使用的“自定义域”内部构建的。这些
自定义字段具有形式为customfield_XXXXX
的键,但其中由x表示的数字
在每个jira安装中都是不同的。你可以找到定制的钥匙
通过在配置文件中使用print_fields_only
选项运行代理来获取字段。习俗
水母使用的字段如下:
Epic Link
Epic Name
Sprint
Parent Link
Story Points
Rank
确保至少为水母配置了这些字段。
如果拉动以下字段,则会启用其他水母功能:
summary
description
priority
worklog
comment
timetracking
duedate
labels
fixVersions
versions
components
timeestimate
timeoriginalestimate
timespent
aggregatetimespent
aggregatetimeoriginalestimate
aggregatetimeestimate