You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by tbouron <gi...@git.apache.org> on 2018/01/08 14:03:19 UTC
[GitHub] brooklyn-server pull request #928: Allow deprecation as the catalog item lev...
GitHub user tbouron opened a pull request:
https://github.com/apache/brooklyn-server/pull/928
Allow deprecation as the catalog item level
In YAML, one can mark a catalog item as `deprecated` but it works only when the flag it set as the `brooklyn.catalog` level.
This allows each catalog item to use the deprecated flag as one see fit. For example, I used it for the deprecated policies/enrichers we have within Brooklyn (see changes in bom files)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tbouron/brooklyn-server fix/catalog-deprecated
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/brooklyn-server/pull/928.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #928
----
commit 8d35ddb2b7a072213e8dfb01bcccf9d74accd55b
Author: Thomas Bouron <th...@...>
Date: 2018-01-08T14:00:21Z
Allow deprecation as the catalog item level
----
---
[GitHub] brooklyn-server issue #928: Allow deprecation as the catalog item level
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the issue:
https://github.com/apache/brooklyn-server/pull/928
@tbouron there's a minor conflict with #929 which I just merged - could you resolve that and then happy for this to be merged.
---
[GitHub] brooklyn-server pull request #928: Allow deprecation as the catalog item lev...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/brooklyn-server/pull/928
---
[GitHub] brooklyn-server pull request #928: Allow deprecation as the catalog item lev...
Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/928#discussion_r160350476
--- Diff: core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java ---
@@ -1092,8 +1092,11 @@ private String setFromItemIfUnset(String oldValue, Map<?,?> item, String fieldAt
if (Strings.isNonBlank(oldValue)) return oldValue;
if (item!=null) {
Object newValue = item.get(fieldAttr);
- if (newValue instanceof String && Strings.isNonBlank((String)newValue))
- return (String)newValue;
+ if (newValue instanceof String && Strings.isNonBlank((String)newValue)) {
+ return (String) newValue;
+ } else if ((newValue instanceof Number || newValue instanceof Boolean) && Strings.isNonBlank(newValue.toString())) {
--- End diff --
Minor: a number or boolean's `toString` should never be null or blank so we could remove the `Strings.isNonBlank` check.
---
[GitHub] brooklyn-server issue #928: Allow deprecation as the catalog item level
Posted by tbouron <gi...@git.apache.org>.
Github user tbouron commented on the issue:
https://github.com/apache/brooklyn-server/pull/928
retest this please
---
[GitHub] brooklyn-server issue #928: Allow deprecation as the catalog item level
Posted by tbouron <gi...@git.apache.org>.
Github user tbouron commented on the issue:
https://github.com/apache/brooklyn-server/pull/928
@aledsage Fixed conflicts and addressed your comment
---