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

resolves #82 add session.save() after repoinit execution #83

Merged
merged 1 commit into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com)

- issue #59 provide a default, empty resource bundle for a SimpleProgressCheck extension when a bundle cannot be found for the returned resource bundle name.
- issue #77 added pom-type-transitive dependency resolution to oakpal-maven-plugin to fix support for groovy-all pom dependency
- issue #82 make explicit session.save() call after every repoinit script execution to dispatch ACL creation

## [2.2.1] - 2020-09-11

Expand Down
8 changes: 6 additions & 2 deletions core/src/main/java/net/adamcin/oakpal/core/InitStage.java
Original file line number Diff line number Diff line change
Expand Up @@ -439,20 +439,24 @@ void initSession(final Session admin, final ErrorListener errorListener,
}
}));

repoInitUrls.stream().forEachOrdered(repoinitUrl -> {
repoInitUrls.stream().forEachOrdered(uncheckVoid1(repoinitUrl -> {
try (final InputStream repoinitInput = repoinitUrl.openStream();
final Reader repoinitReader = new InputStreamReader(repoinitInput, StandardCharsets.UTF_8)) {
repoInitProcessor.apply(admin, repoinitReader);
admin.save();
} catch (Exception e) {
errorListener.onRepoInitUrlError(e, repoinitUrl);
admin.refresh(false);
}
});
}));

if (!repoInits.isEmpty()) {
try (Reader repoinitReader = new StringReader(String.join("\n", repoInits))) {
repoInitProcessor.apply(admin, repoinitReader);
admin.save();
} catch (Exception e) {
errorListener.onRepoInitInlineError(e, repoInits);
admin.refresh(false);
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/net/adamcin/oakpal/core/OakMachine.java
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,11 @@ void processInstallableQueue(final @NotNull Session admin,
for (final String repoInitScript : initScripts.getScripts()) {
try (Reader reader = new StringReader(repoInitScript)) {
repoInitProcessor.apply(admin, reader);
admin.save();
} catch (final Exception e) {
getErrorListener().onSlingRepoInitScriptsError(e, initScripts.getScripts(),
repoInitScript, installable);
Fun.<Session>uncheckVoid1(session -> session.refresh(false)).accept(admin);
}
}
propagateCheckPackageEvent(preInstall, installable.getParentId(),
Expand Down