Skip to content
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

Add fetchGoalsFromPush method to read goals from subscription #559

Merged
merged 3 commits into from
Oct 25, 2018

Conversation

cdupuis
Copy link
Member

@cdupuis cdupuis commented Oct 25, 2018

No description provided.

@cdupuis cdupuis requested a review from ddgenome October 25, 2018 15:19
@cdupuis cdupuis added changelog:added Add this issue or pull request to added changelog section auto-merge:on-approve Auto-merge on review approvals labels Oct 25, 2018
[atomist:generated] [atomist:autofix=typescript header]
Copy link
Contributor

@ddgenome ddgenome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A couple questions.

@@ -35,6 +35,14 @@ import {
import { goalKeyString } from "./sdmGoal";
import { goalCorrespondsToSdmGoal } from "./storeGoals";

export function fetchGoalsFromPush(sdmGoal: SdmGoalEvent): SdmGoalEvent[] {
const goals = sumSdmGoalEvents((sdmGoal.push as any).goals.filter(g => g.goalSetId === sdmGoal.goalSetId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is sdmGoal.push not typed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is typed to a different type. Internally we are using subscription types but the API is using public SdmGoalEvent.

"description": "Build successful",
"goalSetId": "c2e95b8a-61a5-4474-95de-7d918d0b5478",
"preApproval": null,
"preCondit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's some push.

"description": "Build successful",
"goalSetId": "c2e95b8a-61a5-4474-95de-7d918d0b5478",
"preApproval": null,
"preCondit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"preCondit
assert(goals.every(g => g.push));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes no sense.

@@ -14,7 +14,7 @@
* limitations under the License.
*/

import assert = require("power-assert");
import * as assert from "power-assert";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaawww yeah

@cdupuis cdupuis added the auto-merge-method:squash Auto-merge with squash and merge label Oct 25, 2018
Copy link
Contributor

@ddgenome ddgenome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your consideration of my humble comments.

@atomist-bot atomist-bot merged commit 76f3e24 into master Oct 25, 2018
@atomist-bot
Copy link
Contributor

Pull request auto merged by Atomist.

  • 1 approved review by @ddgenome
  • 2 successful checks

[atomist:generated] [auto-merge:on-approve]

@atomist-bot atomist-bot deleted the goals-in-subscription branch October 25, 2018 15:56
atomist-bot added a commit that referenced this pull request Oct 25, 2018
[atomist:generated]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge:on-approve Auto-merge on review approvals auto-merge-method:squash Auto-merge with squash and merge changelog:added Add this issue or pull request to added changelog section
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants