[![CI](https://github.com/OCA/maintainer-tools/actions/workflows/ci.yml/badge.svg)](https://github.com/OCA/maintainer-tools/actions/workflows/ci.yml)
[![Coverage Status](https://img.shields.io/coveralls/OCA/maintainer-tools.svg)](https://coveralls.io/r/OCA/maintainer-tools?branch=master)
# OCA Maintainers Tools
## Installation
$ git clone git@github.com:OCA/maintainer-tools.git
$ cd maintainer-tools
$ virtualenv env
$ . env/bin/activate
$ python setup.py install
Alternatively if using pipx.
$ pipx install oca-maintainers-tools@git+https://github.com/OCA/maintainer-tools.git
## OCA repositories tools
These tools are mostly for maintenance purpose only.
They are used by OCA maintainers to address common operations across all repos.
**Prerequisite**
Get a token from Github.
$ oca-github-login USERNAME
NOTE: you may have to delete the existing one from
"Account settings -> Developer Settings -> Personal Access Tokens".
### Sync team users from community.odoo.com to GitHub teams
Goal: members of the teams should never be added directly on GitHub.
They should be added on https://community.odoo.com. This script will
sync all the teams from Odoo to GitHub.
Prerequisites:
* Your odoo user must have read access to the projects and users;
* The partners on odoo must have their GitHub login set otherwise they won't
be added in the GitHub teams;
* Your GitHub user must have owners rights on the OCA organization to be
able to add or remove members;
* The odoo project must have the same name than the GitHub teams.
Run the script in "dry-run" mode:
$ oca-copy-maintainers --dry-run
Apply the changes on GitHub:
$ oca-copy-maintainers
The first time it runs, it will ask your odoo's username and password.
You may store them using the `--store` option, but watch out: the password is stored in clear text.
### Set labels on OCA repository on GitHub
Set standardized labels to ease the issue workflow on all repositories with same colors.
This tools will also warn you what are the specific labels on some repository
$ oca-set-repo-labels
### Clone all OCA repositories
The script `oca-clone-everything` can be used to clone all the OCA projects:
create a fresh directory, use oca-github-login (or copy oca.cfg from a place
where you've already logged in) and run oca-clone-everything.
The script will create a clone for all the OCA projects registered on
github. For projects already cloned, it run `git fetch --all` to get the
latest versions.
If you pass the `--organization-remotes
<comma-separated-list>` option, the script will also add remotes for the listed
accounts, and run `git fetch` to get the source code from these forks. For instance:
$ oca-clone-everything --organization-remotes yourlogin,otherlogin
will create two remotes, in addition to the default `origin`, called
`yourlogin` and `otherlogin`, respectively referencing
`git@github.com:yourlogin/projectname` and
`git@github.com:otherlogin/projectname` and fetch these remotes, for all the
OCA projects. It does not matter whether the forks exist on github or not, and
you can create them later.
TIP to update branch in shell at once: `ls | xargs -I % git -C % pull origin branch_number`
## Quality tools
These tools are meant to be used both by repo maintainers and contributors.
You can leverage them to give more quality to your modules and to respect OCA guidelines.
### README generator
To provide high quality README for our modules we generate them automatically.
The sections of the final README are organized in fragments.
They must be put inside a `readme` folder respecting [this structure|./readme].
eg.
To generate the final README for the module `auth_keycloak`:
$ oca-gen-addon-readme --repo-name=server-auth --branch=10.0 --addon-dir=auth_keycloak
The result will be a fully PyPI compliant README.rst in the root of your module.
You may also use this script for your own repositories by specifying this
additional argument `--org-name=myorganisation`
### Changelog generator using towncrier
To facilitate the generation of the changelog of addons, we have a
small wrapper around [towncrier](https://pypi.org/project/towncrier/).
For example, this will update HISTORY.rst for `mis_builder` and `mis_builder_budget`
with the version found in their manifest:
$ oca-towncrier --repo=mis-builder --addon-dir=mis_builder --addon-dir=mis_builder_budget --commit
### Icon generator
To provide an icon for our modules we generate them automatically.
To generate the icon for the module `auth_keycloak`:
$ oca-gen-addon-icon --addon-dir=auth_keycloak
A custom icon can be added using the `--src-icon` argument:
$ oca-gen-addon-icon --addon-dir=auth_keycloak --src-icon=/path/to/custom/icon.png
## Developers
As a developer, you want to launch the scripts without installing the
egg.
$ git clone git@github.com:OCA/maintainer-tools.git
$ cd maintainer-tools
$ virtualenv env
$ . env/bin/activate
$ pip install -e .
**Run tests**
$ tox # all tests for all python versions
$ tox -e py27 # python 2.7
$ tox -- -k readme -v # run tests containing 'readme' in their name, verbose
**Get a token from Github**
$ python -m tools.github_login USERNAME
**Run a script**
$ python -m tools.copy_maintainers
You can use the `GITHUB_TOKEN` environment variable to specify the token
$ GITHUB_TOKEN=xxx python -m tools.copy_maintainers
## Integration with `pre-commit`
In any addons repo, you can use these pre-commit hooks:
```yaml
# .pre-commit-config.yaml file
repos:
- repo: https://github.com/OCA/maintainer-tools
rev: master # This is just an example; you must use a tag/commit instead!
hooks:
# Use each script's `--help` to understand the args
- id: oca-gen-addon-readme
args:
- --addons-dir=.
- --org-name=OCA
- --repo-name=server-tools
- --branch=13.0
# This job could easily produce conflicts when it runs on every commit,
# so it's added as a manual job. If you automate it, beware.
# See https://pre-commit.com/#confining-hooks-to-run-at-certain-stages
- id: oca-gen-addons-table
stages: [manual]
- id: oca-gen-addon-icon
args:
- --addons-dir=.
```
没有合适的资源?快使用搜索试试~ 我知道了~
OdooMaintainers用于评估和维护存储库的OCA成员的工具和约定。___下载.zip
共136个文件
py:65个
rst:26个
xml:9个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 97 浏览量
2023-04-19
00:31:55
上传
评论
收藏 159KB ZIP 举报
温馨提示
OdooMaintainers用于评估和维护存储库的OCA成员的工具和约定。___下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
OdooMaintainers用于评估和维护存储库的OCA成员的工具和约定。___下载.zip (136个子文件)
setup.cfg 28B
check_contrib 4KB
module_name.css 142B
ir.model.access.csv 238B
.empty 0B
README.md.expected 1KB
README.expected-acme 2KB
README.expected-acme 2KB
README.expected-acme 2KB
README.expected-oca 3KB
README.expected-oca 3KB
README.expected-oca 3KB
.flake8 69B
.gitignore 760B
.gitkeep 0B
index.html 4KB
tox.ini 614B
gen_addon_readme.rst.jinja 4KB
web_module_name.tour.js 2KB
module_name.js 612B
web_module_name.js 542B
website_module_name.js 531B
README.md 6KB
README.md 1KB
ISSUE_TEMPLATE.md 137B
CONTRIBUTING.md 107B
CONTRIBUTING.md 90B
PULL_REQUEST_TEMPLATE.md 79B
icon.png 9KB
migrate_branch.py 14KB
gen_addon_readme.py 12KB
migrate_branch_empty.py 10KB
oca_projects.py 10KB
publish_modules.py 9KB
copy_maintainers.py 8KB
create_migration_issue.py 8KB
gen_addons_table.py 5KB
copier_update.py 5KB
test_update_pre_commit_excluded_addons.py 5KB
test_gen_addon_readme.py 4KB
update_pre_commit_excluded_addons.py 4KB
oca_towncrier.py 3KB
set_repo_labels.py 3KB
gen_addon_icon.py 3KB
setup.py 3KB
configure_travis.py 3KB
clone_everything.py 3KB
github_login.py 3KB
create_branch.py 3KB
add-badges.py 2KB
github_clabot_hook.py 2KB
odoo_login.py 2KB
config.py 2KB
test_something.py 2KB
test_abstract_something.py 2KB
test_towncrier.py 2KB
fix_manifest_website.py 2KB
hooks.py 2KB
__manifest__.py 2KB
oca_sync_users.py 1KB
test_hash.py 1KB
_hash.py 1KB
manifest.py 1KB
test_gen_addons_table.py 1KB
runbot_ids.py 941B
test_fix_manifest_website.py 815B
exceptions.py 776B
test_gen_addon_icon.py 758B
__openerp__.py 613B
report_name.py 597B
test_manifest.py 582B
__openerp__.py 582B
__openerp__.py 582B
gitutils.py 528B
wizard_model.py 346B
test_config.py 326B
abstract_something.py 247B
pre-migrate.py 234B
post-migrate.py 233B
__init__.py 232B
__manifest__.py 194B
model_name.py 185B
main.py 170B
__manifest__.py 166B
__init__.py 133B
__init__.py 131B
__init__.py 121B
__init__.py 121B
__init__.py 121B
__manifest__.py 116B
__init__.py 93B
__init__.py 92B
__init__.py 91B
__init__.py 85B
README.rst 2KB
README.rst 2KB
README.rst 2KB
README.rst 1KB
towncrier-template.rst 1KB
HISTORY.rst 823B
共 136 条
- 1
- 2
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功