You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by neykov <gi...@git.apache.org> on 2015/11/09 14:13:01 UTC

[GitHub] incubator-brooklyn pull request: Prevent catalog recursion in $bro...

GitHub user neykov opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/1010

    Prevent catalog recursion in $brooklyn:memberSpec

    See test case for details, special flags handling was resetting the encountered catalog ids stack.
    
    /cc @aledsage 

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

    $ git pull https://github.com/neykov/incubator-brooklyn fix-catalog-recursion

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

    https://github.com/apache/incubator-brooklyn/pull/1010.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 #1010
    
----
commit 7113def341821cd2138d0d344b402c1255efe564
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2015-11-09T13:09:49Z

    Add catalog recursion prevention to special flags handling

----


---
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] incubator-brooklyn pull request: Prevent catalog recursion in $bro...

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

    https://github.com/apache/incubator-brooklyn/pull/1010


---
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] incubator-brooklyn pull request: Prevent catalog recursion in $bro...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1010#issuecomment-155489334
  
    good fix, merging


---
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] incubator-brooklyn pull request: Prevent catalog recursion in $bro...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1010#discussion_r44272897
  
    --- Diff: usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlAppTest.java ---
    @@ -24,50 +24,32 @@
     
     
     public class CatalogYamlAppTest extends AbstractYamlTest {
    -    
    -    /**
    -     * "Contrived" example was encountered by a customer in a real use-case!
    -     * I couldn't yet simplify it further while still reproducing the failure.
    -     * Throws StackOverlfowError, without giving a nice error message about 
    -     * "BasicEntity" cyclic reference.
    -     * 
    -     * The circular reference comes from the member spec referencing 
    -     * "org.apache.brooklyn.entity.stock.BasicEntity", but that has been defined in the
    -     * catalog as this new blueprint (which overrides the previous value of it
    -     * being a reference to the Java class).
    -     * 
    -     * We need to use an id that matches something else already on the classpath.
    -     * Otherwise we'd get an error telling us "could not resolve item ..." when
    -     * attempting to add the initial catalog item.
    -     */
    -    @Test(groups="WIP") // TODO Fix this!
    -    public void testAddCatalogItemWithCircularReference() throws Exception {
    -        // Add a catalog item with a circular reference to its own id.
    +
    +    @Test
    +    public void testAddCatalogItemWithMemberSpecCircularReference() throws Exception {
    --- End diff --
    
    test addition is good, but is it worth keeping the note/sketch-test for the case where the circular reference is in a child?


---
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] incubator-brooklyn pull request: Prevent catalog recursion in $bro...

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1010#discussion_r44276464
  
    --- Diff: usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlAppTest.java ---
    @@ -24,50 +24,32 @@
     
     
     public class CatalogYamlAppTest extends AbstractYamlTest {
    -    
    -    /**
    -     * "Contrived" example was encountered by a customer in a real use-case!
    -     * I couldn't yet simplify it further while still reproducing the failure.
    -     * Throws StackOverlfowError, without giving a nice error message about 
    -     * "BasicEntity" cyclic reference.
    -     * 
    -     * The circular reference comes from the member spec referencing 
    -     * "org.apache.brooklyn.entity.stock.BasicEntity", but that has been defined in the
    -     * catalog as this new blueprint (which overrides the previous value of it
    -     * being a reference to the Java class).
    -     * 
    -     * We need to use an id that matches something else already on the classpath.
    -     * Otherwise we'd get an error telling us "could not resolve item ..." when
    -     * attempting to add the initial catalog item.
    -     */
    -    @Test(groups="WIP") // TODO Fix this!
    -    public void testAddCatalogItemWithCircularReference() throws Exception {
    -        // Add a catalog item with a circular reference to its own id.
    +
    +    @Test
    +    public void testAddCatalogItemWithMemberSpecCircularReference() throws Exception {
    --- End diff --
    
    Don't think so, the problem is in crossing the `memberSpec` boundary, so the changes are just to make the test minimal - being a child is not a factor which triggers the bug.
    Don't mind it though, so brought back the original test + note.


---
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.
---