-
Notifications
You must be signed in to change notification settings - Fork 20
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
Allow goals to receive implementations and listeners #504
Conversation
This requires more polish
[atomist:generated] [atomist:autofix=TypeScript header]
[atomist:generated] [atomist:autofix=TypeScript header]
[atomist:generated] [atomist:autofix=TypeScript header]
[atomist:generated] [atomist:autofix=tslint]
[atomist:generated] [atomist:autofix=TypeScript header]
[atomist:generated] [atomist:autofix=tslint]
const matchedNames = this.implementations.filter(m => | ||
m.implementationName === goal.fulfillment.name && | ||
m.goal.context === goal.externalKey); | ||
|
||
const matchedGoalImplementations = []; |
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.
does this mean there are no more push tests on implementations? ... or that they aren't used?
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.
no, they are being used and evaluated when we SetOnGoalsOnPush. I added this here again last week which was a mistake.
src/api-helper/goal/storeGoals.ts
Outdated
const {goalSet, goal, goalSetId, state, id, providerId, url} = parameters; | ||
const fulfillment = parameters.fulfillment || {method: "other", name: "unspecified"}; | ||
const { goalSet, goal, goalSetId, state, id, providerId, url } = parameters; | ||
const fulfillment = parameters.fulfillment || { method: SdmGoalFulfillmentMethod.Other, name: "unkown" }; |
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.
spelling: unkown
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.
Good point.
@@ -268,6 +275,8 @@ export abstract class AbstractSoftwareDeliveryMachine<O extends SoftwareDelivery | |||
goalSetters: Array<GoalSetter | GoalSetter[]>) { | |||
super(); | |||
// If we didn't get any goal setters don't register a mapping | |||
registrableManager().register(this); |
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.
what does the global __registrable do?
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 should be registerable
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.
This is a significant improvement.
@@ -268,6 +275,8 @@ export abstract class AbstractSoftwareDeliveryMachine<O extends SoftwareDelivery | |||
goalSetters: Array<GoalSetter | GoalSetter[]>) { | |||
super(); | |||
// If we didn't get any goal setters don't register a mapping | |||
registrableManager().register(this); |
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 should be registerable
Pull request auto merged by Atomist.
[atomist:generated] [auto-merge:on-approve] |
This PR brings infrastructure to create Typed Goals: goals that carry their own
ExecuteGoal
implementation. See Autofix for an example.The goal will find the SDM instances and register the goal implementations with it, so that from a user API all is left is to do:
This will allow us to provide a rich ecosystem of Goals for different types of delivery concerns without the requirement to change the core
SoftwareDeliveryMachine
API.The main changes in this PR are backwards compatible and only additive. Only exception is the move of the well-known-goals to sdm.