[INTEGRATION] Automate INFO.yaml file maintenance
[integration.git] / ptl / edit_committers_info / README.md
1 # Edit your repositories INFO.yaml quickly!
2
3 Using that tool it's possible to edit as many INFO.yaml files as you wish. It's not needed to execute the same operations for each of the repository you maintain.
4
5 Nowadays only the committer deletion action is available, but addition option should be added soon.
6
7 ## Requirements
8
9 ### System requirements
10
11 Python 3.10 version is needed to run that tool.
12
13 ### Virtual environment
14
15 It's recommended to create a virtual environment to install all dependencies. Create a virtual env using below command
16
17 ```
18 $ python3.10 -m venv .virtualenv
19 ```
20
21 Virtual environment will be created under `.virtualenv` directory.
22 To activate virtual environemnt call
23
24 ```
25 $ source .virtualenv/bin/activate
26 ```
27
28 ### Python requirements
29
30 - [click](https://click.palletsprojects.com/en/8.0.x/)
31 - [GitPython](https://gitpython.readthedocs.io/en/stable/index.html)
32 - [ruamel.yaml](https://yaml.readthedocs.io/en/latest/)
33
34 Install Python requirements calling
35
36 ```
37 $ pip install -r requirements.txt
38 ```
39
40 ## Usage
41
42 You need to create a `config` YAML file where you describe what changes you want to perform.
43 Required YAML config structure:
44
45 ```
46 ---
47 repos:  # List of the repositories which are going to be udated.
48         # That tool is not smart enough to resolve some conflicts etc.
49         # Please be sure that it would be possible to push the change to the gerrit.
50         # Remember that commit-msg hook should be executed so add that script into .git/hooks dir
51     - path: abs_path_to_the_repo  # Local path to the repository
52       branch: master              # Branch which needs to be udated
53 committers:  # List of the committers which are going to be edited
54     - name: Committer Name  # The name of the committer which we would delete or add
55       action: Deletion|Addition  # Addition or deletion action
56     link: https://link.to.the.tcs.confirmation  # Link to the ONAP TSC action confirmation
57 commit:  # Configure the commit message
58     message:  # List of the commit message lines. That's optional
59     - "[INTEGRATION] My awesome first line!"
60     - "Even better second one!"
61     issue_id: INT-2008  # ONAP's JIRA Issue ID is required in the commit message
62 ```
63
64 ## Contribute
65
66 - Create ONAP Jira ticket
67 - Edit the code
68 - Check the linters
69   - install tox
70     `$ pip install tox`
71   - call linters
72     `$ tox .`
73   - if no errors: push the change