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

fix(core/pipeline): fix type mismatch in pipeline trigger, broken webhook trigger #7018

Merged
merged 2 commits into from
May 17, 2019

Conversation

erikmunson
Copy link
Member

@erikmunson erikmunson commented May 17, 2019

few fixes for the new react-powered pipeline and webhook triggers:

  • the status chcecklist for for pipeline triggers wasn't transforming the Sets coming from Checklist to arrays, which got masked by the fact that the onUpdateTrigger method is typed with any. End result was that once a status was changed the underlying JSON was malformed and made the trigger component un-renderable on the next navigation to the same view
  • fixed up some minor things in PipelineTrigger like not triggering the destroy$ subject on unmount and not using the pre-existing status list if one existed
  • webhook triggers were un-renderable in all cases due to using a standard instance method instead of an arrow function

import { Application } from '@spinnaker/core';
import { Subject } from 'rxjs/Subject';

type IPipelineTriggerConfig = Omit<IPipelineTrigger, 'parentExecution' | 'parentPipelineId' | 'user' | 'rebake'>;
Copy link
Member Author

Choose a reason for hiding this comment

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

this was a maybe-temporary way of accurately typing what's really an acceptable input to onTriggerUpdated. I'd like to investigate how feasible having config-only trigger interfaces would be so we can use those in configs rather than the interfaces for triggers that show up in executions.


export interface IPipelineTriggerConfigProps {
status: string[];
trigger: IPipelineTrigger;
application: Application;
pipelineId: string;
triggerUpdated: (trigger: IPipelineTrigger) => void;
triggerUpdated: (trigger: IPipelineTriggerConfig) => void;
Copy link
Member Author

Choose a reason for hiding this comment

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

this is fine for now because the thing that passes in triggerUpdated is a vanilla JS file 🤷‍♂

Copy link
Contributor

@alanmquach alanmquach left a comment

Choose a reason for hiding this comment

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

Nice. Thanks for fixing this!

@erikmunson erikmunson merged commit 80af468 into spinnaker:master May 17, 2019
@erikmunson erikmunson deleted the fix-pipeline-trigger-status branch May 17, 2019 16:33
erikmunson added a commit to erikmunson/deck that referenced this pull request May 17, 2019
80af468 fix(core/pipeline): fix type mismatch in pipeline trigger, broken webhook trigger (spinnaker#7018)
53cb422 refactor(kubernetes): convert deploy manifest stage to react (spinnaker#7002)
96ac95a fix(artifacts): Artifacts are shown on pipeline execution when artifactsRewrite is enabled (spinnaker#6973)
5b6ad2a fix(core): Hide "Run as user" when using managed service users (spinnaker#7013)
erikmunson added a commit that referenced this pull request May 17, 2019
80af468 fix(core/pipeline): fix type mismatch in pipeline trigger, broken webhook trigger (#7018)
53cb422 refactor(kubernetes): convert deploy manifest stage to react (#7002)
96ac95a fix(artifacts): Artifacts are shown on pipeline execution when artifactsRewrite is enabled (#6973)
5b6ad2a fix(core): Hide "Run as user" when using managed service users (#7013)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants