Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OKAPI-1181 Implement dependency check option #1341

Merged
merged 8 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,9 @@ Future<List<TenantModuleDescriptor>> installUpgradeCreate(
}
}
}
if (!options.getDepCheck() && options.getMaxParallel() > 1) {
return Future.failedFuture(new OkapiError(ErrorType.USER, messages.getMessage("10411")));
}
return tenants.getNotFound(tenantId).compose(tenant ->
moduleManager.getModulesWithFilter(options.getModuleVersionFilter(), null)
.compose(modules -> {
Expand Down Expand Up @@ -1077,10 +1080,8 @@ private void jobRunPending(Tenant t, ProxyContext pc, TenantInstallOptions optio
continue;
}
ModuleDescriptor md = modsAvailable.get(tm.getId());
if (options.getDepCheck()) {
if (!depsOK(tm, md, getEnabledModules(t))) {
continue;
}
if (options.getDepCheck() && !depsOK(tm, md, getEnabledModules(t))) {
continue;
}
if (isExclusive(md)) {
if (running.get() > 0) {
Expand Down
9 changes: 9 additions & 0 deletions okapi-core/src/main/raml/okapi.raml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ traits:
description: |
Number of parallel calls to tenant interfaces of modules.
A value of 1 means calls are happening in sequence.
if depCheck=false and parallel>1, the invocation will be rejected.
julianladisch marked this conversation as resolved.
Show resolved Hide resolved
type: integer
required: false
default: 1
Expand All @@ -104,6 +105,14 @@ traits:
description: Parameters for tenant init
type: string
required: false
depCheck:
description: |
Whether to check dependencies of modules before being installed. Modules are installed exactly
in the order supplied by the client. if depCheck=false and parallel>1, the invocation will be
julianladisch marked this conversation as resolved.
Show resolved Hide resolved
rejected.
type: boolean
required: false
default: true

/_/deployment/modules:
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
10408=Missing id property in JSON response for module {0}: {1} {2}
10409=Unexpected Location header in response for module {0}: {1} {2}
10410=Tenant operation failed for module {0}: {1}
10411=Install Option:parallel can not be greater than 1 when Install Option:depCheck is false
julianladisch marked this conversation as resolved.
Show resolved Hide resolved

#OkapiClient
10500=OkapiClient: No OkapiUrl specified
Expand Down