Conversation
…ding working case
| " - id: yaml.basic", | ||
| " version: " + TEST_VERSION, | ||
| " item:", | ||
| " services:", |
There was a problem hiding this comment.
We've recommended in the docs (http://brooklyn.apache.org/v/0.11.0/ops/catalog/) that one should use services: with itemType: template, and not with itemType: entity (because the latter only ever has one thing in it).
Can you change this test to use itemType: template, or indicate in a comment at the top that this is testing a discouraged catalog format?
| public void testYamlUrlReferencingCallerCatalogItem() throws Exception { | ||
| addCatalogItems( | ||
| "brooklyn.catalog:", | ||
| " itemType: entity", |
There was a problem hiding this comment.
As above, can we use itemType: template here if we're using services: ...?
| " item:", | ||
| " services:", | ||
| " - type: classpath://yaml-ref-parent-catalog.yaml"); | ||
| " - type: classpath://yaml-ref-catalog.yaml"); // this references yaml.basic above |
There was a problem hiding this comment.
Wow, I didn't no we supported this. Why?!
It looks like classpath://yaml-ref-catalog.yaml contains:
name: Basic app
services:
- name: service
type: yaml.basic:0.1.2
so it's not a catalog item. Should we really be able to reference it as a type in a catalog item like this? I'd have thought the right way of doing it (for an end-user) would be to re-write yaml-ref-catalog.yaml as a catalog item, deploy it to the catalog, and then reference its type in the normal way (which clearly would invalidate this test case).
I suggest we deprecate this asap. I don't think we've documented it anywhere, so hopefully no-one is relying on it in anger.
I therefore think it's not worth fixing this test.
|
good points -- i agree with @aledsage about discouraging this type of reference i think what we want to support is:
all other things should be deprecated? (fixing the test will probably happen for free fixing the other test) i will add an explicit test where it is a template and a note that the other format is deprecated (its behaviour is different so i will leave it) |
|
@neykov does that make sense to you? you did much of this so want to make sure we aren't missing important things! |
|
Support for the
|
|
@aledsage tests updated with comments and explicitly testing template as well and in any case to some extend feels like that should be a separate PR; this PR is just about testing references to co-bundled items, all of which should work if we have a sensible approach to adding items. |
|
+1 to deprecating reason for |
|
Sounds reasonable (on first read :) ). Still seems like a hacky workflow though. Separating the metadata and the content just so it's friendly to ad-hoc editing is not encouraging good dev practices. |
|
Failure unrelated, due to infra: Retest this please. |
|
@neykov I've never liked the split between catalog metadata and item definition. Given that we have it currently, it doesn't feel like a bad dev practise to disallow their separation during dev. If we could remove the split we could make the BOM YAML simpler and remove the need for the two paths. That would mean putting catalog metadata into the definition, IE baking fields such as |
|
In any case a longer discussion than this PR which was only intended to test intra-bundle references. @neykov could you confirm I've correctly interpreted your intention in repairing your test, IE the first commit 758b359 ? If so then I think this is good to merge. We can deprecate syntaxes and rationalize |
|
@alx I think the fix makes sense. |
Add/update some test cases for internal references in catalog BOMs, one working, two failing but marked WIP so this is safe to merge
Working on fixing it as part of #746