You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by geomacy <gi...@git.apache.org> on 2017/06/06 16:16:16 UTC

[GitHub] brooklyn-server pull request #719: Check versionedName to avoid NPE.

GitHub user geomacy opened a pull request:

    https://github.com/apache/brooklyn-server/pull/719

    Check versionedName to avoid NPE.

    Fixes break from https://github.com/apache/brooklyn-server/pull/672,
    I merged without re-running unit tests :-(

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/geomacy/brooklyn-server check-on-catresource

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/719.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 #719
    
----
commit c545381152a22df29d16c063fd6cd2fab4ec7b33
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Date:   2017-06-06T16:15:10Z

    Check versionedName to avoid NPE.
    
    Fixes break from https://github.com/apache/brooklyn-server/pull/672,
    I merged without re-running unit tests :-(

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Posted by geomacy <gi...@git.apache.org>.
Github user geomacy commented on the issue:

    https://github.com/apache/brooklyn-server/pull/719
  
    retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-server/pull/719
  
    LGTM, will wait for the tests to pass and merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Posted by geomacy <gi...@git.apache.org>.
Github user geomacy commented on the issue:

    https://github.com/apache/brooklyn-server/pull/719
  
    Hm, build fails with same error - I can't reproduce that however. I did reproduce the original error, then built everything successfully after making the change above. Odd...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-server/pull/719
  
    Tests pass locally, merging. Will investigate jenkins issue separately.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #719: Check versionedName to avoid NPE.

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/brooklyn-server/pull/719


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-server/pull/719
  
    retest this please, after deleting the workspace


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Posted by geomacy <gi...@git.apache.org>.
Github user geomacy commented on the issue:

    https://github.com/apache/brooklyn-server/pull/719
  
    Hm very strange - it looks as if the test hasn't pulled the [change](https://github.com/apache/brooklyn-server/pull/719/files#diff-774e93f2e6ad061ee24dbb975abff1d0R174), see 
    
    https://builds.apache.org/job/brooklyn-server-pull-requests/ws/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
    
    Copying the relevant lines as the above will be thrown away on next rebuild:
    
    ```java
            @SuppressWarnings("deprecation")
            public static BundleInstallationRestResult of(OsgiBundleInstallationResult in, ManagementContext mgmt, BrooklynRestResourceUtils brooklynU, UriInfo ui) {
                BundleInstallationRestResult result = new BundleInstallationRestResult();
                result.message = in.getMessage();
                result.bundle = in.getMetadata().getVersionedName().toString();
                result.code = in.getCode();
                if (in.getCatalogItemsInstalled()!=null) {
                    result.types = MutableMap.of();
                    for (String id: in.getCatalogItemsInstalled()) {
                        // TODO prefer to use RegisteredType, but we need transformer for those in REST
                        //RegisteredType ci = mgmt.getTypeRegistry().get(id);
                        
                        CatalogItem<?, ?> ci = CatalogUtils.getCatalogItemOptionalVersion(mgmt, id);
                        CatalogItemSummary summary = CatalogTransformer.catalogItemSummary(brooklynU, ci, ui.getBaseUriBuilder());
                        result.types.put(id, summary);
                    }
                }
                return result;
            }
    ```
    
    Note the line 
    ```
                result.bundle = in.getMetadata().getVersionedName().toString();
    ```
    
    which doesn't include the change linked above.
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #719: Check versionedName to avoid NPE.

Posted by geomacy <gi...@git.apache.org>.
Github user geomacy commented on the issue:

    https://github.com/apache/brooklyn-server/pull/719
  
    Looks like it is fetching the apache master instead of the branch from my fork, as below.  Note `c545381152a22df29d16c063fd6cd2fab4ec7b33` is my change but it is fetching from 
    ```
    Checking out Revision 57b9d7270ba87486f311020bf62b37105d4ca0e4 (refs/remotes/origin/master)
    ```
    rather than from `refs/heads/pr/719`.
    
    From build log:
    ```
    GitHub pull request #719 of commit c545381152a22df29d16c063fd6cd2fab4ec7b33, no merge conflicts.
    Setting status of c545381152a22df29d16c063fd6cd2fab4ec7b33 to PENDING with url https://builds.apache.org/job/brooklyn-server-pull-requests/2265/ and message: 'Build started sha1 is merged.'
    Using context: Jenkins: brooklyn-server-pull-request
    [EnvInject] - Loading node environment variables.
    Building remotely on H14 (ubuntu xenial) in workspace /home/jenkins/jenkins-slave/workspace/brooklyn-server-pull-requests
     > git rev-parse --is-inside-work-tree # timeout=10
    Fetching changes from the remote Git repository
     > git config remote.origin.url git://github.com/apache/brooklyn-server.git # timeout=10
    Fetching upstream changes from git://github.com/apache/brooklyn-server.git
     > git --version # timeout=10
     > git fetch --tags --progress git://github.com/apache/brooklyn-server.git +refs/heads/*:refs/remotes/origin/*
     > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
     > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
    Checking out Revision 57b9d7270ba87486f311020bf62b37105d4ca0e4 (refs/remotes/origin/master)
     > git config core.sparsecheckout # timeout=10
     > git checkout -f 57b9d7270ba87486f311020bf62b37105d4ca0e4
    First time build. Skipping changelog.
    Parsing POMs
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---