[GitHub] [brooklyn-server] jcabrerizo opened a new pull request #1198: Csrf-Token mark as secure when https is used
jcabrerizo opened a new pull request #1198: URL: https://github.com/apache/brooklyn-server/pull/1198 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [brooklyn-ui] jathanasiou opened a new pull request #244: Fix/quick launch dialog
jathanasiou opened a new pull request #244: URL: https://github.com/apache/brooklyn-ui/pull/244 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [brooklyn-ui] jathanasiou commented on a change in pull request #245: Fix/quick launch dialog
jathanasiou commented on a change in pull request #245: URL: https://github.com/apache/brooklyn-ui/pull/245#discussion_r668019778 ## File path: ui-modules/utils/quick-launch/quick-launch.js ## @@ -147,23 +144,33 @@ export function quickLaunchDirective() { function deployApp() { $scope.deploying = true; -Promise.resolve(buildYaml()).then(appYaml => { -quickLaunch.planSender(appYaml) -.then((response) => { -if ($scope.callback) { -$scope.callback.apply({}, [{state: 'SUCCESS', data: response.data}]); -} else { -brSnackbar.create('Application Deployed'); -} -$scope.deploying = false; -}) -.catch((err) => { -$scope.model.deployError = err.data.message; -$scope.deploying = false; -}); -}); +Promise.resolve(buildYaml()) +.then(appYaml => { +quickLaunch.planSender(appYaml) +.then((response) => { +if ($scope.callback) { +$scope.callback.apply({}, [{state: 'SUCCESS', data: response.data}]); +} else { +brSnackbar.create('Application Deployed'); +} +$scope.deploying = false; +}) +.catch(({ data }) => { +// handling API error +handleDeployError({ message: data.message }); Review comment: It seems like it could but we're essentially dealing with an http call error and having it mimick a generic `throw 'my message` `Error` object structure. So, it might be best to leave for transparency? I don't mind either way. ## File path: ui-modules/utils/quick-launch/quick-launch.js ## @@ -276,7 +281,7 @@ export function quickLaunchDirective() { newApp[BROOKLYN_CONFIG] = newConfig; } } - + // prefer to use the actual yaml input, but if it's not possible let tryMergeByConcatenate = Object.keys(newApp).length ? Review comment: Added a simple `console.error` since the typical `model.deployError` prop serves a different purpose and this case is controlled enough that it should generally not be able to fail (Form > yaml text generation). Further ideas would be welcome though. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [brooklyn-ui] algairim commented on pull request #245: Fix/quick launch dialog
algairim commented on pull request #245: URL: https://github.com/apache/brooklyn-ui/pull/245#issuecomment-878370810 Refactoring is good. One more Promise possibly to add catch block for. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [brooklyn-dist] jcabrerizo opened a new pull request #173: JSESSIONID mask as httpOnly
jcabrerizo opened a new pull request #173: URL: https://github.com/apache/brooklyn-dist/pull/173 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [brooklyn-ui] jathanasiou opened a new pull request #245: Fix/quick launch dialog
jathanasiou opened a new pull request #245: URL: https://github.com/apache/brooklyn-ui/pull/245 Fixes to deal with certain cases: - Pinned config attributes without defaultValue crashing the YAML serializer - Properly using Location's `id` instead of entire object for predefined/uploaded Location items - YAML Editor note about changes being lost when pressing "Back" - Minor code syntax improvements -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [brooklyn-ui] jathanasiou closed pull request #244: Fix/quick launch dialog
jathanasiou closed pull request #244: URL: https://github.com/apache/brooklyn-ui/pull/244 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [brooklyn-dist] jcabrerizo merged pull request #173: JSESSIONID mask as httpOnly
jcabrerizo merged pull request #173: URL: https://github.com/apache/brooklyn-dist/pull/173 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [brooklyn-ui] jathanasiou commented on a change in pull request #243: Add option to auto-refresh logbook widget with latest update
jathanasiou commented on a change in pull request #243: URL: https://github.com/apache/brooklyn-ui/pull/243#discussion_r667892342 ## File path: ui-modules/utils/logbook/logbook.js ## @@ -177,9 +177,27 @@ export function logbook() { logbookApi.logbookQuery(params, true).then((logEntries) => { -// TODO: implement logic for make output as table. +if ($scope.isLatest && $scope.logEntries.length !== 0) { +if (logEntries.length > 0) { + +// Calculate date-time to display up to. Note, calendar does not take into account milliseconds, +// round down to seconds. +let latestDateTimeToDisplay = Math.floor(logEntries.slice(-1)[0].datetime / DEFAULT_NUMBER_OF_ITEMS) * DEFAULT_NUMBER_OF_ITEMS; + +// Display new log entries. +let newLogEntries = logEntries.filter(entry => entry.datetime <= latestDateTimeToDisplay); Review comment: Would be a bit cleaner as `const newEntries = logEntries.filter(({datetime})=> datetime <= latestDateTimeToDisplay);` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [brooklyn-server] iuliana commented on a change in pull request #1195: Feature/working peristence import api
iuliana commented on a change in pull request #1195: URL: https://github.com/apache/brooklyn-server/pull/1195#discussion_r667881100 ## File path: rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java ## @@ -528,4 +537,79 @@ protected Response exportPersistenceData(MementoCopyMode preferredOrigin) { } } +@Override +public Response importPersistenceData(String persistenceExportLocation) { +try { +File persistenceLocation = new File(persistenceExportLocation); +if (!persistenceLocation.isDirectory()){ +throw WebResourceUtils.badRequest("Invalid persistence directory - %s does not exist or is not a directory", persistenceExportLocation); +} + +// set up temporary management context using the persistence to be imported +BrooklynProperties brooklynPropertiesWithExportPersistenceDir = BrooklynProperties.Factory.builderDefault().build(); + brooklynPropertiesWithExportPersistenceDir.put("amp.persistence.dir",persistenceExportLocation); + +LocalManagementContext tempMgmt = new LocalManagementContext(brooklynPropertiesWithExportPersistenceDir); +PersistenceObjectStore tempPersistenceStore = BrooklynPersistenceUtils.newPersistenceObjectStore(tempMgmt,null, persistenceExportLocation); + tempPersistenceStore.prepareForSharedUse(PersistMode.REBIND,HighAvailabilityMode.AUTO); +BrooklynMementoPersisterToObjectStore persister = new BrooklynMementoPersisterToObjectStore( +tempPersistenceStore, tempMgmt); +PersistenceExceptionHandler persistenceExceptionHandler = PersistenceExceptionHandlerImpl.builder().build(); +RebindManager rebindManager = tempMgmt.getRebindManager(); +rebindManager.setPersister(persister, persistenceExceptionHandler); +rebindManager.forcePersistNow(false, null); + +BrooklynMementoRawData newMementoRawData = tempMgmt.getRebindManager().retrieveMementoRawData(); + +// install bundles to active management context +for (Map.Entry bundleJar : newMementoRawData.getBundleJars().entrySet()){ +ReferenceWithError result = ((ManagementContextInternal)mgmt()).getOsgiManager().get() +.install(InputStreamSource.of("Persistence import - bundle install", bundleJar.getValue().read()), "", false); + +if (result.hasError()) { +if (log.isTraceEnabled()) { +log.trace("Unable to create, format '', returning 400: "+result.getError().getMessage(), result.getError()); +} +String errorMsg = ""; +if (result.getWithoutError()!=null) { +errorMsg = result.getWithoutError().getMessage(); +} else { +errorMsg = Strings.isNonBlank(result.getError().getMessage()) ? result.getError().getMessage() : result.getError().toString(); +} +throw new Exception(errorMsg); +} +} + +// write persisted items and rebind to load applications +BrooklynMementoRawData.Builder result = BrooklynMementoRawData.builder(); +MementoSerializer rawSerializer = new XmlMementoSerializer(mgmt().getClass().getClassLoader()); +RetryingMementoSerializer serializer = new RetryingMementoSerializer(rawSerializer, 1); + +result.planeId(mgmt().getManagementPlaneIdMaybe().orNull()); +result.entities(newMementoRawData.getEntities()); +result.locations(newMementoRawData.getLocations()); +result.policies(newMementoRawData.getPolicies()); +result.enrichers(newMementoRawData.getEnrichers()); +result.feeds(newMementoRawData.getFeeds()); +result.catalogItems(newMementoRawData.getCatalogItems()); + +PersistenceObjectStore currentPersistenceStore = ((BrooklynMementoPersisterToObjectStore) mgmt().getRebindManager().getPersister()).getObjectStore(); + BrooklynPersistenceUtils.writeMemento(mgmt(),result.build(),currentPersistenceStore); + mgmt().getRebindManager().rebind(mgmt().getCatalogClassLoader(),null, mgmt().getHighAvailabilityManager().getNodeState()); + +// clean up the temporary management context Review comment: What is the consequence if an exception is thrown and these are not called? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [brooklyn-ui] algairim commented on a change in pull request #245: Fix/quick launch dialog
algairim commented on a change in pull request #245: URL: https://github.com/apache/brooklyn-ui/pull/245#discussion_r668015840 ## File path: ui-modules/utils/quick-launch/quick-launch.js ## @@ -178,7 +185,8 @@ export function quickLaunchDirective() { } } -function addNewConfigKey() { +function addNewConfigKey({ name, type }) { +// console.log('$item', {name, type }) Review comment: To remove. ## File path: ui-modules/utils/quick-launch/quick-launch.js ## @@ -147,23 +144,33 @@ export function quickLaunchDirective() { function deployApp() { $scope.deploying = true; -Promise.resolve(buildYaml()).then(appYaml => { -quickLaunch.planSender(appYaml) -.then((response) => { -if ($scope.callback) { -$scope.callback.apply({}, [{state: 'SUCCESS', data: response.data}]); -} else { -brSnackbar.create('Application Deployed'); -} -$scope.deploying = false; -}) -.catch((err) => { -$scope.model.deployError = err.data.message; -$scope.deploying = false; -}); -}); +Promise.resolve(buildYaml()) +.then(appYaml => { +quickLaunch.planSender(appYaml) +.then((response) => { +if ($scope.callback) { +$scope.callback.apply({}, [{state: 'SUCCESS', data: response.data}]); +} else { +brSnackbar.create('Application Deployed'); +} +$scope.deploying = false; +}) +.catch(({ data }) => { +// handling API error +handleDeployError({ message: data.message }); Review comment: Can be just `handleDeployError(data)`? ## File path: ui-modules/utils/quick-launch/quick-launch.js ## @@ -276,7 +281,7 @@ export function quickLaunchDirective() { newApp[BROOKLYN_CONFIG] = newConfig; } } - + // prefer to use the actual yaml input, but if it's not possible let tryMergeByConcatenate = Object.keys(newApp).length ? Review comment: Catch block might be required for the Promise in `showEditor` function. Find below. ## File path: ui-modules/utils/quick-launch/quick-launch.js ## @@ -43,22 +46,20 @@ export function quickLaunchDirective() { }, controller: ['$scope', '$http', '$location', 'brSnackbar', 'brBrandInfo' , 'quickLaunchOverrides', controller] }; - +f Review comment: to remove `f` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [brooklyn-server] jcabrerizo merged pull request #1198: Csrf-Token mark as secure when https is used
jcabrerizo merged pull request #1198: URL: https://github.com/apache/brooklyn-server/pull/1198 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org