Skip to content

Commit eb68a14

Browse files
shokakucarrierligangtyhjmodi
authored
Merge Release from main (#176)
* Chore: fix a github action issue * bandit failure because of underlying container, so disabled * Fix pip install deprecation warning * Fix: Remove boto3_type_annotations from requirements due to rpm deps issue * validate config with schema * MMENG-3153 Signed-off-by: Harsh Modi <[email protected]> * update rpm spec to fix rpm build * CLOUDBLD-3153 Signed-off-by: Harsh Modi <[email protected]> * remove `ignore_patterns` as a required property * MMENG-3153 Signed-off-by: Harsh Modi <[email protected]> * fix schema retrieval Instead of trying to fetch from relative paths, package schemas with charon and retrieve from pkg resources * MMENG-3153 Signed-off-by: Harsh Modi <[email protected]> * bump charon version * MMENG-3153 Signed-off-by: Harsh Modi <[email protected]> * make tests more robust * fix test paths to avoid failures when CWD is different * fix getenv * MMENG-3141 Signed-off-by: Harsh Modi <[email protected]> * switch to tox env for running tests instead of relying on containers * MMENG-3141 Signed-off-by: Harsh Modi <[email protected]> * update github actions to use tox * MMENG-3141 Signed-off-by: Harsh Modi <[email protected]> * enable mypy type checkers * MMENG-3141 Signed-off-by: Harsh Modi <[email protected]> * enable bandit analyzer * MMENG-3141 Signed-off-by: Harsh Modi <[email protected]> * disable mypy it's not ideal currently to enable it. Revisit this later. * MMENG-3141 Signed-off-by: Harsh Modi <[email protected]> * fix pytest issue current latest pytest==7.2.0 is having dependency conflicts Signed-off-by: Harsh Modi <[email protected]> * initial implementation of singature for artifacts (#169) * initial implementation of singature for artifacts * add API doc to generate_sign function * update README file * use configuration file to controll artifacts needs sign * fix some minor problem * change suffix to exclude instead * remove unused logger * fix minor problem * change charon.yml to a proper extension, change name of suffix confi * add rpm-sign as method of signature (#170) * move subprocess command to configuration, make subprocess to run async (#172) * move subprocess command to configuration, make subprocess to run async * simplify template rendering of sign command * Remove unwanted file * changed semaphore passing in asynic function (#173) * use shlex to replace split instead (#174) * add maven sign unit test (#175) --------- Signed-off-by: Harsh Modi <[email protected]> Co-authored-by: Gang Li <[email protected]> Co-authored-by: Harsh Modi <[email protected]>
1 parent 1a93b60 commit eb68a14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1512
-735
lines changed

.github/workflows/linters.yaml

+71-55
Original file line numberDiff line numberDiff line change
@@ -9,80 +9,56 @@ on:
99
- release_*
1010

1111
jobs:
12-
bandit:
13-
name: Bandit analyzer for Python ${{ matrix.os.python }} on
14-
${{ matrix.os.name }}-${{ matrix.os.version }}
12+
flake8:
13+
name: Flake8 for Python ${{ matrix.python-version }}
1514
runs-on: ubuntu-latest
1615

1716
strategy:
18-
fail-fast: false
1917
matrix:
20-
os:
21-
- name: centos
22-
version: 7
23-
python: 3
24-
engine: docker
25-
26-
- name: fedora
27-
version: 34
28-
python: 3
29-
engine: docker
18+
python-version: [ "3.8" ]
3019

3120
steps:
32-
- uses: actions/checkout@v1
33-
34-
- run: ./test.sh
35-
env:
36-
OS: ${{ matrix.os.name }}
37-
OS_VERSION: ${{ matrix.os.version }}
38-
PYTHON_VERSION: ${{ matrix.os.python }}
39-
ENGINE: ${{ matrix.os.engine }}
40-
ACTION: bandit
41-
42-
flake8:
43-
name: Flake8 for Python 3
44-
runs-on: ubuntu-latest
45-
46-
steps:
47-
- name: Check out repo
48-
uses: actions/checkout@v2
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip setuptools tox
4928
50-
- name: Run flake8 for Python 3
51-
uses: containerbuildsystem/actions/flake8@master
29+
- name: Run flake8 on python${{ matrix.python-version }}
30+
run: python -m tox -e flake8
5231

53-
# markdownlint:
54-
# name: Markdownlint
55-
# runs-on: ubuntu-latest
32+
markdownlint:
33+
name: Markdownlint
34+
runs-on: ubuntu-latest
5635

57-
# steps:
58-
# - name: Check out repo
59-
# uses: actions/checkout@v2
36+
steps:
37+
- name: Check out repo
38+
uses: actions/checkout@v2
6039

61-
# - name: Run markdownlint
62-
# uses: containerbuildsystem/actions/markdownlint@master
40+
- name: Run markdownlint
41+
uses: containerbuildsystem/actions/markdownlint@master
6342

6443
pylint:
65-
name: Pylint analyzer for Python ${{ matrix.os.python }}
44+
name: Pylint analyzer for Python ${{ matrix.python-version }}
6645
runs-on: ubuntu-latest
6746

6847
strategy:
6948
matrix:
70-
os:
71-
- name: fedora
72-
version: 34
73-
python: 3
74-
engine: docker
49+
python-version: [ "3.8" ]
7550

7651
steps:
77-
- uses: actions/checkout@v2
52+
- uses: actions/checkout@v3
53+
- uses: actions/setup-python@v4
54+
with:
55+
python-version: ${{ matrix.python-version }}
56+
- name: Install dependencies
57+
run: |
58+
python -m pip install --upgrade pip setuptools tox
7859
79-
- run: ./test.sh
80-
env:
81-
OS: ${{ matrix.os.name }}
82-
OS_VERSION: ${{ matrix.os.version }}
83-
PYTHON_VERSION: ${{ matrix.os.python }}
84-
ENGINE: ${{ matrix.os.engine }}
85-
ACTION: pylint
60+
- name: Run pylint on python${{ matrix.python-version }}
61+
run: python -m tox -e pylint
8662

8763
shellcheck:
8864
name: Shellcheck
@@ -94,3 +70,43 @@ jobs:
9470

9571
- name: Run ShellCheck
9672
uses: containerbuildsystem/actions/shellcheck@master
73+
74+
# mypy:
75+
# name: mypy type checker for Python ${{ matrix.python-version }}
76+
# runs-on: ubuntu-latest
77+
#
78+
# strategy:
79+
# matrix:
80+
# python-version: [ "3.8" ]
81+
#
82+
# steps:
83+
# - uses: actions/checkout@v3
84+
# - uses: actions/setup-python@v4
85+
# with:
86+
# python-version: ${{ matrix.python-version }}
87+
# - name: Install dependencies
88+
# run: |
89+
# python -m pip install --upgrade pip setuptools tox
90+
#
91+
# - name: Run mypy on python${{ matrix.python-version }}
92+
# run: python -m tox -e mypy
93+
94+
bandit:
95+
name: Bandit analyzer for Python ${{ matrix.python-version }}
96+
runs-on: ubuntu-latest
97+
98+
strategy:
99+
matrix:
100+
python-version: [ "3.8" ]
101+
102+
steps:
103+
- uses: actions/checkout@v1
104+
- uses: actions/setup-python@v4
105+
with:
106+
python-version: ${{ matrix.python-version }}
107+
- name: Install dependencies
108+
run: |
109+
python -m pip install --upgrade pip setuptools tox
110+
111+
- name: Run bandit analyzer on python${{ matrix.python-version }}
112+
run: python -m tox -e bandit

.github/workflows/unittests.yaml

+20-37
Original file line numberDiff line numberDiff line change
@@ -10,68 +10,51 @@ on:
1010

1111
jobs:
1212
test:
13-
name: Python ${{ matrix.os.python }} tests on ${{ matrix.os.name }}-${{ matrix.os.version }}
14-
runs-on: ubuntu-18.04
13+
name: Python ${{ matrix.python-version }} tests
14+
runs-on: ubuntu-latest
1515

1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
os:
20-
- name: centos
21-
version: 7
22-
python: 3
23-
engine: docker
24-
25-
- name: fedora
26-
version: 33
27-
python: 3
28-
engine: docker
29-
30-
- name: fedora
31-
version: 34
32-
python: 3
33-
engine: docker
19+
python-version: ["3.7", "3.8", "3.9"]
3420

3521
steps:
36-
- name: Check out repo
37-
uses: actions/checkout@v2
22+
- uses: actions/checkout@v3
23+
- uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip setuptools tox
3829
39-
- name: pytests via test.sh
40-
env:
41-
OS: ${{ matrix.os.name }}
42-
OS_VERSION: ${{ matrix.os.version }}
43-
PYTHON_VERSION: ${{ matrix.os.python }}
44-
ENGINE: ${{ matrix.os.engine }}
45-
run: ./test.sh
30+
- name: Run unittests on python${{ matrix.python-version }}
31+
run: python -m tox -e test
4632

4733
- name: Upload pytest html report
4834
uses: actions/upload-artifact@v2
4935
if: failure()
5036
with:
51-
path: __pytest_reports/atomic-reactor-unit-tests.html
52-
name: atomic-reactor-unit-tests_${{ matrix.os.name }}_${{ matrix.os.version }}.python${{ matrix.os.python }}.html
37+
path: __pytest_reports/charon-unit-tests.html
38+
name: charon-unit-tests_python${{ matrix.os.python }}.html
39+
5340

5441
- name: Run coveralls-python
5542
env:
5643
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
COVERALLS_FLAG_NAME: ${{ matrix.os.name }}-${{ matrix.os.version }}-python${{ matrix.os.python }}
44+
COVERALLS_FLAG_NAME: python${{ matrix.python-version }}
5845
COVERALLS_PARALLEL: true
5946
run: |
60-
pip3 install --upgrade pip
61-
pip3 install --upgrade setuptools
62-
pip3 install --upgrade coveralls
63-
/home/runner/.local/bin/coveralls --service=github
47+
python -m pip install --upgrade coveralls
48+
python -m coveralls --service=github
6449
6550
coveralls-finish:
6651
name: Finish coveralls-python
6752
needs: test
68-
runs-on: ubuntu-18.04
53+
runs-on: ubuntu-latest
6954
steps:
7055
- name: Finished
7156
run: |
72-
pip3 install --upgrade pip
73-
pip3 install --upgrade setuptools
74-
pip3 install --upgrade coveralls
57+
pip3 install --upgrade pip setuptools coveralls
7558
/home/runner/.local/bin/coveralls --finish --service=github
7659
env:
7760
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ future. And Ronda service will be hosted in AWS S3.
1414

1515
See [AWS CLi V2 installation](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html#cliv2-linux-install)
1616

17+
### [Optional] rpm-sign or GnuPG CLI tool
18+
19+
Can be configured to use rpm-sign or any command to generate .asc file.
20+
1721
## Installation
1822

1923
### From git
@@ -49,7 +53,7 @@ to configure AWS access credentials.
4953
### charon-upload: upload a repo to S3
5054

5155
```bash
52-
usage: charon upload $tarball --product/-p ${prod} --version/-v ${ver} [--root_path] [--ignore_patterns] [--debug]
56+
usage: charon upload $tarball --product/-p ${prod} --version/-v ${ver} [--root_path] [--ignore_patterns] [--debug] [--contain_signature] [--key]
5357
```
5458

5559
This command will upload the repo in tarball to S3.

0 commit comments

Comments
 (0)