Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dimitri Podborski
AutomationTools
Commits
f4953c02
Commit
f4953c02
authored
Mar 24, 2021
by
Dimitri Podborski
Browse files
Merge branch 'master' into feature_comments
parents
8524eb0e
ee006bd8
Changes
4
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
f4953c02
...
...
@@ -30,7 +30,7 @@ Run the following commands to set everything up:
git clone http://mpegx.int-evry.fr/software/podborski/AutomationTools.git
cd
AutomationTools
python3
-m
venv venv
source
venv/bin/activate
source
venv/bin/activate
(
macOS/Linux
)
or .
\v
env
\S
cripts
\a
ctivate
(
Windows
)
pip
install
-r
requirements.txt
(
run your scripts
)
...
...
@@ -39,6 +39,8 @@ pip install -r requirements.txt
deactivate
```
If you don't want to use virtual environment you can just start with:
`pip install -r requirements.txt`
.
## 2. systems.py
`systems.py`
is a script which is intended to be used in the Systems group. Use the
`-h`
option to see all available parameters.
...
...
automation/gitlab.py
View file @
f4953c02
...
...
@@ -91,7 +91,7 @@ def get_issues(project_id):
project
=
_get_project
(
project_id
)
if
not
project
:
return
[]
issues
=
project
.
issues
.
list
(
state
=
'opened'
)
issues
=
project
.
issues
.
list
(
state
=
'opened'
,
all
=
True
)
return
issues
def
open_issue
(
project_id
,
title
,
description
,
labels
=
[]):
...
...
automation/helpers.py
View file @
f4953c02
...
...
@@ -124,7 +124,7 @@ def load_json_data(json_path):
'''
Load json file from json_path and return the data.
'''
with
open
(
json_path
,
'r'
)
as
f
:
with
open
(
json_path
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
data
=
json
.
load
(
f
)
return
data
...
...
systems.py
View file @
f4953c02
...
...
@@ -183,7 +183,7 @@ def open_issues(table_entries, test, gitlab_members, meeting_start):
print
(
' * {}: No update required for "{}"'
.
format
(
document
[
'document'
],
document
[
'title'
]))
print
(
'Opened issues:'
,
counter
)
def
close_issues
(
table_entries
,
test
):
def
close_issues
(
table_entries
,
test
,
force
):
print
(
'
\n
Close {} issues. TestMode={}'
.
format
(
len
(
table_entries
),
test
))
counter
=
0
for
entry
in
table_entries
:
...
...
@@ -191,6 +191,8 @@ def close_issues(table_entries, test):
project_id
=
entry
[
'project'
][
'id'
]
close_flag
=
entry
[
'close'
]
if
force
:
close_flag
=
True
if
not
close_flag
==
True
:
continue
...
...
@@ -346,10 +348,11 @@ usage_examples= '''Examples:
parser
=
argparse
.
ArgumentParser
(
formatter_class
=
argparse
.
RawTextHelpFormatter
,
description
=
'A tool for managing the GitLab issues for MPEG Systems Subgroups.'
,
epilog
=
usage_examples
)
parser
.
add_argument
(
'-o'
,
'--open'
,
help
=
'Open GitLab issues.'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-c'
,
'--close'
,
help
=
'Close GitLab issues.'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-d'
,
'--docx'
,
help
=
'Generate output word document.'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-l'
,
'--list'
,
help
=
'List information about the contribution(s).'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-o'
,
'--open'
,
help
=
'Mode: Open GitLab issues.'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-c'
,
'--close'
,
help
=
'Mode: Close GitLab issues.'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-d'
,
'--docx'
,
help
=
'Mode: Generate output word document.'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-l'
,
'--list'
,
help
=
'Mode: List information about the contribution(s).'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-C'
,
'--CLOSE'
,
help
=
'Force closing GitLab issues.'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-u'
,
'--update'
,
help
=
'Update MDMS documents database.'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-U'
,
'--UPDATE'
,
help
=
'Update all databases.'
,
action
=
'store_true'
)
parser
.
add_argument
(
'-i'
,
'--csv'
,
help
=
'Input CSV file. Header row shall include "Number" and ("Project URL" or "Sub Group" and "Project Name").'
)
...
...
@@ -428,6 +431,6 @@ if args.open:
gitlab_members
=
None
open_issues
(
table_entries
,
args
.
test
,
gitlab_members
,
meeting_start
)
if
args
.
close
:
close_issues
(
table_entries
,
args
.
test
)
close_issues
(
table_entries
,
args
.
test
,
args
.
CLOSE
)
if
args
.
docx
:
create_output_doc
(
table_entries
,
output_path
,
args
.
template
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment