Skip to content

Commit 9fe73dc

Browse files
committed
Configure gitleaks, codespell and merge
2 parents 2dd1710 + 96ccd7e commit 9fe73dc

File tree

1,328 files changed

+79477
-11308
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,328 files changed

+79477
-11308
lines changed

.github/linters/codespell.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ coudl
111111
couldnt
112112
craete
113113
craeted
114+
crate
114115
crated
115116
createa
116117
createing
@@ -282,6 +283,7 @@ maintenence
282283
mamagement
283284
mambers
284285
manaully
286+
manuel
285287
maxium
286288
mergable
287289
mesage

.github/linters/gitleaks.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# gitleaks.toml
2+
[allowlist]
3+
description = "Global allow list for Gitleaks"
4+
paths = [
5+
'''gitleaks\.toml''',
6+
'''server/src/test/java/org/apache/cloudstack/network/ssl/CertServiceTest\.java''',
7+
'''test/integration/smoke/test_ssl_offloading\.py''',
8+
'''utils/src/test/java/com/cloud/utils/StringUtilsTest\.java'''
9+
]

.github/workflows/build.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ jobs:
3232
steps:
3333
- uses: actions/checkout@v4
3434

35-
- name: Set up JDK 11
35+
- name: Set up JDK 17
3636
uses: actions/setup-java@v4
3737
with:
38-
java-version: '11'
39-
distribution: 'adopt'
40-
architecture: x64
41-
cache: maven
38+
distribution: 'temurin'
39+
java-version: '17'
40+
cache: 'maven'
4241

4342
- name: Set up Python
4443
uses: actions/setup-python@v5

.github/workflows/ci.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ jobs:
8989
smoke/test_nested_virtualization
9090
smoke/test_set_sourcenat
9191
smoke/test_webhook_lifecycle
92-
smoke/test_purge_expunged_vms",
92+
smoke/test_purge_expunged_vms
93+
smoke/test_extension_lifecycle
94+
smoke/test_extension_custom_action_lifecycle
95+
smoke/test_extension_custom",
9396
"smoke/test_network
9497
smoke/test_network_acl
9598
smoke/test_network_ipv6
@@ -137,6 +140,7 @@ jobs:
137140
smoke/test_vm_deployment_planner
138141
smoke/test_vm_strict_host_tags
139142
smoke/test_vm_schedule
143+
smoke/test_deploy_vgpu_enabled_vm
140144
smoke/test_vm_life_cycle
141145
smoke/test_vm_lifecycle_unmanage_import
142146
smoke/test_vm_snapshot_kvm
@@ -216,13 +220,12 @@ jobs:
216220
with:
217221
fetch-depth: 0
218222

219-
- name: Set up JDK
223+
- name: Set up JDK 17
220224
uses: actions/setup-java@v4
221225
with:
222-
java-version: '11'
223-
distribution: 'adopt'
224-
architecture: x64
225-
cache: maven
226+
distribution: 'temurin'
227+
java-version: '17'
228+
cache: 'maven'
226229

227230
- name: Set up Python
228231
uses: actions/setup-python@v5

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
name: Lint
18+
name: pre-commit
1919

2020
on: [pull_request]
2121

.pre-commit-config.yaml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
---
18-
default_stages: [commit, push]
18+
default_stages: [pre-commit, pre-push]
1919
default_language_version:
2020
# force all unspecified Python hooks to run python3
2121
python: python3
22-
minimum_pre_commit_version: "2.17.0"
22+
minimum_pre_commit_version: "3.2.0"
2323
repos:
2424
- repo: meta
2525
hooks:
@@ -31,8 +31,9 @@ repos:
3131
- id: gitleaks
3232
name: run gitleaks
3333
description: detect hardcoded secrets
34+
args: [-c=.github/linters/gitleaks.toml]
3435
- repo: https://github.com/pre-commit/pre-commit-hooks
35-
rev: v4.6.0
36+
rev: v5.0.0
3637
hooks:
3738
#- id: check-added-large-files
3839
- id: check-case-conflict
@@ -48,6 +49,7 @@ repos:
4849
exclude: >
4950
(?x)
5051
^scripts/vm/systemvm/id_rsa\.cloud$|
52+
^server/src/test/java/org/apache/cloudstack/network/ssl/CertServiceTest.java$|
5153
^server/src/test/java/com/cloud/keystore/KeystoreTest\.java$|
5254
^server/src/test/resources/certs/dsa_self_signed\.key$|
5355
^server/src/test/resources/certs/non_root\.key$|
@@ -57,7 +59,8 @@ repos:
5759
^server/src/test/resources/certs/rsa_self_signed\.key$|
5860
^services/console-proxy/rdpconsole/src/test/doc/rdp-key\.pem$|
5961
^systemvm/agent/certs/localhost\.key$|
60-
^systemvm/agent/certs/realhostip\.key$
62+
^systemvm/agent/certs/realhostip\.key$|
63+
^test/integration/smoke/test_ssl_offloading.py$
6164
- id: end-of-file-fixer
6265
exclude: \.vhd$
6366
- id: fix-byte-order-marker
@@ -69,22 +72,13 @@ repos:
6972
args: [--markdown-linebreak-ext=md]
7073
exclude: ^services/console-proxy/rdpconsole/src/test/doc/freerdp-debug-log\.txt$
7174
- repo: https://github.com/codespell-project/codespell
72-
rev: v2.4.1
75+
rev: v2.2.6
7376
hooks:
7477
- id: codespell
7578
name: run codespell
7679
description: Check spelling with codespell
7780
args: [--ignore-words=.github/linters/codespell.txt]
78-
exclude: |
79-
(?x)^(
80-
systemvm/agent/noVNC/app/locale/.*\.json|
81-
systemvm/agent/noVNC/po/.*|
82-
tools/eclipse/eclipse.epf|
83-
ui/package\.json|
84-
ui/package-lock\.json|
85-
ui/public/js/less\.min\.js|
86-
ui/public/locales/.*[^n].*\.json
87-
)$
81+
exclude: ^systemvm/agent/noVNC/|^ui/package\.json$|^ui/package-lock\.json$|^ui/public/js/less\.min\.js$|^ui/public/locales/.*[^n].*\.json$|^server/src/test/java/org/apache/cloudstack/network/ssl/CertServiceTest.java$|^test/integration/smoke/test_ssl_offloading.py$
8882
- repo: https://github.com/pycqa/flake8
8983
rev: 7.0.0
9084
hooks:

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
# Apache CloudStack [![Build Status](https://github.com/apache/cloudstack/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/build.yml) [![UI Build](https://github.com/apache/cloudstack/actions/workflows/ui.yml/badge.svg)](https://github.com/apache/cloudstack/actions/workflows/ui.yml) [![License Check](https://github.com/apache/cloudstack/actions/workflows/rat.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/rat.yml) [![Simulator CI](https://github.com/apache/cloudstack/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/ci.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache_cloudstack&metric=alert_status)](https://sonarcloud.io/dashboard?id=apache_cloudstack) [![codecov](https://codecov.io/gh/apache/cloudstack/branch/main/graph/badge.svg)](https://codecov.io/gh/apache/cloudstack)
1+
# Apache CloudStack
2+
3+
[![Build Status](https://github.com/apache/cloudstack/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/build.yml)
4+
[![codecov](https://codecov.io/gh/apache/cloudstack/branch/main/graph/badge.svg)](https://codecov.io/gh/apache/cloudstack)
5+
[![Docker CloudStack Simulator Status](https://github.com/apache/cloudstack/actions/workflows/docker-cloudstack-simulator.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/docker-cloudstack-simulator.yml)
6+
[![License Check](https://github.com/apache/cloudstack/actions/workflows/rat.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/rat.yml)
7+
[![Linter Status](https://github.com/apache/cloudstack/actions/workflows/linter.yml/badge.svg)](https://github.com/apache/cloudstack/actions/workflows/linter.yml)
8+
[![Merge Conflict Checker Status](https://github.com/apache/cloudstack/actions/workflows/merge-conflict-checker.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/merge-conflict-checker.yml)
9+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache_cloudstack&metric=alert_status)](https://sonarcloud.io/dashboard?id=apache_cloudstack)
10+
[![Simulator CI](https://github.com/apache/cloudstack/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/ci.yml)
11+
[![UI Build](https://github.com/apache/cloudstack/actions/workflows/ui.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/ui.yml)
212

313
[![Apache CloudStack](tools/logo/apache_cloudstack.png)](https://cloudstack.apache.org/)
414

@@ -160,3 +170,11 @@ The following provides more details on the included cryptographic software:
160170
* CloudStack makes use of the Bouncy Castle general-purpose encryption library.
161171
* CloudStack can optionally interact with and control OpenSwan-based VPNs.
162172
* CloudStack has a dependency on and makes use of JSch - a java SSH2 implementation.
173+
174+
## Star History
175+
176+
[![Apache CloudStack Star History](https://api.star-history.com/svg?repos=apache/cloudstack&type=Date)](https://www.star-history.com/#apache/cloudstack&Date)
177+
178+
## Contributors
179+
180+
[![Apache CloudStack Contributors](https://contrib.rocks/image?repo=apache/cloudstack&anon=0&max=500)](https://github.com/apache/cloudstack/graphs/contributors)

agent/conf/agent.properties

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ hypervisor.type=kvm
213213
# If null (default), defaults to the VM's OS architecture
214214
#guest.cpu.arch=
215215

216-
# This param will require CPU features on the CPU section.
217-
# The features listed in this property must be separated by a blank space (e.g.: vmx vme)
216+
# Specifies required CPU features for end-user and system VMs.
217+
# These features must be present on the host CPU for VM deployment.
218+
# Multiple features should be separated by whitespace (e.g.: vmx vme).
218219
#guest.cpu.features=
219220

220221
# Disables memory ballooning on VM guests for overcommit.
@@ -447,3 +448,6 @@ iscsi.session.cleanup.enabled=false
447448

448449
# Timeout (in seconds) to wait for the incremental snapshot to complete.
449450
# incremental.snapshot.timeout=10800
451+
452+
# If set to true, creates VMs as full clones of their templates on KVM hypervisor. Creates as linked clones otherwise.
453+
# create.full.clone=false

agent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.cloudstack</groupId>
2626
<artifactId>cloudstack</artifactId>
27-
<version>4.21.0.0-SNAPSHOT</version>
27+
<version>4.22.0.0-SNAPSHOT</version>
2828
</parent>
2929
<dependencies>
3030
<dependency>

agent/src/main/java/com/cloud/agent/Agent.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
import com.cloud.utils.nio.NioClient;
9898
import com.cloud.utils.nio.NioConnection;
9999
import com.cloud.utils.nio.Task;
100-
import com.cloud.utils.script.OutputInterpreter;
101100
import com.cloud.utils.script.Script;
102101

103102
/**
@@ -476,7 +475,7 @@ private void scheduleHostLBCheckerTask(final String lbAlgorithm, final long chec
476475
return;
477476
}
478477

479-
logger.info("Scheduling a recurring preferred host checker task with lb algorithm '{}' and host.lb.interval={} ms", lbAlgorithm, checkInterval);
478+
logger.info("Scheduling a recurring preferred host checker task with host.lb.interval={} ms", checkInterval);
480479
hostLbCheckExecutor = Executors.newSingleThreadScheduledExecutor((new NamedThreadFactory(name)));
481480
hostLbCheckExecutor.scheduleAtFixedRate(new PreferredHostCheckerTask(), checkInterval, checkInterval,
482481
TimeUnit.MILLISECONDS);
@@ -614,9 +613,9 @@ protected void setupStartupCommand(final StartupCommand startup) {
614613
}
615614

616615
protected String getAgentArch() {
617-
final Script command = new Script("/usr/bin/arch", 500, logger);
618-
final OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser();
619-
return command.execute(parser);
616+
String arch = Script.runSimpleBashScript(Script.getExecutableAbsolutePath("arch"), 1000);
617+
logger.debug("Arch for agent: {} found: {}", _name, arch);
618+
return arch;
620619
}
621620

622621
@Override
@@ -968,9 +967,11 @@ private Answer migrateAgentToOtherMS(final MigrateAgentConnectionCommand cmd) {
968967
if (CollectionUtils.isNotEmpty(cmd.getMsList())) {
969968
processManagementServerList(cmd.getMsList(), cmd.getAvoidMsList(), cmd.getLbAlgorithm(), cmd.getLbCheckInterval(), false);
970969
}
971-
Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("MigrateAgentConnection-Job")).schedule(() -> {
970+
ScheduledExecutorService migrateAgentConnectionService = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("MigrateAgentConnection-Job"));
971+
migrateAgentConnectionService.schedule(() -> {
972972
migrateAgentConnection(cmd.getAvoidMsList());
973973
}, 3, TimeUnit.SECONDS);
974+
migrateAgentConnectionService.shutdown();
974975
} catch (Exception e) {
975976
String errMsg = "Migrate agent connection failed, due to " + e.getMessage();
976977
logger.debug(errMsg, e);

0 commit comments

Comments
 (0)