-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move automations linkrel types to separate namespace #293
Conversation
0cb0f9a
to
0579ba9
Compare
Since the second commit is just moving a bunch of files to a different package, you probably want to review this PR commit-by-commit. |
1834c3a
to
0d0de02
Compare
|
||
@UtilityClass | ||
public class AutomationLinkRelations { | ||
static final String CURIE = "automation"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course a matter of taste, but this feels a bit long for me (considering we use cg:
rather than contentgrid:
). How about auto:
or ext:
for external?
@@ -14,5 +14,6 @@ public class AutomationLinkRelations { | |||
public static final LinkRelation ANNOTATION = HalLinkRelation.curied(CURIE, "annotation"); | |||
public static final String ANNOTATION_STRING = CURIE+":annotation"; | |||
public static final LinkRelation TARGET_ENTITY = HalLinkRelation.curied(CURIE, "target-entity"); | |||
public static final LinkRelation REGISTRATIONS = HalLinkRelation.curied(CURIE, "registrations"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this just be automations:automations
? Because it's not like you can register at that endpoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, those objects are the automations themselves, are they?
They are registrations for automations; containing automation annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's right that you cannot add registrations here, but you can list the registrations that already there.
...contentgrid/spring/boot/autoconfigure/automation/ContentGridAutomationAutoConfiguration.java
Show resolved
Hide resolved
0d0de02
to
2654101
Compare
@@ -14,5 +14,6 @@ public class AutomationLinkRelations { | |||
public static final LinkRelation ANNOTATION = HalLinkRelation.curied(CURIE, "annotation"); | |||
public static final String ANNOTATION_STRING = CURIE+":annotation"; | |||
public static final LinkRelation TARGET_ENTITY = HalLinkRelation.curied(CURIE, "target-entity"); | |||
public static final LinkRelation REGISTRATIONS = HalLinkRelation.curied(CURIE, "registrations"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's right that you cannot add registrations here, but you can list the registrations that already there.
Create a separate namespace for automations, so the `cg:*` link relations are not being reused in a different context at all. Also move automations configuration to the module itself, and have the autoconfiguration only perform imports. This allows a cleaner extension and the possibility to test automations separately from the rest.
The module is part of contentgrid-spring, so everything should stay in that package namespace.
2654101
to
8064fa5
Compare
Quality Gate passedIssues Measures |
The automation annotation endpoint should have their own namespace for link relation types.
For one, the automation annotations currently reuse the
cg:entity
linkrel to reference the entity collection. However, this causes a problem when fixing #291, becausecg:entity
is defined to be multi-valued; while this relation is single-valued.Since we need a couple of separate link-relation type anyways, let’s reserve the automation CURIE prefix (and a separate URL namespace) to use for link relation types related to automations. This clearly separates the concepts from contentgrid data model concepts.