Skip to content

Commit f86f78f

Browse files
Merge branch 'main' into merge
2 parents 5780964 + f70b42a commit f86f78f

File tree

1,329 files changed

+32960
-13097
lines changed

Some content is hidden

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

1,329 files changed

+32960
-13097
lines changed

.asf.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ github:
2727
- infrastructure
2828
- java
2929
- python
30-
- hosting
3130
- kvm
31+
- libvirt
3232
- vsphere
33+
- vmware
3334
- xenserver
3435
- xcp-ng
36+
- orchestration
37+
- virtualization
38+
- virtual-machine
39+
- kubernetes
3540

3641
features:
3742
wiki: true
@@ -49,6 +54,10 @@ github:
4954
- alexandremattioli
5055
- vishesh92
5156
- soreana
57+
- GaOrtiga
5258
- acs-robot
59+
- BryanMLima
60+
- SadiJr
61+
- JoaoJandre
5362

5463
protected_branches: ~

.github/linters/.flake8

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
# E242 Tab after ','
2121
# E273 Tab after keyword
2222
# E274 Tab before keyword
23+
# E742 Do not define classes named 'I', 'O', or 'l'
24+
# E743 Do not define functions named 'I', 'O', or 'l'
2325
# E901 SyntaxError or IndentationError
2426
# E902 IOError
2527
# W291 Trailing whitespace
@@ -28,4 +30,4 @@
2830
# W391 Blank line at end of file
2931

3032
[flake8]
31-
select = E223,E224,E242,E273,E274,E901,E902,W291,W292,W293,W391
33+
select = E223,E224,E242,E273,E274,E742,E743,E901,E902,W291,W292,W293,W391

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ jobs:
6363
run: |
6464
git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss && cd nonoss && bash -x install-non-oss.sh && cd ..
6565
rm -fr nonoss
66-
mvn -B -P developer,systemvm -Dsimulator -Dnoredist clean install
66+
mvn -B -P developer,systemvm -Dsimulator -Dnoredist clean install -T$(nproc)

.github/workflows/ci.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ jobs:
8080
smoke/test_metrics_api
8181
smoke/test_migration
8282
smoke/test_multipleips_per_nic
83-
smoke/test_nested_virtualization",
83+
smoke/test_nested_virtualization
84+
smoke/test_set_sourcenat",
8485
"smoke/test_network
8586
smoke/test_network_acl
8687
smoke/test_network_ipv6
@@ -124,6 +125,7 @@ jobs:
124125
smoke/test_usage
125126
smoke/test_usage_events
126127
smoke/test_vm_deployment_planner
128+
smoke/test_vm_schedule
127129
smoke/test_vm_life_cycle
128130
smoke/test_vm_lifecycle_unmanage_import
129131
smoke/test_vm_snapshot_kvm
@@ -191,6 +193,8 @@ jobs:
191193

192194
steps:
193195
- uses: actions/checkout@v3
196+
with:
197+
fetch-depth: 0
194198

195199
- name: Set up JDK
196200
uses: actions/setup-java@v3
@@ -215,6 +219,11 @@ jobs:
215219
run: |
216220
python3 -m pip install --user --upgrade urllib3 lxml paramiko nose texttable ipmisim pyopenssl pycrypto mock flask netaddr pylint pycodestyle six astroid
217221
222+
- name: Install jacoco dependencies
223+
run: |
224+
wget https://github.com/jacoco/jacoco/releases/download/v0.8.10/jacoco-0.8.10.zip
225+
unzip jacoco-0.8.10.zip -d jacoco
226+
218227
- name: Env details
219228
run: |
220229
uname -a
@@ -238,7 +247,7 @@ jobs:
238247
239248
- name: Build with Maven
240249
run: |
241-
mvn -B -P developer,systemvm -Dsimulator clean install -DskipTests=true
250+
mvn -B -P developer,systemvm -Dsimulator clean install -DskipTests=true -T$(nproc)
242251
243252
- name: Setup Simulator Prerequisites
244253
run: |
@@ -247,9 +256,16 @@ jobs:
247256
mvn -q -Pdeveloper -pl developer -Ddeploydb
248257
mvn -q -Pdeveloper -pl developer -Ddeploydb-simulator
249258
259+
- name: Generate jacoco-coverage.sh
260+
run: |
261+
echo "java -jar jacoco/lib/jacococli.jar report jacoco-it.exec \\" > jacoco-report.sh
262+
find . | grep "target/classes" | sed 's/\/classes\//\/classes /g' | awk '{print "--classfiles", $1, "\\"}' | sort |uniq >> jacoco-report.sh
263+
find . | grep "src/main/java" | sed 's/\/java\//\/java /g' | awk '{print "--sourcefiles", $1, "\\"}' | sort | uniq >> jacoco-report.sh
264+
echo "--xml jacoco-coverage.xml" >> jacoco-report.sh
265+
250266
- name: Start CloudStack Management Server with Simulator
251267
run: |
252-
export MAVEN_OPTS="-Xmx4096m -XX:MaxPermSize=800m -Djava.security.egd=file:/dev/urandom"
268+
export MAVEN_OPTS="-Xmx4096m -XX:MaxPermSize=800m -Djava.security.egd=file:/dev/urandom -javaagent:jacoco/lib/jacocoagent.jar=address=*,port=36320,output=tcpserver"
253269
echo -e "\nStarting simulator"
254270
set +e
255271
mvn -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120 -pl :cloud-client-ui jetty:run 2>&1 > /tmp/jetty-log || true &
@@ -273,10 +289,20 @@ jobs:
273289
done
274290
275291
echo -e "Stopping Simulator, integration tests run completed\n"
292+
java -jar jacoco/lib/jacococli.jar dump --address localhost --port 36320 --destfile jacoco-it.exec
293+
bash jacoco-report.sh
276294
mvn -Dsimulator -pl client jetty:stop 2>&1
277295
find /tmp//MarvinLogs -type f -exec echo -e "Printing marvin logs {} :\n" \; -exec cat {} \;
278296
279297
- name: Integration Tests Result
280298
run: |
281299
echo -e "Simulator CI Test Results: (only failures listed)\n"
282300
python3 ./tools/marvin/xunit-reader.py integration-test-results/
301+
302+
- uses: codecov/codecov-action@v3
303+
with:
304+
files: jacoco-coverage.xml
305+
fail_ci_if_error: true
306+
flags: simulator-marvin-tests
307+
verbose: true
308+
name: codecov

.github/workflows/codecov.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
runs-on: ubuntu-22.04
3434
steps:
3535
- uses: actions/checkout@v3
36+
with:
37+
fetch-depth: 0
3638

3739
- name: Set up JDK11
3840
uses: actions/setup-java@v3
@@ -45,11 +47,12 @@ jobs:
4547
run: |
4648
git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss
4749
cd nonoss && bash -x install-non-oss.sh && cd ..
48-
mvn -P quality -Dsimulator -Dnoredist clean install
50+
mvn -P quality -Dsimulator -Dnoredist clean install -T$(nproc)
4951
5052
- uses: codecov/codecov-action@v3
5153
with:
5254
files: ./client/target/site/jacoco-aggregate/jacoco.xml
5355
fail_ci_if_error: true
56+
flags: unit-tests
5457
verbose: true
5558
name: codecov

.github/workflows/linter.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,6 @@ concurrency:
2727
cancel-in-progress: true
2828

2929
jobs:
30-
build:
31-
permissions:
32-
contents: read # for actions/checkout to fetch code
33-
statuses: write # for github/super-linter to mark status of each linter run
34-
name: Super-Linter Check
35-
runs-on: ubuntu-22.04
36-
steps:
37-
- name: Checkout Code
38-
uses: actions/checkout@v3
39-
with:
40-
# Full git history is needed to get a proper list of changed files within `super-linter`
41-
fetch-depth: 0
42-
- name: SuperLinter
43-
uses: github/super-linter/[email protected]
44-
env:
45-
DEFAULT_BRANCH: main
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
VALIDATE_ALL_CODEBASE: false
48-
VALIDATE_PYTHON_FLAKE8: true
4930
pre-commit:
5031
name: Run pre-commit
5132
runs-on: ubuntu-22.04

.github/workflows/main-sonar-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ jobs:
6565
run: |
6666
git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss
6767
cd nonoss && bash -x install-non-oss.sh && cd ..
68-
mvn -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack
68+
mvn -T$(nproc) -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack

.github/workflows/sonar-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ jobs:
7070
run: |
7171
git clone https://github.com/shapeblue/cloudstack-nonoss.git nonoss
7272
cd nonoss && bash -x install-non-oss.sh && cd ..
73-
mvn -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack -Dsonar.pullrequest.key="$PR_ID" -Dsonar.pullrequest.branch="$HEADREF" -Dsonar.pullrequest.github.repository=apache/cloudstack -Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.summary_comment=true
73+
mvn -T$(nproc) -P quality -Dsimulator -Dnoredist clean install org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_cloudstack -Dsonar.pullrequest.key="$PR_ID" -Dsonar.pullrequest.branch="$HEADREF" -Dsonar.pullrequest.github.repository=apache/cloudstack -Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.summary_comment=true

.github/workflows/ui.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,12 @@ jobs:
5151
npm run build
5252
npm run lint
5353
npm run test:unit
54+
55+
- uses: codecov/codecov-action@v3
56+
with:
57+
working-directory: ui
58+
files: ./coverage/lcov.info
59+
fail_ci_if_error: true
60+
flags: uitests
61+
verbose: true
62+
name: codecov

.pre-commit-config.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,39 @@ repos:
3434
#- id: check-merge-conflict
3535
- id: check-vcs-permalinks
3636
#- id: check-yaml
37-
#- id: detect-private-key
37+
- id: detect-private-key
38+
exclude: >
39+
(?x)
40+
^scripts/vm/systemvm/id_rsa\.cloud$|
41+
^server/src/test/java/com/cloud/keystore/KeystoreTest\.java$|
42+
^server/src/test/resources/certs/dsa_self_signed\.key$|
43+
^server/src/test/resources/certs/non_root\.key$|
44+
^server/src/test/resources/certs/root_chain\.key$|
45+
^server/src/test/resources/certs/rsa_ca_signed\.key$|
46+
^server/src/test/resources/certs/rsa_self_signed_with_pwd\.key$|
47+
^server/src/test/resources/certs/rsa_self_signed\.key$|
48+
^services/console-proxy/rdpconsole/src/test/doc/rdp-key\.pem$|
49+
^systemvm/agent/certs/localhost\.key$|
50+
^systemvm/agent/certs/realhostip\.key$
3851
- id: end-of-file-fixer
39-
files: \.(java|md|py|txt|yaml|yml)$
52+
exclude: \.vhd$
4053
#- id: fix-byte-order-marker
4154
- id: mixed-line-ending
4255
files: \.(java|md|py|txt|yaml|yml)$
4356
# - id: trailing-whitespace
57+
- repo: https://github.com/pycqa/flake8
58+
rev: 6.1.0
59+
hooks:
60+
- id: flake8
61+
args: [--config, .github/linters/.flake8]
62+
exclude: >
63+
(?x)
64+
^agent/bindir/cloud-setup-agent\.in$|
65+
^client/bindir/cloud-update-xenserver-licenses\.in$|
66+
^cloud-cli/bindir/cloud-tool$|
67+
^python/bindir/cloud-grab-dependent-library-versions$|
68+
^python/bindir/cloud-setup-baremetal$|
69+
^scripts/vm/hypervisor/xenserver/storagePlugin$|
70+
^scripts/vm/hypervisor/xenserver/vmopspremium$|
71+
^setup/bindir/cloud-setup-encryption\.in$|
72+
^venv/.*$

0 commit comments

Comments
 (0)