@spinnaker/appengine 2026.4.0 → 2026.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ return F.createElement("div",null,/* @__PURE__ */F.createElement(i,{dismiss:e}),
7
7
  /* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-trash"}))))))),/* @__PURE__ */F.createElement("button",{className:"btn btn-block btn-sm add-new",onClick:this.addAllocation,type:"button"},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-plus-sign"})," Add allocation"),100!==this.allocationTotal()&&/* @__PURE__ */F.createElement("div",{className:"alert alert-warning"},"Traffic allocations must add up to 100%."))),/* @__PURE__ */F.createElement(l,{monitor:this.state.taskMonitor}),/* @__PURE__ */F.createElement(_.Footer,null,/* @__PURE__ */F.createElement("button",{className:"btn btn-default",onClick:()=>e(),type:"button"},"Cancel"),/* @__PURE__ */F.createElement("button",{className:"btn btn-primary",disabled:100!==this.allocationTotal(),onClick:this.submit,type:"button"},t?"Create":"Done")))}};Q.defaultProps={closeModal:n,dismissModal:n};let Z=Q;function ee(e){return"default"!==e.name}function te(e){const t=(e.serverGroups||[]).map(e=>e.name);return t.length?1===t.length?`<div class="alert alert-warning"><p>Deleting <b>${e.name}</b> will destroy <b>${t[0]}</b>.</p></div>`:`<div class="alert alert-warning"><p>Deleting <b>${e.name}</b> will destroy the following server groups:<ul>${t.map(e=>`<li>${e}</li>`).join("")}</ul></p></div>`:null}const ae=new URL("appengine.logoDdEgr2Bq.png",import.meta.url).href;class ne extends F.Component{constructor(e){super(e),this.destroy$=new V,this.setRegionList=e=>{const{application:t}=this.props,a=t=>!t||t.account===e;J(t.ready()).pipe(W(this.destroy$)).subscribe(()=>{const e=s.getRegions([t],a);e.sort(),this.setState({availableRegions:e})})},this.accountChanged=e=>{this.setRegionList(e)};const t=e.credentialsField||"credentials";this.state={availableRegions:[],cloudProvider:e.cloudProvider,componentName:e.componentName||"",credentialsField:t}}componentDidMount(){const{componentName:e,formik:t}=this.props,{credentialsField:a}=this.state,n=j(t.values,e?`${e}.${a}`:`${a}`,void 0);this.setRegionList(n)}componentWillUnmount(){this.destroy$.next()}render(){const{accounts:e}=this.props,{credentialsField:t,availableRegions:a,componentName:n}=this.state;/* @__PURE__ */
8
8
  return F.createElement("div",{className:"col-md-9"},/* @__PURE__ */F.createElement("div",{className:"sp-margin-m-bottom"},/* @__PURE__ */F.createElement(c,{name:n?`${n}.${t}`:`${t}`,label:"Account",input:t=>/* @__PURE__ */F.createElement(p,{...t,stringOptions:e&&e.map(e=>e.name),clearable:!1}),onChange:this.accountChanged,required:!0})),/* @__PURE__ */F.createElement("div",{className:"sp-margin-m-bottom"},/* @__PURE__ */F.createElement(c,{name:n?`${n}.region`:"region",label:"Region",input:e=>/* @__PURE__ */F.createElement(p,{...e,stringOptions:a,clearable:!1}),required:!0})))}}const re=class e extends F.Component{constructor(){super(...arguments),this.destroy$=new V,this.state={accounts:[]},this.onTemplateArtifactEdited=(e,t)=>{this.props.formik.setFieldValue(`${t}.id`,null),this.props.formik.setFieldValue(`${t}.artifact`,e),this.props.formik.setFieldValue(`${t}.account`,e.artifactAccount)},this.onTemplateArtifactSelected=(e,t)=>{this.props.formik.setFieldValue(`${t}.id`,e),this.props.formik.setFieldValue(`${t}.artifact`,null)},this.removeInputArtifact=e=>{this.props.formik.setFieldValue(e,null)},this.getInputArtifact=(e,t)=>e[t]?e[t]:{account:"",id:""}}componentDidMount(){J(m.listAccounts("appengine")).pipe(W(this.destroy$)).subscribe(e=>this.setState({accounts:e}))}render(){const t=this.props.formik.values,a=this.state.accounts;/* @__PURE__ */
9
9
  return F.createElement("div",null,/* @__PURE__ */F.createElement("div",{className:"col-md-offset-0 col-md-9"},/* @__PURE__ */F.createElement("h4",null,"Basic Settings")),/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement(ne,{componentName:"",accounts:a,application:this.props.application,cloudProvider:"appengine",credentialsField:"account",formik:this.props.formik})),/* @__PURE__ */F.createElement("div",{className:"col-md-offset-0 col-md-9"},/* @__PURE__ */F.createElement("h4",null,"Configuration Settings")),/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement("div",{className:"col-md-offset-1 col-md-9"},/* @__PURE__ */F.createElement(h,{artifact:this.getInputArtifact(t,"cronArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"cronArtifact").id,label:"Cron Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"cronArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"cronArtifact"),pipeline:this.props.pipeline,stage:t})),/* @__PURE__ */F.createElement("div",{className:"col-md-1"},/* @__PURE__ */F.createElement("div",{className:"form-control-static"},/* @__PURE__ */F.createElement("button",{onClick:()=>this.removeInputArtifact("cronArtifact")},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-trash"}),/* @__PURE__ */F.createElement("span",{className:"sr-only"},"Remove field"))))),/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement("div",{className:"col-md-offset-1 col-md-9"},/* @__PURE__ */F.createElement(h,{artifact:this.getInputArtifact(t,"dispatchArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"dispatchArtifact").id,label:"Dispatch Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"dispatchArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"dispatchArtifact"),pipeline:this.props.pipeline,stage:t})),/* @__PURE__ */F.createElement("div",{className:"col-md-1"},/* @__PURE__ */F.createElement("div",{className:"form-control-static"},/* @__PURE__ */F.createElement("button",{onClick:()=>this.removeInputArtifact("dispatchArtifact")},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-trash"}),/* @__PURE__ */F.createElement("span",{className:"sr-only"},"Remove field"))))),/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement("div",{className:"col-md-offset-1 col-md-9"},/* @__PURE__ */F.createElement(h,{artifact:this.getInputArtifact(t,"indexArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"indexArtifact").id,label:"Index Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"indexArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"indexArtifact"),pipeline:this.props.pipeline,stage:t})),/* @__PURE__ */F.createElement("div",{className:"col-md-1"},/* @__PURE__ */F.createElement("div",{className:"form-control-static"},/* @__PURE__ */F.createElement("button",{onClick:()=>this.removeInputArtifact("indexArtifact")},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-trash"}),/* @__PURE__ */F.createElement("span",{className:"sr-only"},"Remove field"))))),/* @__PURE__ */F.createElement("div",null,/* @__PURE__ */F.createElement("div",{className:"col-md-offset-1 col-md-9"},/* @__PURE__ */F.createElement(h,{artifact:this.getInputArtifact(t,"queueArtifact").artifact,excludedArtifactTypePatterns:e.excludedArtifactTypes,expectedArtifactId:this.getInputArtifact(t,"queueArtifact").id,label:"Queue Artifact",onArtifactEdited:e=>{this.onTemplateArtifactEdited(e,"queueArtifact")},helpKey:"",onExpectedArtifactSelected:e=>this.onTemplateArtifactSelected(e.id,"queueArtifact"),pipeline:this.props.pipeline,stage:t})),/* @__PURE__ */F.createElement("div",{className:"col-md-1"},/* @__PURE__ */F.createElement("div",{className:"form-control-static"},/* @__PURE__ */F.createElement("button",{onClick:()=>this.removeInputArtifact("queueArtifact")},/* @__PURE__ */F.createElement("span",{className:"glyphicon glyphicon-trash"}),/* @__PURE__ */F.createElement("span",{className:"sr-only"},"Remove field"))))))}};re.excludedArtifactTypes=d(u.BITBUCKET_FILE,u.CUSTOM_OBJECT,u.EMBEDDED_BASE64,u.GCS_OBJECT,u.GITHUB_FILE,u.GITLAB_FILE,u.S3_OBJECT,u.HTTP_FILE,u.ORACLE_OBJECT);let ie=re;function le(e){const t=new g(e);return t.field("account").required(),t.field("region").required(),t.validateForm()}v.pipeline.registerStage({label:"Deploy App Engine Configuration",description:"Deploy index, dispatch, cron, and queue configuration to App Engine.",key:"deployAppEngineConfiguration",component:function({application:e,pipeline:t,stage:a,updateStage:n}){const r=F.useMemo(()=>({...U(a)}),[]);/* @__PURE__ */
10
- return F.createElement(f,{application:e,onChange:n,pipeline:t,stage:r,validate:le,render:e=>/* @__PURE__ */F.createElement(ie,{...e})})},producesArtifacts:!1,cloudProvider:"appengine",executionDetailsSections:[b,E],validateFn:le});const oe=class{};oe.PLATFORM="App Engine Service";let se=oe;function ce(e,t){var a,n;e.cloudProvider="appengine",e.cloudProviderType="appengine",e.isNew&&(null==(a=null==t?void 0:t.attributes)?void 0:a.platformHealthOnlyShowOverride)&&(null==(n=null==t?void 0:t.attributes)?void 0:n.platformHealthOnly)&&(e.interestingHealthProviderNames=[se.PLATFORM])}function pe({application:e,pipeline:t,stage:a,updateStage:n,showHealthOverride:r=!1}){var i;const[l,o]=O([]);L(()=>{ce(a,e),m.listAccounts("appengine").then(t=>{var r;o(t);const i=a.credentials||(null==(r=null==e?void 0:e.defaultCredentials)?void 0:r.appengine),l=function(e,t){var a;return null==(a=e.find(e=>e.name===t))?void 0:a.region}(t,i);(i||l)&&(a.credentials=i||a.credentials,a.region=l||a.region,n(a))})},[]);/* @__PURE__ */
10
+ return F.createElement(f,{application:e,onChange:n,pipeline:t,stage:r,liveStage:a,validate:le,render:e=>/* @__PURE__ */F.createElement(ie,{...e})})},producesArtifacts:!1,cloudProvider:"appengine",executionDetailsSections:[b,E],validateFn:le});const oe=class{};oe.PLATFORM="App Engine Service";let se=oe;function ce(e,t){var a,n;e.cloudProvider="appengine",e.cloudProviderType="appengine",e.isNew&&(null==(a=null==t?void 0:t.attributes)?void 0:a.platformHealthOnlyShowOverride)&&(null==(n=null==t?void 0:t.attributes)?void 0:n.platformHealthOnly)&&(e.interestingHealthProviderNames=[se.PLATFORM])}function pe({application:e,pipeline:t,stage:a,updateStage:n,showHealthOverride:r=!1}){var i;const[l,o]=O([]);L(()=>{ce(a,e),m.listAccounts("appengine").then(t=>{var r;o(t);const i=a.credentials||(null==(r=null==e?void 0:e.defaultCredentials)?void 0:r.appengine),l=function(e,t){var a;return null==(a=e.find(e=>e.name===t))?void 0:a.region}(t,i);(i||l)&&(a.credentials=i||a.credentials,a.region=l||a.region,n(a))})},[]);/* @__PURE__ */
11
11
  return F.createElement("div",{className:"form-horizontal"},!(null==t?void 0:t.strategy)&&/* @__PURE__ */F.createElement(y,{accounts:l,application:e,component:a,disableRegionSelect:!0,onAccountUpdate:e=>{m.getAccountDetails(e).then(e=>{a.region=(null==e?void 0:e.region)||a.region,n(a)})},onComponentUpdate:n,singleRegion:"true"}),/* @__PURE__ */F.createElement(A,{label:"Target"},/* @__PURE__ */F.createElement(S,{model:{target:a.target},onChange:e=>{a.target=e,n(a)},options:N.TARGET_LIST})),r&&(null==(i=null==e?void 0:e.attributes)?void 0:i.platformHealthOnlyShowOverride)&&/* @__PURE__ */F.createElement(k,{interestingHealthProviderNames:a.interestingHealthProviderNames||[],onChange:e=>{a.interestingHealthProviderNames=e,n(a)},platformHealthType:se.PLATFORM}))}function de(e){/* @__PURE__ */
12
12
  return F.createElement(pe,{...e,showHealthOverride:!0})}function ue({stage:e}){var t,a,n,r;const i=(null==(n=null==(a=null==(t=e.context)?void 0:t.exception)?void 0:a.details)?void 0:n.errors)||(null==(r=e.context)?void 0:r.failureMessages)||[];return i.length?/* @__PURE__ */F.createElement("div",{className:"alert alert-danger"},i.map((e,t)=>/* @__PURE__ */F.createElement("p",{key:t},e))):null}function me(e){const{stage:t}=e;/* @__PURE__ */
13
13
  return F.createElement("div",null,/* @__PURE__ */F.createElement("dl",{className:"dl-horizontal dl-narrow"},/* @__PURE__ */F.createElement("dt",null,"Account"),/* @__PURE__ */F.createElement("dd",null,t.context.credentials||t.context.account),/* @__PURE__ */F.createElement("dt",null,"Region"),/* @__PURE__ */F.createElement("dd",null,t.context.region),/* @__PURE__ */F.createElement("dt",null,t.context.cluster?"Cluster":"Server Group"),/* @__PURE__ */F.createElement("dd",null,(a=t.context).cluster||a.serverGroupName),t.context.target&&[
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","mappings":";onCAEqB,CACnB,CACEA,IAAK,0CACLC,MAAO,6MAGT,CACED,IAAK,0CACLC,MAAO,oLAGT,CACED,IAAK,0CACLC,MAAO,qLAGT,CACED,IAAK,+BACLC,MAAO,sFAET,CACED,IAAK,iDACLC,MAAO,qOAIT,CACED,IAAK,wCACLC,MAAO,gTAIT,CACED,IAAK,oCACLC,MAAO,sfAMT,CACED,IAAK,4CACLC,MAAO,mYAMT,CACED,IAAK,2CACLC,MAAO,8SAIT,CACED,IAAK,gCACLC,MAAO,0EAET,CACED,IAAK,4CACLC,MAAO,gTAIT,CACED,IAAK,0CACLC,MAAO,4KAGT,CACED,IAAK,gDACLC,MAAO,mlBAOT,CACED,IAAK,wCACLC,MACE,2IAEJ,CACED,IAAK,oCACLC,MAAO,yFAET,CACED,IAAK,wCACLC,MAAO,8VAKT,CACED,IAAK,qCACLC,MAAO,uEAET,CACED,IAAK,qCACLC,MAAO,qIAGT,CACED,IAAK,kCACLC,MAAO,qhBAWT,CACED,IAAK,oCACLC,MAAO,yDAET,CACED,IAAK,8BACLC,MAAO,4DAET,CACED,IAAK,yBACLC,MAAO,oDAET,CACED,IAAK,4BACLC,MAAO,qDAET,CACED,IAAK,8BACLC,MAAO,wDAIEC,QAASC,GAAUC,EAAqBC,SAASF,EAAMH,IAAKG,EAAMF,QCnHxE,MAAMK,EAYX,mDAAcC,CACZC,GAEA,MAAMC,EAAyBC,EAC7BF,EAAMG,YACN,CAACC,EAAwCC,EAAoBC,IACpDF,EAAIG,OAAO,CAAED,kBAAiBD,aAAYG,YAAa,iBAEhE,IAGF,MAAO,CAAEC,QAAST,EAAMS,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MAAmB,IAAbrB,GAAqB,GAAG,SAQxD,GLUI+b,wBAAyB9V,GAE3B+V,KAAM,CACJC,KAAMD,MAIVE,EAA2B3E,iBAAiB,YAAa,CAAC","names":["key","value","forEach","entry","HelpContentsRegistry","register","AppengineLoadBalancerUpsertDescription","convertTrafficSplitToTrafficSplitDescription","split","allocationDescriptions","reduce","allocations","acc","allocation","serverGroupName","concat","locatorType","shardBy","constructor","loadBalancer","this","credentials","account","cloudProvider","loadBalancerName","name","region","migrateTraffic","serverGroups","mapAllocationsToDecimals","splitDescription","description","mapAllocationsToPercentages","Math","round","TARGET_OPTIONS","label","_AppengineCreateLoadBalancerModal","React","Component","super","arguments","state","taskMonitor","TaskMonitor","application","props","app","title","onDismiss","dismissModal","onTaskComplete","getDataSource","refresh","command","buildInitialCommand","update","field","forceUpdate","updateSplit","updateAllocation","index","updateAllocationLocatorType","updated","target","cluster","addAllocation","push","forPipelineConfig","length","removeAllocation","splice","allocationTotal","sum","Number","submit","cloneDeep","closeModal","LoadBalancerWriter","upsertLoadBalancer","show","ReactModal","dialogClassName","slice","map","serverGroup","renderAllocationTarget","createElement","className","checked","onChange","type","event","placeholder","render","isNew","ModalClose","dismiss","Modal","Header","Title","Body","min","onClick","TaskMonitorWrapper","monitor","Footer","disabled","defaultProps","noop","AppengineCreateLoadBalancerModal","canDeleteAppengineLoadBalancer","getDeleteLoadBalancerWarning","serverGroupNames","join","FormikAccountRegionSelector","destroy$","Subject","setRegionList","accountFilter","observableFrom","ready","pipe","takeUntil","subscribe","availableRegions","AppListExtractor","getRegions","sort","setState","accountChanged","credentialsField","componentName","componentDidMount","formik","get","values","componentWillUnmount","next","accounts","FormikFormField","input","ReactSelectInput","stringOptions","clearable","required","_DeployAppengineConfigForm","onTemplateArtifactEdited","artifact","setFieldValue","artifactAccount","onTemplateArtifactSelected","id","removeInputArtifact","getInputArtifact","stage","AccountService","listAccounts","StageArtifactSelectorDelegate","excludedArtifactTypePatterns","excludedArtifactTypes","expectedArtifactId","onArtifactEdited","helpKey","onExpectedArtifactSelected","pipeline","excludeAllTypesExcept","ArtifactTypePatterns","BITBUCKET_FILE","CUSTOM_OBJECT","EMBEDDED_BASE64","GCS_OBJECT","GITHUB_FILE","GITLAB_FILE","S3_OBJECT","HTTP_FILE","ORACLE_OBJECT","DeployAppengineConfigForm","validateDeployAppengineConfigurationStage","formValidator","FormValidator","validateForm","Registry","registerStage","component","updateStage","stageWithDefaults","useMemo","FormikStageConfig","validate","producesArtifacts","executionDetailsSections","ExecutionDetailsTasks","ExecutionArtifactTab","validateFn","_AppengineHealth","PLATFORM","AppengineHealth","initializeAppengineServerGroupStage","cloudProviderType","_a","attributes","platformHealthOnlyShowOverride","_b","platformHealthOnly","interestingHealthProviderNames","AppengineServerGroupStageConfig","showHealthOverride","setAccounts","useState","useEffect","then","loadedAccounts","defaultCredentials","appengine","find","getAppengineAccountRegion","strategy","AccountRegionClusterSelector","disableRegionSelect","onAccountUpdate","getAccountDetails","accountDetails","onComponentUpdate","singleRegion","StageConfigField","TargetSelect","model","options","StageConstants","TARGET_LIST","PlatformHealthOverride","platformHealthType","AppengineServerGroupStageConfigWithHealthOverride","FailureMessages","failures","_c","context","exception","details","errors","_d","failureMessages","message","ServerGroupConfigDetails","AppengineStartServerGroupExecutionDetails","ExecutionDetailsSection","current","AppengineStopServerGroupExecutionDetails","AppengineEditLoadBalancerExecutionDetails","loadBalancers","provides","validators","fieldName","fieldLabel","setLoadBalancers","catch","editLoadBalancer","filter","_loadBalancer","i","removeLoadBalancer","colSpan","shrinkToSize","allowDeleteActive","retainLargerOverNewer","toString","style","width","AppengineProviderSettings","SETTINGS","providers","defaults","resetToOriginal","resetProvider","AppengineSourceType","AppengineServerGroupCommandBuilder","getTriggerOptions","triggers","trigger","source","project","slug","branch","master","job","getExpectedArtifacts","expectedArtifacts","buildNewServerGroupCommand","selectedProvider","mode","dataToFetch","getAllAccountDetailsForProvider","storageAccounts","StorageAccountReader","getStorageAccounts","viewState","submitButtonLabel","getSubmitButtonLabel","disableStrategySelection","resolveAll","backingData","getCredentials","getRegion","fromArtifact","configArtifacts","configFilepaths","configFiles","sourceType","buildServerGroupCommandFromExisting","stack","freeFormDetails","detail","buildNewServerGroupCommandForPipeline","_stage","Promise","resolve","triggerOptions","buildServerGroupCommandFromPipeline","accountNames","includes","_account","entries","Object","all","promise","result","AppengineDeployDescription","provider","repositoryUrl","promote","stopPreviousVersion","strategyApplication","strategyPipeline","fromTrigger","gitCredentialType","a","applicationDirectoryRoot","expectedArtifact","storageAccountName","containerImageUrl","suppressVersionString","AppengineServerGroupWriter","cloneServerGroup","TaskExecutor","executeTask","startServerGroup","buildJob","stopServerGroup","enableServerGroup","params","disableServerGroup","destroyServerGroup","writer","_AppengineCloneServerGroupModal","GIT","normalizeAppengineServerGroupCommandForSubmit","AppengineCloneServerGroupModal","commandBuilder","canStartOrStopServerGroup","env","scalingPolicy","canStartServerGroup","servingStatus","canStopServerGroup","expectedAllocationsAfterDisableOperation","toCheck","keys","denominator","precision","canDisableServerGroup","canDestroyServerGroup","buildExpectedAllocationsTable","expectedAllocations","platformHealthParams","getDisableBody","getDestroyBody","body","ServerGroupWarningMessageService","addDestroyWarningMessage","ApplicationNameValidator","registerValidator","warnings","validateSpecialCharacters","validateLength","test","remaining","CloudProviderRegistry","registerProvider","instance","instanceId","transformer","normalizeServerGroup","convertServerGroupCommandToDeployConfiguration","detailsActions","appengineServerGroup","call","data","getLoadBalancers","ConfirmationModalService","confirm","header","buttonText","taskMonitorConfig","submitMethod","askForReason","detailsGetter","autoClose","serverGroupInfo","Observable","observer","summary","candidate","accountId","some","extractServerGroupSummary","ServerGroupReader","getServerGroup","assign","isEmpty","detailsSections","status","CloneServerGroupModal","skipUpstreamStageCheck","normalizeLoadBalancer","instanceCounts","buildInstanceCounts","instances","detachedInstances","transformInstance","activeServerGroups","isDisabled","chain","flatten","convertLoadBalancerForEditing","upToDateLoadBalancer","convertLoadBalancerToUpsertDescription","has","camelCase","health","up","down","outOfService","succeeded","failed","starting","unknown","healthState","useDetailsHook","loadBalancerParams","setData","loading","setLoading","refetch","async","unsubscribe","onRefresh","error","deleteLoadBalancer","appengineLoadBalancer","CreateLoadBalancerModal","logo","path","DeploymentStrategyRegistry"],"ignoreList":[],"sources":["../src/helpContents/appengineHelpContents.ts","../src/loadBalancer/transformer.ts","../src/loadBalancer/configure/AppengineCreateLoadBalancerModal.tsx","../src/loadBalancer/details/AppengineLoadBalancerActions.tsx","../src/common/FormikAccountRegionSelector.tsx","../src/pipeline/stages/deployAppengineConfig/DeployAppengineConfigForm.tsx","../src/pipeline/stages/deployAppengineConfig/DeployAppengineConfigurationConfig.tsx","../src/pipeline/stages/deployAppengineConfig/deployAppengineConfigStage.ts","../src/common/appengineHealth.ts","../src/pipeline/stages/AppengineServerGroupStageConfig.tsx","../src/pipeline/stages/AppengineExecutionDetails.tsx","../src/pipeline/stages/destroyAsg/appengineDestroyAsgStage.ts","../src/pipeline/stages/disableAsg/appengineDisableAsgStage.ts","../src/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.ts","../src/pipeline/stages/editLoadBalancer/AppengineEditLoadBalancerStageConfig.tsx","../src/pipeline/stages/enableAsg/appengineEnableAsgStage.ts","../src/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.ts","../src/pipeline/stages/startServerGroup/appengineStartServerGroupStage.ts","../src/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.ts","../src/appengine.settings.ts","../src/serverGroup/configure/serverGroupCommandBuilder.service.ts","../src/serverGroup/transformer.ts","../src/serverGroup/writer/serverGroup.write.service.ts","../src/serverGroup/configure/wizard/AppengineCloneServerGroupModal.tsx","../src/serverGroup/details/AppengineServerGroupActions.tsx","../src/validation/ApplicationNameValidator.ts","../src/appengine.module.ts","../src/instance/details/AppengineInstanceDetails.tsx","../src/serverGroup/details/appengineServerGroupDetailsGetter.ts","../src/serverGroup/details/AppengineServerGroupDetailsSection.tsx","../src/loadBalancer/details/useAppengineLoadBalancerDetails.ts","../src/loadBalancer/details/AppengineLoadBalancerDetailsSection.tsx"],"sourcesContent":["import { HelpContentsRegistry } from '@spinnaker/core';\n\nconst helpContents = [\n {\n key: 'appengine.serverGroup.gcs.repositoryUrl',\n value: `The full URL to the GCS bucket or TAR file containing the source files for this deployment,\n including 'gs://'. For example, <b>gs://my-bucket/my-app</b> or <b>gs://my-bucket/app.tar</b>.`,\n },\n {\n key: 'appengine.serverGroup.git.repositoryUrl',\n value: `The full URL to the git repository containing the source files for this deployment,\n including protocol. For example, <b>https://github.com/spinnaker/deck.git</b>`,\n },\n {\n key: 'appengine.serverGroup.gitCredentialType',\n value: `The credential type that will be used to access the git repository for this deployment.\n You can configure these credentials alongside your App Engine credentials.`,\n },\n {\n key: 'appengine.serverGroup.branch',\n value: 'The name of the branch in the above git repository to be used for this deployment.',\n },\n {\n key: 'appengine.serverGroup.applicationDirectoryRoot',\n value: `(Optional) Path to the directory root of the application to be deployed,\n starting from the root of the git repository. This is the directory from which\n <code>gcloud app deploy</code> will be run.`,\n },\n {\n key: 'appengine.serverGroup.configFilepaths',\n value: `Paths to App Engine application configuration files, starting from the application directory root,\n specified above. In most cases, this will be <code>app.yaml</code> or <code>cron.yaml</code>,\n but could be <code>path/to/app.yaml</code> or <code>path/to/cron.yaml</code>.`,\n },\n {\n key: 'appengine.serverGroup.configFiles',\n value: `<p>(Optional) The contents of an App Engine config file (e.g., an <code>app.yaml</code> or\n <code>cron.yaml</code> file). These files should not conflict with the config filepaths above:\n if you include, for example, the contents of an <code>app.yaml</code>\n file here, you should <b>not</b> specify the file path to an <code>app.yaml</code> above.<br></p>\n <p>If this is a pipeline stage, you can use Spinnaker Pipeline Expressions here.</p>`,\n },\n {\n key: 'appengine.serverGroup.configFilesRequired',\n value: `<p>The contents of an App Engine config file (e.g., an <code>app.yaml</code> or\n <code>cron.yaml</code> file).</p>\n <p>An <code>app.yaml</code> file is required and must have <code>runtime: custom</code> in\n order to deploy successfully.</p>\n <p>If this is a pipeline stage, you can use Spinnaker Pipeline Expressions here.</p>`,\n },\n {\n key: 'appengine.serverGroup.matchBranchOnRegex',\n value: `(Optional) A Jenkins trigger may produce details from multiple repositories and branches.\n Spinnaker will use the regex specified here to help resolve a branch for the deployment.\n If Spinnaker cannot resolve exactly one branch from the trigger, this pipeline will fail.`,\n },\n {\n key: 'appengine.serverGroup.promote',\n value: 'If selected, the newly deployed server group will receive all traffic.',\n },\n {\n key: 'appengine.serverGroup.stopPreviousVersion',\n value: `If selected, the previously running server group in this server group's <b>service</b>\n (Spinnaker load balancer) will be stopped. This option will be respected only if this server group will\n be receiving all traffic and the previous server group is using manual scaling.`,\n },\n {\n key: 'appengine.serverGroup.containerImageUrl',\n value: `The full URL to the container image to use for deployment. The URL must be one of the valid GCR hostnames,\n for example <b>gcr.io/my-project/image:tag</b>`,\n },\n {\n key: 'appengine.serverGroup.suppress-version-string',\n value: `Spinnaker automatically versions your server groups. This means deployments through Spinnaker receive a\n short version string at the end of their name, like \"v001\". In most cases you will want to keep this\n version as part of the name. Preventing this string from being added to your server group will stop\n it from being considered when rolling back, promoting new versions or executing deployment strategies.\n If you are certain that you do not want the version string applied to this server group then check\n this box.`,\n },\n {\n key: 'appengine.loadBalancer.shardBy.cookie',\n value:\n 'Diversion based on a specially named cookie, \"GOOGAPPUID.\" The cookie must be set by the application itself or no diversion will occur.',\n },\n {\n key: 'appengine.loadBalancer.shardBy.ip',\n value: 'Diversion based on applying the modulus operation to a fingerprint of the IP address.',\n },\n {\n key: 'appengine.loadBalancer.migrateTraffic',\n value: `If selected, traffic will be gradually shifted to a single version. For gradual traffic migration,\n the target version must be located within instances that are configured for\n both warmup requests and automatic scaling.\n Gradual traffic migration is not supported in the App Engine flexible environment.`,\n },\n {\n key: 'appengine.loadBalancer.allocations',\n value: 'An allocation is the percent of traffic directed to a server group.',\n },\n {\n key: 'appengine.loadBalancer.textLocator',\n value: `Either the name of a server group, or a Spinnaker Pipeline Expression\n that resolves to the name of a server group.`,\n },\n {\n key: 'appengine.instance.availability',\n value: `\n An instance's <b>availability</b> is determined by its version (Spinnaker server group).\n <ul>\n <li>Manual scaling versions use resident instances</li>\n <li>Basic scaling versions use dynamic instances</li>\n <li>Auto scaling versions use dynamic instances - but if you specify a number, N,\n of minimum idle instances, the first N instances will be resident,\n and additional dynamic instances will be created as necessary.\n </li>\n </ul>`,\n },\n {\n key: 'appengine.instance.averageLatency',\n value: 'Average latency over the last minute in milliseconds.',\n },\n {\n key: 'appengine.instance.vmStatus',\n value: 'Status of the virtual machine where this instance lives.',\n },\n {\n key: 'appengine.instance.qps',\n value: 'Average queries per second over the last minute.',\n },\n {\n key: 'appengine.instance.errors',\n value: 'Number of errors since this instance was started.',\n },\n {\n key: 'appengine.instance.requests',\n value: 'Number of requests since this instance was started.',\n },\n];\n\nhelpContents.forEach((entry) => HelpContentsRegistry.register(entry.key, entry.value));\n","import { camelCase, chain, cloneDeep, filter, get, has, reduce } from 'lodash';\n\nimport type {\n Application,\n IInstance,\n IInstanceCounts,\n ILoadBalancer,\n ILoadBalancerUpsertCommand,\n IServerGroup,\n} from '@spinnaker/core';\nimport type { IAppengineLoadBalancer, IAppengineTrafficSplit, ShardBy } from '../domain/index';\n\nexport interface IAppengineAllocationDescription {\n serverGroupName?: string;\n target?: string;\n cluster?: string;\n allocation: number;\n locatorType: 'fromExisting' | 'targetCoordinate' | 'text';\n}\n\nexport interface IAppengineTrafficSplitDescription {\n shardBy: ShardBy;\n allocationDescriptions: IAppengineAllocationDescription[];\n}\n\nexport class AppengineLoadBalancerUpsertDescription implements ILoadBalancerUpsertCommand, IAppengineLoadBalancer {\n public credentials: string;\n public account: string;\n public loadBalancerName: string;\n public name: string;\n public splitDescription: IAppengineTrafficSplitDescription;\n public split?: IAppengineTrafficSplit;\n public migrateTraffic: boolean;\n public region: string;\n public cloudProvider: string;\n public serverGroups?: any[];\n\n public static convertTrafficSplitToTrafficSplitDescription(\n split: IAppengineTrafficSplit,\n ): IAppengineTrafficSplitDescription {\n const allocationDescriptions = reduce(\n split.allocations,\n (acc: IAppengineAllocationDescription[], allocation: number, serverGroupName: string) => {\n return acc.concat({ serverGroupName, allocation, locatorType: 'fromExisting' });\n },\n [],\n );\n\n return { shardBy: split.shardBy, allocationDescriptions };\n }\n\n constructor(loadBalancer: IAppengineLoadBalancer) {\n this.credentials = loadBalancer.account || loadBalancer.credentials;\n this.account = this.credentials;\n this.cloudProvider = loadBalancer.cloudProvider;\n this.loadBalancerName = loadBalancer.name;\n this.name = loadBalancer.name;\n this.region = loadBalancer.region;\n this.migrateTraffic = loadBalancer.migrateTraffic || false;\n this.serverGroups = loadBalancer.serverGroups;\n }\n\n public mapAllocationsToDecimals() {\n this.splitDescription.allocationDescriptions.forEach((description) => {\n description.allocation = description.allocation / 100;\n });\n }\n\n public mapAllocationsToPercentages() {\n this.splitDescription.allocationDescriptions.forEach((description) => {\n // An allocation percent has at most one decimal place.\n description.allocation = Math.round(description.allocation * 1000) / 10;\n });\n }\n}\n\nexport class AppengineLoadBalancerTransformer {\n public normalizeLoadBalancer(loadBalancer: ILoadBalancer): Promise<ILoadBalancer> {\n loadBalancer.provider = loadBalancer.type;\n loadBalancer.instanceCounts = this.buildInstanceCounts(loadBalancer.serverGroups);\n loadBalancer.instances = [];\n loadBalancer.serverGroups.forEach((serverGroup) => {\n serverGroup.account = loadBalancer.account;\n serverGroup.region = loadBalancer.region;\n\n if (serverGroup.detachedInstances) {\n serverGroup.detachedInstances = (serverGroup.detachedInstances as any).map((id: string) => ({ id }));\n }\n serverGroup.instances = serverGroup.instances\n .concat(serverGroup.detachedInstances || [])\n .map((instance: any) => this.transformInstance(instance, loadBalancer));\n });\n\n const activeServerGroups = filter(loadBalancer.serverGroups, { isDisabled: false });\n loadBalancer.instances = chain(activeServerGroups).map('instances').flatten().value() as IInstance[];\n return Promise.resolve(loadBalancer);\n }\n\n public convertLoadBalancerForEditing(\n loadBalancer: IAppengineLoadBalancer,\n application: Application,\n ): Promise<IAppengineLoadBalancer> {\n return application\n .getDataSource('loadBalancers')\n .ready()\n .then(() => {\n const upToDateLoadBalancer = application\n .getDataSource('loadBalancers')\n .data.find((candidate: ILoadBalancer) => {\n return (\n candidate.name === loadBalancer.name &&\n (candidate.account === loadBalancer.account || candidate.account === loadBalancer.credentials)\n );\n });\n\n if (upToDateLoadBalancer) {\n loadBalancer.serverGroups = cloneDeep(upToDateLoadBalancer.serverGroups);\n }\n return loadBalancer;\n });\n }\n\n public convertLoadBalancerToUpsertDescription(\n loadBalancer: IAppengineLoadBalancer,\n ): AppengineLoadBalancerUpsertDescription {\n return new AppengineLoadBalancerUpsertDescription(loadBalancer);\n }\n\n private buildInstanceCounts(serverGroups: IServerGroup[]): IInstanceCounts {\n const instanceCounts: IInstanceCounts = chain(serverGroups)\n .map('instances')\n .flatten()\n .reduce(\n (acc: IInstanceCounts, instance: any) => {\n if (has(instance, 'health.state')) {\n acc[camelCase(instance.health.state)]++;\n }\n return acc;\n },\n { up: 0, down: 0, outOfService: 0, succeeded: 0, failed: 0, starting: 0, unknown: 0 },\n )\n .value();\n\n instanceCounts.outOfService += chain(serverGroups).map('detachedInstances').flatten().value().length;\n return instanceCounts;\n }\n\n private transformInstance(instance: any, loadBalancer: ILoadBalancer) {\n instance.provider = loadBalancer.type;\n instance.account = loadBalancer.account;\n instance.region = loadBalancer.region;\n instance.loadBalancers = [loadBalancer.name];\n const health = instance.health || {};\n instance.healthState = get(instance, 'health.state') || 'OutOfService';\n instance.health = [health];\n\n return instance as IInstance;\n }\n}\n","import { cloneDeep } from 'lodash';\nimport React from 'react';\nimport { Modal } from 'react-bootstrap';\n\nimport type { ILoadBalancerModalProps } from '@spinnaker/core';\nimport { LoadBalancerWriter, ModalClose, noop, ReactModal, TaskMonitor, TaskMonitorWrapper } from '@spinnaker/core';\n\nimport type { IAppengineLoadBalancer } from '../../domain';\nimport type { IAppengineAllocationDescription } from '../transformer';\nimport { AppengineLoadBalancerUpsertDescription } from '../transformer';\n\nconst TARGET_OPTIONS = [\n { label: 'Current Server Group', value: 'current_asg_dynamic' },\n { label: 'Previous Server Group', value: 'ancestor_asg_dynamic' },\n { label: 'Oldest Server Group', value: 'oldest_asg_dynamic' },\n];\n\nexport function updateAllocationLocatorType(\n allocation: IAppengineAllocationDescription,\n locatorType: IAppengineAllocationDescription['locatorType'],\n): IAppengineAllocationDescription {\n const updated = { ...allocation, locatorType };\n if (locatorType === 'targetCoordinate') {\n delete updated.serverGroupName;\n updated.target = updated.target || TARGET_OPTIONS[0].value;\n } else {\n delete updated.cluster;\n delete updated.target;\n }\n return updated;\n}\n\ninterface IAppengineCreateLoadBalancerModalState {\n taskMonitor: TaskMonitor;\n}\n\nexport class AppengineCreateLoadBalancerModal extends React.Component<\n ILoadBalancerModalProps,\n IAppengineCreateLoadBalancerModalState\n> {\n public static defaultProps: Partial<ILoadBalancerModalProps> = {\n closeModal: noop,\n dismissModal: noop,\n };\n\n public static show(props: ILoadBalancerModalProps & { isNew?: boolean }): Promise<IAppengineLoadBalancer> {\n return ReactModal.show(AppengineCreateLoadBalancerModal, props, { dialogClassName: 'modal-lg' });\n }\n\n public state: IAppengineCreateLoadBalancerModalState = {\n taskMonitor: new TaskMonitor({\n application: this.props.app,\n title: 'Updating your load balancer',\n onDismiss: () => this.props.dismissModal(),\n onTaskComplete: () => this.props.app.getDataSource('loadBalancers').refresh(),\n }),\n };\n\n private command: AppengineLoadBalancerUpsertDescription = this.buildInitialCommand();\n\n private buildInitialCommand(): AppengineLoadBalancerUpsertDescription {\n const loadBalancer = (this.props.loadBalancer || {}) as IAppengineLoadBalancer;\n const command = new AppengineLoadBalancerUpsertDescription({\n ...loadBalancer,\n account: loadBalancer.account || loadBalancer.credentials,\n credentials: loadBalancer.credentials || loadBalancer.account,\n name: loadBalancer.name,\n region: loadBalancer.region,\n serverGroups: loadBalancer.serverGroups || [],\n cloudProvider: 'appengine',\n migrateTraffic: loadBalancer.migrateTraffic || false,\n } as IAppengineLoadBalancer);\n\n command.splitDescription = loadBalancer.splitDescription ||\n (loadBalancer.split &&\n AppengineLoadBalancerUpsertDescription.convertTrafficSplitToTrafficSplitDescription(loadBalancer.split)) || {\n shardBy: 'UNSPECIFIED',\n allocationDescriptions: (loadBalancer.serverGroups || []).slice(0, 1).map((serverGroup) => ({\n allocation: 100,\n locatorType: 'fromExisting',\n serverGroupName: serverGroup.name,\n })),\n };\n command.mapAllocationsToPercentages();\n\n return command;\n }\n\n private update = (field: keyof IAppengineLoadBalancer, value: any) => {\n (this.command as any)[field] = value;\n this.forceUpdate();\n };\n\n private updateSplit = (field: string, value: any) => {\n (this.command.splitDescription as any)[field] = value;\n this.forceUpdate();\n };\n\n private updateAllocation = (index: number, field: string, value: any) => {\n (this.command.splitDescription.allocationDescriptions[index] as any)[field] = value;\n this.forceUpdate();\n };\n\n private updateAllocationLocatorType = (\n index: number,\n locatorType: IAppengineAllocationDescription['locatorType'],\n ) => {\n this.command.splitDescription.allocationDescriptions[index] = updateAllocationLocatorType(\n this.command.splitDescription.allocationDescriptions[index],\n locatorType,\n );\n this.forceUpdate();\n };\n\n private addAllocation = () => {\n this.command.splitDescription.allocationDescriptions.push({\n allocation: 0,\n locatorType: this.props.forPipelineConfig ? 'text' : 'fromExisting',\n serverGroupName: '',\n });\n if (this.command.splitDescription.allocationDescriptions.length > 1 && !this.command.splitDescription.shardBy) {\n this.command.splitDescription.shardBy = 'IP';\n }\n this.forceUpdate();\n };\n\n private removeAllocation = (index: number) => {\n this.command.splitDescription.allocationDescriptions.splice(index, 1);\n this.forceUpdate();\n };\n\n private allocationTotal = () => {\n return this.command.splitDescription.allocationDescriptions.reduce((sum, description) => {\n return sum + Number(description.allocation || 0);\n }, 0);\n };\n\n private submit = () => {\n const description = cloneDeep(this.command);\n description.mapAllocationsToDecimals();\n delete description.serverGroups;\n\n if (this.props.forPipelineConfig) {\n this.props.closeModal(description as any);\n return;\n }\n\n this.state.taskMonitor.submit(() => LoadBalancerWriter.upsertLoadBalancer(description, this.props.app, 'Update'));\n };\n\n private renderAllocationTarget(allocation: IAppengineAllocationDescription, index: number) {\n if (!this.props.forPipelineConfig) {\n return (\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.updateAllocation(index, 'serverGroupName', event.target.value)}\n value={allocation.serverGroupName || ''}\n />\n );\n }\n\n return (\n <div>\n <div className=\"radio\">\n <label>\n <input\n checked={allocation.locatorType === 'text'}\n onChange={() => this.updateAllocationLocatorType(index, 'text')}\n type=\"radio\"\n />{' '}\n Text input\n </label>\n </div>\n <div className=\"radio\">\n <label>\n <input\n checked={allocation.locatorType === 'targetCoordinate'}\n onChange={() => this.updateAllocationLocatorType(index, 'targetCoordinate')}\n type=\"radio\"\n />{' '}\n Target coordinate\n </label>\n </div>\n <div className=\"radio\">\n <label>\n <input\n checked={allocation.locatorType === 'fromExisting'}\n onChange={() => this.updateAllocationLocatorType(index, 'fromExisting')}\n type=\"radio\"\n />{' '}\n Existing server group\n </label>\n </div>\n {allocation.locatorType === 'targetCoordinate' ? (\n <div>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.updateAllocation(index, 'cluster', event.target.value)}\n placeholder=\"Cluster\"\n value={allocation.cluster || ''}\n />\n <select\n className=\"form-control input-sm\"\n onChange={(event) => this.updateAllocation(index, 'target', event.target.value)}\n value={allocation.target || TARGET_OPTIONS[0].value}\n >\n {TARGET_OPTIONS.map((target) => (\n <option key={target.value} value={target.value}>\n {target.label}\n </option>\n ))}\n </select>\n </div>\n ) : (\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.updateAllocation(index, 'serverGroupName', event.target.value)}\n placeholder={allocation.locatorType === 'text' ? 'Server group expression or name' : 'Server group'}\n value={allocation.serverGroupName || ''}\n />\n )}\n </div>\n );\n }\n\n public render() {\n const { dismissModal, isNew } = this.props as ILoadBalancerModalProps & { isNew?: boolean };\n\n return (\n <div>\n <ModalClose dismiss={dismissModal} />\n <Modal.Header>\n <Modal.Title>{isNew ? 'Create' : 'Edit'} App Engine Load Balancer</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <div className=\"form-horizontal\">\n <label>Name</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.update('name', event.target.value)}\n value={this.command.name || ''}\n />\n <label>Account</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => {\n this.update('credentials', event.target.value);\n this.update('account', event.target.value);\n }}\n value={this.command.credentials || this.command.account || ''}\n />\n <label>Region</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.update('region', event.target.value)}\n value={this.command.region || ''}\n />\n <div className=\"checkbox\">\n <label>\n <input\n checked={!!this.command.migrateTraffic}\n onChange={(event) => this.update('migrateTraffic', event.target.checked)}\n type=\"checkbox\"\n />{' '}\n Migrate traffic\n </label>\n </div>\n {(this.command.splitDescription.allocationDescriptions.length > 1 || this.command.migrateTraffic) && (\n <div>\n <label>Shard By</label>\n <select\n className=\"form-control input-sm\"\n onChange={(event) => this.updateSplit('shardBy', event.target.value)}\n value={this.command.splitDescription.shardBy || 'UNSPECIFIED'}\n >\n <option value=\"UNSPECIFIED\">Unspecified</option>\n <option value=\"IP\">IP</option>\n <option value=\"COOKIE\">Cookie</option>\n </select>\n </div>\n )}\n <label>Allocations</label>\n <table className=\"table table-condensed\">\n <thead>\n <tr>\n <th>Server Group</th>\n <th>Allocation %</th>\n <th />\n </tr>\n </thead>\n <tbody>\n {this.command.splitDescription.allocationDescriptions.map((allocation, index) => (\n <tr key={index}>\n <td>{this.renderAllocationTarget(allocation, index)}</td>\n <td>\n <input\n className=\"form-control input-sm\"\n min={0}\n onChange={(event) => this.updateAllocation(index, 'allocation', Number(event.target.value))}\n type=\"number\"\n value={allocation.allocation || 0}\n />\n </td>\n <td>\n <button\n className=\"btn btn-sm btn-link\"\n onClick={() => this.removeAllocation(index)}\n type=\"button\"\n >\n <span className=\"glyphicon glyphicon-trash\" />\n </button>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n <button className=\"btn btn-block btn-sm add-new\" onClick={this.addAllocation} type=\"button\">\n <span className=\"glyphicon glyphicon-plus-sign\" /> Add allocation\n </button>\n {this.allocationTotal() !== 100 && (\n <div className=\"alert alert-warning\">Traffic allocations must add up to 100%.</div>\n )}\n </div>\n </Modal.Body>\n <TaskMonitorWrapper monitor={this.state.taskMonitor} />\n <Modal.Footer>\n <button className=\"btn btn-default\" onClick={() => dismissModal()} type=\"button\">\n Cancel\n </button>\n <button\n className=\"btn btn-primary\"\n disabled={this.allocationTotal() !== 100}\n onClick={this.submit}\n type=\"button\"\n >\n {isNew ? 'Create' : 'Done'}\n </button>\n </Modal.Footer>\n </div>\n );\n }\n}\n","import React from 'react';\n\nimport type { ILoadBalancerActionsProps, ILoadBalancerDeleteCommand } from '@spinnaker/core';\nimport { ConfirmationModalService, LoadBalancerWriter } from '@spinnaker/core';\n\nimport { AppengineCreateLoadBalancerModal } from '../configure/AppengineCreateLoadBalancerModal';\n\nexport function canDeleteAppengineLoadBalancer(loadBalancer: any): boolean {\n return loadBalancer.name !== 'default';\n}\n\nexport function getDeleteLoadBalancerWarning(loadBalancer: any): string {\n const serverGroupNames = (loadBalancer.serverGroups || []).map((serverGroup: any) => serverGroup.name);\n if (!serverGroupNames.length) {\n return null;\n }\n\n if (serverGroupNames.length === 1) {\n return `<div class=\"alert alert-warning\"><p>Deleting <b>${loadBalancer.name}</b> will destroy <b>${serverGroupNames[0]}</b>.</p></div>`;\n }\n\n return `<div class=\"alert alert-warning\"><p>Deleting <b>${\n loadBalancer.name\n }</b> will destroy the following server groups:<ul>${serverGroupNames\n .map((name: string) => `<li>${name}</li>`)\n .join('')}</ul></p></div>`;\n}\n\nexport function AppengineLoadBalancerActions({ app, loadBalancer }: ILoadBalancerActionsProps) {\n const deleteLoadBalancer = () => {\n const command: ILoadBalancerDeleteCommand = {\n cloudProvider: loadBalancer.cloudProvider,\n loadBalancerName: loadBalancer.name,\n credentials: loadBalancer.account,\n };\n\n ConfirmationModalService.confirm({\n header: `Really delete ${loadBalancer.name}?`,\n buttonText: `Delete ${loadBalancer.name}`,\n body: getDeleteLoadBalancerWarning(loadBalancer),\n account: loadBalancer.account,\n taskMonitorConfig: { application: app, title: `Deleting ${loadBalancer.name}` },\n submitMethod: () => LoadBalancerWriter.deleteLoadBalancer(command, app),\n });\n };\n\n return (\n <div className=\"actions\">\n <button\n className=\"btn btn-sm btn-default\"\n onClick={() => AppengineCreateLoadBalancerModal.show({ app, loadBalancer, isNew: false })}\n type=\"button\"\n >\n Edit\n </button>\n <button\n className=\"btn btn-sm btn-default\"\n disabled={!canDeleteAppengineLoadBalancer(loadBalancer)}\n onClick={deleteLoadBalancer}\n type=\"button\"\n >\n Delete\n </button>\n </div>\n );\n}\n","import type { FormikProps } from 'formik';\nimport { get } from 'lodash';\nimport React from 'react';\nimport { from as observableFrom, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport type { Application, IAccount, IServerGroup, IServerGroupFilter, IStage } from '@spinnaker/core';\nimport { AppListExtractor, FormikFormField, ReactSelectInput } from '@spinnaker/core';\n\nexport interface IFormikAccountRegionSelectorProps {\n accounts: IAccount[];\n application: Application;\n cloudProvider: string;\n componentName?: string;\n credentialsField?: string;\n formik: FormikProps<IStage>;\n}\n\nexport interface IFormikAccountRegionSelectorState {\n availableRegions: string[];\n cloudProvider: string;\n componentName: string;\n credentialsField: string;\n}\n\nexport class FormikAccountRegionSelector extends React.Component<\n IFormikAccountRegionSelectorProps,\n IFormikAccountRegionSelectorState\n> {\n private destroy$ = new Subject<void>();\n\n constructor(props: IFormikAccountRegionSelectorProps) {\n super(props);\n const credentialsField = props.credentialsField || 'credentials';\n this.state = {\n availableRegions: [],\n cloudProvider: props.cloudProvider,\n componentName: props.componentName || '',\n credentialsField,\n };\n }\n\n public componentDidMount(): void {\n const { componentName, formik } = this.props;\n const { credentialsField } = this.state;\n const credentials = get(\n formik.values,\n componentName ? `${componentName}.${credentialsField}` : `${credentialsField}`,\n undefined,\n );\n this.setRegionList(credentials);\n }\n\n public componentWillUnmount(): void {\n this.destroy$.next();\n }\n\n private setRegionList = (credentials: string): void => {\n const { application } = this.props;\n const accountFilter: IServerGroupFilter = (serverGroup: IServerGroup) =>\n serverGroup ? serverGroup.account === credentials : true;\n observableFrom(application.ready())\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n const availableRegions = AppListExtractor.getRegions([application], accountFilter);\n availableRegions.sort();\n this.setState({ availableRegions });\n });\n };\n\n public accountChanged = (credentials: string): void => {\n this.setRegionList(credentials);\n };\n\n public render() {\n const { accounts } = this.props;\n const { credentialsField, availableRegions, componentName } = this.state;\n return (\n <div className=\"col-md-9\">\n <div className=\"sp-margin-m-bottom\">\n <FormikFormField\n name={componentName ? `${componentName}.${credentialsField}` : `${credentialsField}`}\n label=\"Account\"\n input={(props) => (\n <ReactSelectInput\n {...props}\n stringOptions={accounts && accounts.map((acc: IAccount) => acc.name)}\n clearable={false}\n />\n )}\n onChange={this.accountChanged}\n required={true}\n />\n </div>\n\n <div className=\"sp-margin-m-bottom\">\n <FormikFormField\n name={componentName ? `${componentName}.region` : 'region'}\n label=\"Region\"\n input={(props) => <ReactSelectInput {...props} stringOptions={availableRegions} clearable={false} />}\n required={true}\n />\n </div>\n </div>\n );\n }\n}\n","import React from 'react';\nimport { from as observableFrom, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport type { IAccount, IArtifact, IExpectedArtifact, IFormikStageConfigInjectedProps } from '@spinnaker/core';\nimport {\n AccountService,\n ArtifactTypePatterns,\n excludeAllTypesExcept,\n StageArtifactSelectorDelegate,\n} from '@spinnaker/core';\nimport { FormikAccountRegionSelector } from '../../../common/FormikAccountRegionSelector';\n\nexport interface IAppEngineDeployConfigSettingsState {\n accounts: IAccount[];\n}\n\nexport class DeployAppengineConfigForm extends React.Component<\n IFormikStageConfigInjectedProps,\n IAppEngineDeployConfigSettingsState\n> {\n private static readonly excludedArtifactTypes = excludeAllTypesExcept(\n ArtifactTypePatterns.BITBUCKET_FILE,\n ArtifactTypePatterns.CUSTOM_OBJECT,\n ArtifactTypePatterns.EMBEDDED_BASE64,\n ArtifactTypePatterns.GCS_OBJECT,\n ArtifactTypePatterns.GITHUB_FILE,\n ArtifactTypePatterns.GITLAB_FILE,\n ArtifactTypePatterns.S3_OBJECT,\n ArtifactTypePatterns.HTTP_FILE,\n ArtifactTypePatterns.ORACLE_OBJECT,\n );\n\n private destroy$ = new Subject<void>();\n public state: IAppEngineDeployConfigSettingsState = {\n accounts: [],\n };\n\n public componentDidMount() {\n observableFrom(AccountService.listAccounts('appengine'))\n .pipe(takeUntil(this.destroy$))\n .subscribe((accounts) => this.setState({ accounts }));\n }\n\n private onTemplateArtifactEdited = (artifact: IArtifact, name: string) => {\n this.props.formik.setFieldValue(`${name}.id`, null);\n this.props.formik.setFieldValue(`${name}.artifact`, artifact);\n this.props.formik.setFieldValue(`${name}.account`, artifact.artifactAccount);\n };\n\n private onTemplateArtifactSelected = (id: string, name: string) => {\n this.props.formik.setFieldValue(`${name}.id`, id);\n this.props.formik.setFieldValue(`${name}.artifact`, null);\n };\n\n private removeInputArtifact = (name: string) => {\n this.props.formik.setFieldValue(name, null);\n };\n\n private getInputArtifact = (stage: any, name: string) => {\n if (!stage[name]) {\n return {\n account: '',\n id: '',\n };\n } else {\n return stage[name];\n }\n };\n\n public render() {\n const stage = this.props.formik.values;\n const accounts = this.state.accounts;\n return (\n <div>\n <div className=\"col-md-offset-0 col-md-9\">\n <h4>Basic Settings</h4>\n </div>\n <div>\n <FormikAccountRegionSelector\n componentName={''}\n accounts={accounts}\n application={this.props.application}\n cloudProvider={'appengine'}\n credentialsField={'account'}\n formik={this.props.formik}\n />\n </div>\n <div className=\"col-md-offset-0 col-md-9\">\n <h4>Configuration Settings</h4>\n </div>\n <div>\n <div className=\"col-md-offset-1 col-md-9\">\n <StageArtifactSelectorDelegate\n artifact={this.getInputArtifact(stage, 'cronArtifact').artifact}\n excludedArtifactTypePatterns={DeployAppengineConfigForm.excludedArtifactTypes}\n expectedArtifactId={this.getInputArtifact(stage, 'cronArtifact').id}\n label=\"Cron Artifact\"\n onArtifactEdited={(artifact) => {\n this.onTemplateArtifactEdited(artifact, 'cronArtifact');\n }}\n helpKey={''}\n onExpectedArtifactSelected={(artifact: IExpectedArtifact) =>\n this.onTemplateArtifactSelected(artifact.id, 'cronArtifact')\n }\n pipeline={this.props.pipeline}\n stage={stage}\n />\n </div>\n <div className=\"col-md-1\">\n <div className=\"form-control-static\">\n <button onClick={() => this.removeInputArtifact('cronArtifact')}>\n <span className=\"glyphicon glyphicon-trash\" />\n <span className=\"sr-only\">Remove field</span>\n </button>\n </div>\n </div>\n </div>\n <div>\n <div className=\"col-md-offset-1 col-md-9\">\n <StageArtifactSelectorDelegate\n artifact={this.getInputArtifact(stage, 'dispatchArtifact').artifact}\n excludedArtifactTypePatterns={DeployAppengineConfigForm.excludedArtifactTypes}\n expectedArtifactId={this.getInputArtifact(stage, 'dispatchArtifact').id}\n label=\"Dispatch Artifact\"\n onArtifactEdited={(artifact) => {\n this.onTemplateArtifactEdited(artifact, 'dispatchArtifact');\n }}\n helpKey={''}\n onExpectedArtifactSelected={(artifact: IExpectedArtifact) =>\n this.onTemplateArtifactSelected(artifact.id, 'dispatchArtifact')\n }\n pipeline={this.props.pipeline}\n stage={stage}\n />\n </div>\n <div className=\"col-md-1\">\n <div className=\"form-control-static\">\n <button onClick={() => this.removeInputArtifact('dispatchArtifact')}>\n <span className=\"glyphicon glyphicon-trash\" />\n <span className=\"sr-only\">Remove field</span>\n </button>\n </div>\n </div>\n </div>\n <div>\n <div className=\"col-md-offset-1 col-md-9\">\n <StageArtifactSelectorDelegate\n artifact={this.getInputArtifact(stage, 'indexArtifact').artifact}\n excludedArtifactTypePatterns={DeployAppengineConfigForm.excludedArtifactTypes}\n expectedArtifactId={this.getInputArtifact(stage, 'indexArtifact').id}\n label=\"Index Artifact\"\n onArtifactEdited={(artifact) => {\n this.onTemplateArtifactEdited(artifact, 'indexArtifact');\n }}\n helpKey={''}\n onExpectedArtifactSelected={(artifact: IExpectedArtifact) =>\n this.onTemplateArtifactSelected(artifact.id, 'indexArtifact')\n }\n pipeline={this.props.pipeline}\n stage={stage}\n />\n </div>\n <div className=\"col-md-1\">\n <div className=\"form-control-static\">\n <button onClick={() => this.removeInputArtifact('indexArtifact')}>\n <span className=\"glyphicon glyphicon-trash\" />\n <span className=\"sr-only\">Remove field</span>\n </button>\n </div>\n </div>\n </div>\n <div>\n <div className=\"col-md-offset-1 col-md-9\">\n <StageArtifactSelectorDelegate\n artifact={this.getInputArtifact(stage, 'queueArtifact').artifact}\n excludedArtifactTypePatterns={DeployAppengineConfigForm.excludedArtifactTypes}\n expectedArtifactId={this.getInputArtifact(stage, 'queueArtifact').id}\n label=\"Queue Artifact\"\n onArtifactEdited={(artifact) => {\n this.onTemplateArtifactEdited(artifact, 'queueArtifact');\n }}\n helpKey={''}\n onExpectedArtifactSelected={(artifact: IExpectedArtifact) =>\n this.onTemplateArtifactSelected(artifact.id, 'queueArtifact')\n }\n pipeline={this.props.pipeline}\n stage={stage}\n />\n </div>\n <div className=\"col-md-1\">\n <div className=\"form-control-static\">\n <button onClick={() => this.removeInputArtifact('queueArtifact')}>\n <span className=\"glyphicon glyphicon-trash\" />\n <span className=\"sr-only\">Remove field</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n}\n","import type { FormikErrors } from 'formik';\nimport { cloneDeep } from 'lodash';\nimport React from 'react';\n\nimport type { IStage, IStageConfigProps } from '@spinnaker/core';\nimport { FormikStageConfig, FormValidator } from '@spinnaker/core';\n\nimport { DeployAppengineConfigForm } from './DeployAppengineConfigForm';\n\nexport function DeployAppengineConfigurationConfig({ application, pipeline, stage, updateStage }: IStageConfigProps) {\n const stageWithDefaults = React.useMemo(() => {\n return {\n ...cloneDeep(stage),\n };\n }, []);\n\n return (\n <FormikStageConfig\n application={application}\n onChange={updateStage}\n pipeline={pipeline}\n stage={stageWithDefaults}\n validate={validateDeployAppengineConfigurationStage}\n render={(props) => <DeployAppengineConfigForm {...props} />}\n />\n );\n}\n\nexport function validateDeployAppengineConfigurationStage(stage: IStage): FormikErrors<IStage> {\n const formValidator = new FormValidator(stage);\n formValidator.field('account').required();\n formValidator.field('region').required();\n return formValidator.validateForm();\n}\n","import { ExecutionArtifactTab, ExecutionDetailsTasks, Registry } from '@spinnaker/core';\n\nimport {\n DeployAppengineConfigurationConfig,\n validateDeployAppengineConfigurationStage,\n} from './DeployAppengineConfigurationConfig';\n\nexport const DEPLOY_APPENGINE_CONFIG_STAGE_KEY = 'deployAppEngineConfiguration';\n\nRegistry.pipeline.registerStage({\n label: 'Deploy App Engine Configuration',\n description: 'Deploy index, dispatch, cron, and queue configuration to App Engine.',\n key: DEPLOY_APPENGINE_CONFIG_STAGE_KEY,\n component: DeployAppengineConfigurationConfig,\n producesArtifacts: false,\n cloudProvider: 'appengine',\n executionDetailsSections: [ExecutionDetailsTasks, ExecutionArtifactTab],\n validateFn: validateDeployAppengineConfigurationStage,\n});\n","export class AppengineHealth {\n public static PLATFORM = 'App Engine Service';\n}\n","import React, { useEffect, useState } from 'react';\n\nimport type { IStageConfigProps } from '@spinnaker/core';\nimport {\n AccountRegionClusterSelector,\n AccountService,\n PlatformHealthOverride,\n StageConfigField,\n StageConstants,\n TargetSelect,\n} from '@spinnaker/core';\n\nimport { AppengineHealth } from '../../common/appengineHealth';\nimport type { IAppengineAccount } from '../../domain';\n\nexport function getAppengineAccountRegion(accounts: IAppengineAccount[], credentials: string): string {\n return accounts.find((account) => account.name === credentials)?.region;\n}\n\nexport function initializeAppengineServerGroupStage(stage: any, application: any): void {\n stage.cloudProvider = 'appengine';\n stage.cloudProviderType = 'appengine';\n\n if (\n stage.isNew &&\n application?.attributes?.platformHealthOnlyShowOverride &&\n application?.attributes?.platformHealthOnly\n ) {\n stage.interestingHealthProviderNames = [AppengineHealth.PLATFORM];\n }\n}\n\ntype AppengineStageConfigProps = Pick<IStageConfigProps, 'application' | 'pipeline' | 'stage' | 'updateStage'> & {\n showHealthOverride?: boolean;\n};\n\nexport function AppengineServerGroupStageConfig({\n application,\n pipeline,\n stage,\n updateStage,\n showHealthOverride = false,\n}: AppengineStageConfigProps) {\n const [accounts, setAccounts] = useState<IAppengineAccount[]>([]);\n\n useEffect(() => {\n initializeAppengineServerGroupStage(stage, application);\n AccountService.listAccounts('appengine').then((loadedAccounts: IAppengineAccount[]) => {\n setAccounts(loadedAccounts);\n const credentials = stage.credentials || application?.defaultCredentials?.appengine;\n const region = getAppengineAccountRegion(loadedAccounts, credentials);\n if (credentials || region) {\n stage.credentials = credentials || stage.credentials;\n stage.region = region || stage.region;\n updateStage(stage);\n }\n });\n }, []);\n\n const onAccountUpdate = (credentials: string) => {\n AccountService.getAccountDetails(credentials).then((accountDetails: IAppengineAccount) => {\n stage.region = accountDetails?.region || stage.region;\n updateStage(stage);\n });\n };\n\n return (\n <div className=\"form-horizontal\">\n {!pipeline?.strategy && (\n <AccountRegionClusterSelector\n accounts={accounts}\n application={application}\n component={stage}\n disableRegionSelect={true}\n onAccountUpdate={onAccountUpdate}\n onComponentUpdate={updateStage}\n singleRegion=\"true\"\n />\n )}\n <StageConfigField label=\"Target\">\n <TargetSelect\n model={{ target: stage.target }}\n onChange={(target: string) => {\n stage.target = target;\n updateStage(stage);\n }}\n options={StageConstants.TARGET_LIST}\n />\n </StageConfigField>\n {showHealthOverride && application?.attributes?.platformHealthOnlyShowOverride && (\n <PlatformHealthOverride\n interestingHealthProviderNames={stage.interestingHealthProviderNames || []}\n onChange={(interestingHealthProviderNames) => {\n stage.interestingHealthProviderNames = interestingHealthProviderNames;\n updateStage(stage);\n }}\n platformHealthType={AppengineHealth.PLATFORM}\n />\n )}\n </div>\n );\n}\n\nexport function AppengineServerGroupStageConfigWithHealthOverride(props: AppengineStageConfigProps) {\n return <AppengineServerGroupStageConfig {...props} showHealthOverride={true} />;\n}\n\nexport function AppengineShrinkClusterStageConfig({\n application,\n pipeline,\n stage,\n updateStage,\n}: AppengineStageConfigProps) {\n useEffect(() => {\n initializeAppengineServerGroupStage(stage, application);\n if (stage.shrinkToSize === undefined) {\n stage.shrinkToSize = 1;\n }\n if (stage.allowDeleteActive === undefined) {\n stage.allowDeleteActive = false;\n }\n if (stage.retainLargerOverNewer === undefined) {\n stage.retainLargerOverNewer = 'false';\n }\n stage.retainLargerOverNewer = stage.retainLargerOverNewer.toString();\n updateStage(stage);\n }, []);\n\n const update = (field: string, value: any) => {\n stage[field] = value;\n updateStage(stage);\n };\n\n return (\n <div className=\"form-horizontal\">\n <AppengineServerGroupStageConfig\n application={application}\n pipeline={pipeline}\n stage={stage}\n updateStage={updateStage}\n />\n <div className=\"form-group\">\n <label className=\"col-md-3 sm-label-right\">Shrink Options</label>\n <div className=\"col-md-7 form-inline\">\n Shrink to{' '}\n <input\n className=\"form-control input-sm\"\n min={0}\n onChange={(event) => update('shrinkToSize', Number(event.target.value))}\n style={{ width: 60 }}\n type=\"number\"\n value={stage.shrinkToSize || 0}\n />{' '}\n server groups, keeping the{' '}\n <select\n className=\"form-control input-sm\"\n onChange={(event) => update('retainLargerOverNewer', event.target.value)}\n style={{ width: 100 }}\n value={stage.retainLargerOverNewer || 'false'}\n >\n <option value=\"true\">largest</option>\n <option value=\"false\">newest</option>\n </select>\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-offset-3 col-md-7 checkbox\">\n <label>\n <input\n checked={!!stage.allowDeleteActive}\n onChange={(event) => update('allowDeleteActive', event.target.checked)}\n type=\"checkbox\"\n />{' '}\n Allow deletion of active server groups\n </label>\n </div>\n </div>\n {application?.attributes?.platformHealthOnlyShowOverride && (\n <PlatformHealthOverride\n interestingHealthProviderNames={stage.interestingHealthProviderNames || []}\n onChange={(interestingHealthProviderNames) => {\n stage.interestingHealthProviderNames = interestingHealthProviderNames;\n updateStage(stage);\n }}\n platformHealthType={AppengineHealth.PLATFORM}\n />\n )}\n </div>\n );\n}\n","import React from 'react';\n\nimport type { IExecutionDetailsSectionProps } from '@spinnaker/core';\nimport { ExecutionDetailsSection } from '@spinnaker/core';\n\nfunction FailureMessages({ stage }: Pick<IExecutionDetailsSectionProps, 'stage'>) {\n const failures = (stage.context?.exception?.details?.errors || stage.context?.failureMessages || []) as string[];\n if (!failures.length) {\n return null;\n }\n\n return (\n <div className=\"alert alert-danger\">\n {failures.map((message, index) => (\n <p key={index}>{message}</p>\n ))}\n </div>\n );\n}\n\nexport function getServerGroupDisplayName(context: any): string {\n return context.cluster || context.serverGroupName;\n}\n\nfunction ServerGroupConfigDetails(props: IExecutionDetailsSectionProps) {\n const { stage } = props;\n return (\n <div>\n <dl className=\"dl-horizontal dl-narrow\">\n <dt>Account</dt>\n <dd>{stage.context.credentials || stage.context.account}</dd>\n <dt>Region</dt>\n <dd>{stage.context.region}</dd>\n <dt>{stage.context.cluster ? 'Cluster' : 'Server Group'}</dt>\n <dd>{getServerGroupDisplayName(stage.context)}</dd>\n {stage.context.target && [\n <dt key=\"target-label\">Target</dt>,\n <dd key=\"target-value\">{stage.context.target}</dd>,\n ]}\n </dl>\n <FailureMessages stage={stage} />\n </div>\n );\n}\n\nexport function AppengineStartServerGroupExecutionDetails(props: IExecutionDetailsSectionProps) {\n return (\n <ExecutionDetailsSection name={AppengineStartServerGroupExecutionDetails.title} current={props.current}>\n <ServerGroupConfigDetails {...props} />\n </ExecutionDetailsSection>\n );\n}\nAppengineStartServerGroupExecutionDetails.title = 'startServerGroupConfig';\n\nexport function AppengineStopServerGroupExecutionDetails(props: IExecutionDetailsSectionProps) {\n return (\n <ExecutionDetailsSection name={AppengineStopServerGroupExecutionDetails.title} current={props.current}>\n <ServerGroupConfigDetails {...props} />\n </ExecutionDetailsSection>\n );\n}\nAppengineStopServerGroupExecutionDetails.title = 'stopServerGroupConfig';\n\nexport function AppengineEditLoadBalancerExecutionDetails(props: IExecutionDetailsSectionProps) {\n const loadBalancers = props.stage.context.loadBalancers || [];\n return (\n <ExecutionDetailsSection name={AppengineEditLoadBalancerExecutionDetails.title} current={props.current}>\n <table className=\"table table-condensed\">\n <thead>\n <tr>\n <th>Account</th>\n <th>Name</th>\n <th>Region</th>\n </tr>\n </thead>\n <tbody>\n {loadBalancers.map((loadBalancer: any, index: number) => (\n <tr key={index}>\n <td>{loadBalancer.credentials || loadBalancer.account}</td>\n <td>{loadBalancer.name || loadBalancer.loadBalancerName}</td>\n <td>{loadBalancer.region}</td>\n </tr>\n ))}\n </tbody>\n </table>\n <FailureMessages stage={props.stage} />\n </ExecutionDetailsSection>\n );\n}\nAppengineEditLoadBalancerExecutionDetails.title = 'editLoadBalancerConfig';\n","import { Registry } from '@spinnaker/core';\nimport { AppengineServerGroupStageConfig } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n provides: 'destroyServerGroup',\n key: 'destroyServerGroup',\n cloudProvider: 'appengine',\n component: AppengineServerGroupStageConfig,\n validators: [\n {\n type: 'targetImpedance',\n message:\n 'This pipeline will attempt to destroy a server group without deploying a new version into the same cluster.',\n },\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'target' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n});\n","import { Registry } from '@spinnaker/core';\nimport { AppengineServerGroupStageConfigWithHealthOverride } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n provides: 'disableServerGroup',\n key: 'disableServerGroup',\n cloudProvider: 'appengine',\n component: AppengineServerGroupStageConfigWithHealthOverride,\n validators: [\n {\n type: 'targetImpedance',\n message:\n 'This pipeline will attempt to disable a server group without deploying a new version into the same cluster.',\n },\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'target' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n});\n","import { ExecutionDetailsTasks, Registry } from '@spinnaker/core';\n\nimport { AppengineEditLoadBalancerStageConfig } from './AppengineEditLoadBalancerStageConfig';\nimport { AppengineEditLoadBalancerExecutionDetails } from '../AppengineExecutionDetails';\n\nRegistry.pipeline.registerStage({\n label: 'Edit Load Balancer',\n description: 'Edits a load balancer',\n key: 'upsertAppEngineLoadBalancers',\n cloudProvider: 'appengine',\n component: AppengineEditLoadBalancerStageConfig,\n executionDetailsSections: [AppengineEditLoadBalancerExecutionDetails, ExecutionDetailsTasks],\n validators: [],\n});\n","import React, { useEffect } from 'react';\n\nimport type { ILoadBalancer, IStageConfigProps } from '@spinnaker/core';\n\nimport { AppengineCreateLoadBalancerModal } from '../../../loadBalancer/configure/AppengineCreateLoadBalancerModal';\n\nexport function AppengineEditLoadBalancerStageConfig({ application, stage, updateStage }: IStageConfigProps) {\n useEffect(() => {\n stage.loadBalancers = stage.loadBalancers || [];\n stage.cloudProvider = 'appengine';\n updateStage(stage);\n }, []);\n\n const setLoadBalancers = (loadBalancers: ILoadBalancer[]) => {\n stage.loadBalancers = loadBalancers;\n updateStage(stage);\n };\n\n const addLoadBalancer = () => {\n AppengineCreateLoadBalancerModal.show({\n app: application,\n loadBalancer: null,\n forPipelineConfig: true,\n isNew: true,\n } as any)\n .then((loadBalancer) => setLoadBalancers([...(stage.loadBalancers || []), loadBalancer]))\n .catch(() => {});\n };\n\n const editLoadBalancer = (index: number) => {\n AppengineCreateLoadBalancerModal.show({\n app: application,\n loadBalancer: stage.loadBalancers[index],\n forPipelineConfig: true,\n isNew: false,\n } as any)\n .then((loadBalancer) => {\n const loadBalancers = [...stage.loadBalancers];\n loadBalancers[index] = loadBalancer;\n setLoadBalancers(loadBalancers);\n })\n .catch(() => {});\n };\n\n const removeLoadBalancer = (index: number) => {\n setLoadBalancers(stage.loadBalancers.filter((_loadBalancer: ILoadBalancer, i: number) => i !== index));\n };\n\n return (\n <div className=\"well well-sm clearfix\">\n <h4>Load Balancers</h4>\n <table className=\"table table-condensed\">\n <thead>\n <tr>\n <th>Account</th>\n <th>Name</th>\n <th>Region</th>\n <th>Actions</th>\n </tr>\n </thead>\n <tbody>\n {(stage.loadBalancers || []).map((loadBalancer: any, index: number) => (\n <tr key={`${loadBalancer.name}-${index}`}>\n <td>{loadBalancer.credentials || loadBalancer.account}</td>\n <td>{loadBalancer.name}</td>\n <td>{loadBalancer.region}</td>\n <td className=\"condensed-actions\">\n <button className=\"btn btn-sm btn-link\" onClick={() => editLoadBalancer(index)} type=\"button\">\n <span className=\"glyphicon glyphicon-edit\" />\n </button>\n <button\n className=\"btn btn-sm btn-link pad-left\"\n onClick={() => removeLoadBalancer(index)}\n type=\"button\"\n >\n <span className=\"glyphicon glyphicon-trash\" />\n </button>\n </td>\n </tr>\n ))}\n </tbody>\n <tfoot>\n <tr>\n <td colSpan={4}>\n <button className=\"btn btn-block btn-sm add-new\" onClick={addLoadBalancer} type=\"button\">\n <span className=\"glyphicon glyphicon-plus-sign\" /> Add load balancer\n </button>\n </td>\n </tr>\n </tfoot>\n </table>\n </div>\n );\n}\n","import { Registry } from '@spinnaker/core';\nimport { AppengineServerGroupStageConfigWithHealthOverride } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n provides: 'enableServerGroup',\n key: 'enableServerGroup',\n cloudProvider: 'appengine',\n component: AppengineServerGroupStageConfigWithHealthOverride,\n validators: [\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'target' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n});\n","import { Registry } from '@spinnaker/core';\nimport { AppengineShrinkClusterStageConfig } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n provides: 'shrinkCluster',\n key: 'shrinkCluster',\n cloudProvider: 'appengine',\n component: AppengineShrinkClusterStageConfig,\n validators: [\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'shrinkToSize', fieldLabel: 'shrink to [X] Server Groups' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n});\n","import { ExecutionDetailsTasks, Registry } from '@spinnaker/core';\nimport { AppengineStartServerGroupExecutionDetails } from '../AppengineExecutionDetails';\nimport { AppengineServerGroupStageConfigWithHealthOverride } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n label: 'Start Server Group',\n description: 'Starts a server group.',\n key: 'startAppEngineServerGroup',\n component: AppengineServerGroupStageConfigWithHealthOverride,\n executionDetailsSections: [AppengineStartServerGroupExecutionDetails, ExecutionDetailsTasks],\n validators: [\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'target' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n cloudProvider: 'appengine',\n});\n","import { ExecutionDetailsTasks, Registry } from '@spinnaker/core';\nimport { AppengineStopServerGroupExecutionDetails } from '../AppengineExecutionDetails';\nimport { AppengineServerGroupStageConfigWithHealthOverride } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n label: 'Stop Server Group',\n description: 'Stops a server group.',\n key: 'stopAppEngineServerGroup',\n component: AppengineServerGroupStageConfigWithHealthOverride,\n executionDetailsSections: [AppengineStopServerGroupExecutionDetails, ExecutionDetailsTasks],\n validators: [\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'target' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n cloudProvider: 'appengine',\n});\n","import type { IProviderSettings } from '@spinnaker/core';\nimport { SETTINGS } from '@spinnaker/core';\n\nexport interface IAppengineProviderSettings extends IProviderSettings {\n defaults: {\n account?: string;\n };\n}\n\nexport const AppengineProviderSettings: IAppengineProviderSettings = (SETTINGS.providers\n .appengine as IAppengineProviderSettings) || { defaults: {} };\nif (AppengineProviderSettings) {\n AppengineProviderSettings.resetToOriginal = SETTINGS.resetProvider('appengine');\n}\n","import type {\n Application,\n IArtifact,\n IArtifactAccountPair,\n IBuildTrigger,\n IExpectedArtifact,\n IGitTrigger,\n IPipeline,\n IStage,\n} from '@spinnaker/core';\nimport { AccountService, StorageAccountReader } from '@spinnaker/core';\nimport { AppengineProviderSettings } from '../../appengine.settings';\nimport type {\n GitCredentialType,\n IAppengineAccount,\n IAppengineGitTrigger,\n IAppengineJenkinsTrigger,\n IAppengineServerGroup,\n} from '../../domain';\n\nimport type { AppengineDeployDescription } from '../transformer';\n\nexport interface IAppengineServerGroupCommand {\n application?: string;\n stack?: string;\n freeFormDetails?: string;\n configFilepaths?: string[];\n configFiles?: string[];\n configArtifacts?: IArtifactAccountPair[];\n applicationDirectoryRoot: string;\n branch?: string;\n repositoryUrl?: string;\n credentials: string;\n region: string;\n selectedProvider: string;\n promote?: boolean;\n stopPreviousVersion?: boolean;\n suppressVersionString?: boolean;\n type?: string;\n backingData: any;\n viewState: IViewState;\n strategy?: string;\n strategyApplication?: string;\n strategyPipeline?: string;\n fromTrigger?: boolean;\n trigger?: IAppengineGitTrigger | IAppengineJenkinsTrigger;\n gitCredentialType?: GitCredentialType;\n storageAccountName?: string; // GCS only\n interestingHealthProviderNames: string[];\n fromArtifact: boolean;\n expectedArtifactId: string;\n expectedArtifact?: IArtifact;\n sourceType: string;\n containerImageUrl?: string;\n}\n\nexport enum AppengineSourceType {\n GCS = 'gcs',\n GIT = 'git',\n ARTIFACT = 'artifact',\n CONTAINER_IMAGE = 'containerImage',\n}\n\nexport interface IViewState {\n mode: string;\n submitButtonLabel: string;\n disableStrategySelection: boolean;\n stage?: IStage;\n pipeline?: IPipeline;\n}\n\nexport class AppengineServerGroupCommandBuilder {\n private static getTriggerOptions(pipeline: IPipeline): Array<IAppengineGitTrigger | IAppengineJenkinsTrigger> {\n return (pipeline.triggers || [])\n .filter((trigger) => trigger.type === 'git' || trigger.type === 'jenkins' || trigger.type === 'travis')\n .map((trigger: IGitTrigger | IBuildTrigger) => {\n if (trigger.type === 'git') {\n return {\n source: trigger.source,\n project: trigger.project,\n slug: trigger.slug,\n branch: trigger.branch,\n type: 'git',\n };\n } else {\n return { master: trigger.master, job: trigger.job, type: trigger.type };\n }\n });\n }\n\n private static getExpectedArtifacts(pipeline: IPipeline): IExpectedArtifact[] {\n return pipeline.expectedArtifacts || [];\n }\n\n public buildNewServerGroupCommand(\n app: Application,\n selectedProvider: string,\n mode = 'create',\n ): Promise<IAppengineServerGroupCommand> {\n if (selectedProvider == null) {\n selectedProvider = 'appengine';\n }\n const dataToFetch = {\n accounts: AccountService.getAllAccountDetailsForProvider('appengine'),\n storageAccounts: StorageAccountReader.getStorageAccounts(),\n };\n\n const viewState: IViewState = {\n mode,\n submitButtonLabel: this.getSubmitButtonLabel(mode),\n disableStrategySelection: mode === 'create',\n };\n\n return this.resolveAll(dataToFetch).then((backingData: any) => {\n const credentials = this.getCredentials(backingData.accounts);\n const region = this.getRegion(backingData.accounts, credentials);\n\n return {\n application: app.name,\n backingData,\n viewState,\n fromArtifact: false,\n credentials,\n region,\n selectedProvider,\n configArtifacts: [],\n configFilepaths: [],\n configFiles: [],\n interestingHealthProviderNames: [],\n sourceType: AppengineSourceType.GIT,\n } as IAppengineServerGroupCommand;\n });\n }\n\n public buildServerGroupCommandFromExisting(\n app: Application,\n serverGroup: IAppengineServerGroup,\n ): Promise<IAppengineServerGroupCommand> {\n return this.buildNewServerGroupCommand(app, 'appengine', 'clone').then((command) => {\n command.stack = serverGroup.stack;\n command.freeFormDetails = serverGroup.detail;\n return command;\n });\n }\n\n public buildNewServerGroupCommandForPipeline(\n _stage: IStage,\n pipeline: IPipeline,\n ): Promise<{\n viewState: {\n stage: IStage;\n pipeline: IPipeline;\n };\n backingData: {\n triggerOptions: Array<IAppengineGitTrigger | IAppengineJenkinsTrigger>;\n expectedArtifacts: IExpectedArtifact[];\n };\n }> {\n // We can't copy server group configuration for App Engine, and can't build the full command here because we don't have\n // access to the application.\n return Promise.resolve({\n viewState: {\n pipeline,\n stage: _stage,\n },\n backingData: {\n triggerOptions: AppengineServerGroupCommandBuilder.getTriggerOptions(pipeline),\n expectedArtifacts: AppengineServerGroupCommandBuilder.getExpectedArtifacts(pipeline),\n },\n });\n }\n\n public buildServerGroupCommandFromPipeline(\n app: Application,\n cluster: AppengineDeployDescription,\n _stage: IStage,\n pipeline: IPipeline,\n ): Promise<IAppengineServerGroupCommand> {\n return this.buildNewServerGroupCommand(app, 'appengine', 'editPipeline').then(\n (command: IAppengineServerGroupCommand) => {\n command = {\n ...command,\n ...cluster,\n backingData: {\n ...command.backingData,\n triggerOptions: AppengineServerGroupCommandBuilder.getTriggerOptions(pipeline),\n expectedArtifacts: AppengineServerGroupCommandBuilder.getExpectedArtifacts(pipeline),\n },\n credentials: cluster.account || command.credentials,\n viewState: {\n ...command.viewState,\n stage: _stage,\n pipeline,\n },\n } as IAppengineServerGroupCommand;\n return command;\n },\n );\n }\n\n private getCredentials(accounts: IAppengineAccount[]): string {\n const accountNames: string[] = (accounts || []).map((account) => account.name);\n const defaultCredentials: string = AppengineProviderSettings.defaults.account;\n\n return accountNames.includes(defaultCredentials) ? defaultCredentials : accountNames[0];\n }\n\n private getRegion(accounts: IAppengineAccount[], credentials: string): string {\n const account = accounts.find((_account) => _account.name === credentials);\n return account ? account.region : null;\n }\n\n private getSubmitButtonLabel(mode: string): string {\n switch (mode) {\n case 'createPipeline':\n return 'Add';\n case 'editPipeline':\n return 'Done';\n case 'clone':\n return 'Clone';\n default:\n return 'Create';\n }\n }\n\n private resolveAll<T extends Record<string, PromiseLike<any>>>(\n dataToFetch: T,\n ): Promise<{ [K in keyof T]: Awaited<T[K]> }> {\n const entries = Object.entries(dataToFetch);\n return Promise.all(entries.map(([, promise]) => promise)).then((values) => {\n return entries.reduce((result, [key], index) => ({ ...result, [key]: values[index] }), {}) as {\n [K in keyof T]: Awaited<T[K]>;\n };\n });\n }\n}\n","import type { IArtifact, IArtifactAccountPair, IServerGroup } from '@spinnaker/core';\n\nimport type { IAppengineServerGroupCommand } from './configure/serverGroupCommandBuilder.service';\nimport type { GitCredentialType, IAppengineGitTrigger, IAppengineJenkinsTrigger } from '../domain/index';\n\nexport class AppengineDeployDescription {\n public cloudProvider = 'appengine';\n public provider = 'appengine';\n public credentials: string;\n public account: string;\n public application: string;\n public stack?: string;\n public freeFormDetails?: string;\n public repositoryUrl: string;\n public branch: string;\n public configFilepaths: string[];\n public configFiles: string[];\n public configArtifacts: IArtifactAccountPair[];\n public applicationDirectoryRoot: string;\n public promote?: boolean;\n public stopPreviousVersion?: boolean;\n public type: string;\n public region: string;\n public strategy?: string;\n public strategyApplication?: string;\n public strategyPipeline?: string;\n public fromTrigger?: boolean;\n public trigger?: IAppengineGitTrigger | IAppengineJenkinsTrigger;\n public gitCredentialType: GitCredentialType;\n public interestingHealthProviderNames: string[];\n public expectedArtifactId: string;\n public expectedArtifact: IArtifact;\n public fromArtifact: boolean;\n public sourceType: string;\n public storageAccountName?: string;\n public containerImageUrl?: string;\n public suppressVersionString?: boolean;\n\n constructor(command: IAppengineServerGroupCommand) {\n this.credentials = command.credentials;\n this.account = command.credentials;\n this.application = command.application;\n this.stack = command.stack;\n this.freeFormDetails = command.freeFormDetails;\n this.repositoryUrl = command.repositoryUrl;\n this.branch = command.branch;\n this.configFilepaths = command.configFilepaths;\n this.promote = command.promote;\n this.stopPreviousVersion = command.stopPreviousVersion;\n this.type = command.type;\n this.region = command.region;\n this.strategy = command.strategy;\n this.strategyApplication = command.strategyApplication;\n this.strategyPipeline = command.strategyPipeline;\n this.fromTrigger = command.fromTrigger;\n this.trigger = command.trigger;\n this.gitCredentialType = command.gitCredentialType;\n this.configFiles = command.configFiles;\n this.configArtifacts = (command.configArtifacts || []).filter((a) => !!a.id || !!a.artifact);\n this.applicationDirectoryRoot = command.applicationDirectoryRoot;\n this.interestingHealthProviderNames = command.interestingHealthProviderNames || [];\n this.expectedArtifactId = command.expectedArtifactId;\n this.expectedArtifact = command.expectedArtifact;\n this.fromArtifact = command.fromArtifact;\n this.sourceType = command.sourceType;\n this.storageAccountName = command.storageAccountName;\n this.containerImageUrl = command.containerImageUrl;\n this.suppressVersionString = command.suppressVersionString;\n }\n}\n\nexport class AppengineServerGroupTransformer {\n public normalizeServerGroup(serverGroup: IServerGroup): Promise<IServerGroup> {\n return Promise.resolve(serverGroup);\n }\n\n public convertServerGroupCommandToDeployConfiguration(command: IAppengineServerGroupCommand) {\n return new AppengineDeployDescription(command);\n }\n}\n","import type { Application, IJob, ITask, ITaskCommand } from '@spinnaker/core';\nimport { TaskExecutor } from '@spinnaker/core';\n\nimport type { IAppengineServerGroupCommand } from '../configure/serverGroupCommandBuilder.service';\nimport type { IAppengineServerGroup } from '../../domain/index';\nimport { AppengineDeployDescription } from '../transformer';\n\ninterface IAppengineServerGroupWriteJob extends IJob {\n serverGroupName: string;\n region: string;\n credentials: string;\n cloudProvider: string;\n}\n\nexport class AppengineServerGroupWriter {\n public cloneServerGroup(command: IAppengineServerGroupCommand, application: Application): Promise<ITask> {\n command.type = 'createServerGroup';\n\n return TaskExecutor.executeTask({\n job: [new AppengineDeployDescription(command)],\n application,\n description: `Create App Engine Server Group in ${application.name}`,\n });\n }\n\n public startServerGroup(serverGroup: IAppengineServerGroup, application: Application): Promise<ITask> {\n const job = this.buildJob(serverGroup, application, 'startAppEngineServerGroup');\n\n const command: ITaskCommand = {\n job: [job],\n application,\n description: `Start Server Group: ${serverGroup.name}`,\n };\n\n return TaskExecutor.executeTask(command);\n }\n\n public stopServerGroup(serverGroup: IAppengineServerGroup, application: Application): Promise<ITask> {\n const job = this.buildJob(serverGroup, application, 'stopAppEngineServerGroup');\n\n const command: ITaskCommand = {\n job: [job],\n application,\n description: `Stop Server Group: ${serverGroup.name}`,\n };\n\n return TaskExecutor.executeTask(command);\n }\n\n public enableServerGroup(\n serverGroup: IAppengineServerGroup,\n application: Application,\n params: Partial<IAppengineServerGroupWriteJob> = {},\n ): Promise<ITask> {\n const job = { ...params, ...this.buildJob(serverGroup, application, 'enableServerGroup') };\n\n return TaskExecutor.executeTask({\n job: [job],\n application,\n description: `Enable Server Group: ${serverGroup.name}`,\n });\n }\n\n public disableServerGroup(\n serverGroup: IAppengineServerGroup,\n application: Application,\n params: Partial<IAppengineServerGroupWriteJob> = {},\n ): Promise<ITask> {\n const job = { ...params, ...this.buildJob(serverGroup, application, 'disableServerGroup') };\n\n return TaskExecutor.executeTask({\n job: [job],\n application,\n description: `Disable Server Group: ${serverGroup.name}`,\n });\n }\n\n public destroyServerGroup(\n serverGroup: IAppengineServerGroup,\n application: Application,\n params: Partial<IAppengineServerGroupWriteJob> = {},\n ): Promise<ITask> {\n const job = { ...params, ...this.buildJob(serverGroup, application, 'destroyServerGroup') };\n\n return TaskExecutor.executeTask({\n job: [job],\n application,\n description: `Destroy Server Group: ${serverGroup.name}`,\n });\n }\n\n private buildJob(\n serverGroup: IAppengineServerGroup,\n application: Application,\n type: string,\n ): IAppengineServerGroupWriteJob {\n return {\n type,\n region: serverGroup.region,\n serverGroupName: serverGroup.name,\n credentials: serverGroup.account,\n cloudProvider: 'appengine',\n application: application.name,\n };\n }\n}\n","import React from 'react';\nimport { Modal } from 'react-bootstrap';\n\nimport type { Application, IModalComponentProps } from '@spinnaker/core';\nimport { ModalClose, noop, ReactModal, TaskMonitor, TaskMonitorWrapper } from '@spinnaker/core';\n\nimport type { IAppengineServerGroupCommand } from '../serverGroupCommandBuilder.service';\nimport { AppengineSourceType } from '../serverGroupCommandBuilder.service';\nimport { AppengineServerGroupWriter } from '../../writer/serverGroup.write.service';\n\nexport interface IAppengineCloneServerGroupModalProps extends Partial<IModalComponentProps> {\n application: Application;\n command: IAppengineServerGroupCommand;\n title: string;\n}\n\ninterface IAppengineCloneServerGroupModalState {\n taskMonitor: TaskMonitor;\n}\n\nconst writer = new AppengineServerGroupWriter();\n\nexport function normalizeAppengineServerGroupCommandForSubmit(\n command: IAppengineServerGroupCommand,\n): IAppengineServerGroupCommand {\n return {\n ...command,\n configArtifacts: command.configArtifacts || [],\n configFilepaths: command.configFilepaths || [],\n configFiles: command.configFiles || [],\n interestingHealthProviderNames: command.interestingHealthProviderNames || [],\n fromArtifact: command.fromArtifact || false,\n sourceType: command.sourceType || AppengineSourceType.GIT,\n };\n}\n\nexport class AppengineCloneServerGroupModal extends React.Component<\n IAppengineCloneServerGroupModalProps,\n IAppengineCloneServerGroupModalState\n> {\n public static defaultProps: Partial<IAppengineCloneServerGroupModalProps> = {\n closeModal: noop,\n dismissModal: noop,\n };\n\n public static show(props: IAppengineCloneServerGroupModalProps): Promise<IAppengineServerGroupCommand> {\n return ReactModal.show(AppengineCloneServerGroupModal, props, { dialogClassName: 'modal-lg' });\n }\n\n public state: IAppengineCloneServerGroupModalState = {\n taskMonitor: new TaskMonitor({\n application: this.props.application,\n title: 'Creating your server group',\n onDismiss: () => this.props.dismissModal(),\n onTaskComplete: () => this.props.application.serverGroups.refresh(),\n }),\n };\n\n private update = (field: keyof IAppengineServerGroupCommand, value: any) => {\n (this.props.command as any)[field] = value;\n this.forceUpdate();\n };\n\n private submit = () => {\n const { command } = this.props;\n if (command.viewState.mode === 'editPipeline' || command.viewState.mode === 'createPipeline') {\n this.props.closeModal(command);\n return;\n }\n\n this.state.taskMonitor.submit(() =>\n writer.cloneServerGroup(normalizeAppengineServerGroupCommandForSubmit(command), this.props.application),\n );\n };\n\n public render() {\n const { command, dismissModal, title } = this.props;\n\n return (\n <div>\n <ModalClose dismiss={dismissModal} />\n <Modal.Header>\n <Modal.Title>{title}</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <div className=\"form-horizontal\">\n <label>Account</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.update('credentials', event.target.value)}\n value={command.credentials || ''}\n />\n <label>Region</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.update('region', event.target.value)}\n value={command.region || ''}\n />\n <label>Branch</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.update('branch', event.target.value)}\n value={command.branch || ''}\n />\n </div>\n </Modal.Body>\n <TaskMonitorWrapper monitor={this.state.taskMonitor} />\n <Modal.Footer>\n <button className=\"btn btn-default\" onClick={() => dismissModal()} type=\"button\">\n Cancel\n </button>\n <button className=\"btn btn-primary\" onClick={this.submit} type=\"button\">\n {command.viewState?.submitButtonLabel || 'Clone'}\n </button>\n </Modal.Footer>\n </div>\n );\n }\n}\n","import React from 'react';\n\nimport type { Application, IConfirmationModalParams, IServerGroup, IServerGroupActionsProps } from '@spinnaker/core';\nimport { ConfirmationModalService, ServerGroupWarningMessageService } from '@spinnaker/core';\n\nimport { AppengineHealth } from '../../common/appengineHealth';\nimport { AppengineServerGroupCommandBuilder } from '../configure/serverGroupCommandBuilder.service';\nimport { AppengineCloneServerGroupModal } from '../configure/wizard/AppengineCloneServerGroupModal';\nimport type { IAppengineServerGroup } from '../../domain';\nimport { AppengineServerGroupWriter } from '../writer/serverGroup.write.service';\n\nconst writer = new AppengineServerGroupWriter();\nconst commandBuilder = new AppengineServerGroupCommandBuilder();\n\nexport function canStartOrStopServerGroup(serverGroup: IAppengineServerGroup): boolean {\n return serverGroup.env === 'FLEXIBLE' || ['MANUAL', 'BASIC'].includes(serverGroup.scalingPolicy?.type);\n}\n\nexport function canStartServerGroup(serverGroup: IAppengineServerGroup): boolean {\n return canStartOrStopServerGroup(serverGroup) && serverGroup.servingStatus === 'STOPPED';\n}\n\nexport function canStopServerGroup(serverGroup: IAppengineServerGroup): boolean {\n return canStartOrStopServerGroup(serverGroup) && serverGroup.servingStatus === 'SERVING';\n}\n\nexport function expectedAllocationsAfterDisableOperation(\n serverGroup: IServerGroup,\n loadBalancers: any[] = [],\n): { [key: string]: number } {\n const loadBalancer = loadBalancers.find((toCheck) => {\n return Object.keys(toCheck.split?.allocations || {}).includes(serverGroup.name);\n });\n\n if (!loadBalancer) {\n return null;\n }\n\n const allocations: { [key: string]: number } = { ...loadBalancer.split.allocations };\n delete allocations[serverGroup.name];\n const denominator = Object.values(allocations).reduce((sum, allocation) => sum + allocation, 0);\n if (!denominator) {\n return {};\n }\n\n const precision = loadBalancer.split.shardBy === 'COOKIE' ? 1000 : 100;\n Object.keys(allocations).forEach((serverGroupName) => {\n allocations[serverGroupName] = Math.round((allocations[serverGroupName] / denominator) * precision) / precision;\n });\n return allocations;\n}\n\nexport function canDisableServerGroup(serverGroup: IAppengineServerGroup, loadBalancers: any[] = []): boolean {\n if (!serverGroup || serverGroup.disabled) {\n return false;\n }\n\n return Object.keys(expectedAllocationsAfterDisableOperation(serverGroup, loadBalancers) || {}).length > 0;\n}\n\nexport function canDestroyServerGroup(serverGroup: IAppengineServerGroup, loadBalancers: any[] = []): boolean {\n if (!serverGroup) {\n return false;\n }\n\n return (\n serverGroup.disabled ||\n Object.keys(expectedAllocationsAfterDisableOperation(serverGroup, loadBalancers) || {}).length > 0\n );\n}\n\nfunction buildExpectedAllocationsTable(expectedAllocations: { [key: string]: number }): string {\n const rows = Object.keys(expectedAllocations || {})\n .map(\n (serverGroupName) =>\n `<tr><td>${serverGroupName}</td><td>${expectedAllocations[serverGroupName] * 100}%</td></tr>`,\n )\n .join('');\n\n return `<table class=\"table table-condensed\"><thead><tr><th>Server Group</th><th>Allocation</th></tr></thead><tbody>${rows}</tbody></table>`;\n}\n\nfunction getLoadBalancers(app: Application): any[] {\n return app.getDataSource?.('loadBalancers')?.data || [];\n}\n\nfunction platformHealthParams(app: Application): Partial<IConfirmationModalParams> {\n const params: Partial<IConfirmationModalParams> = {\n platformHealthOnlyShowOverride: app.attributes?.platformHealthOnlyShowOverride,\n platformHealthType: AppengineHealth.PLATFORM,\n interestingHealthProviderNames: [],\n };\n if (app.attributes?.platformHealthOnlyShowOverride && app.attributes?.platformHealthOnly) {\n params.interestingHealthProviderNames = [AppengineHealth.PLATFORM];\n }\n return params;\n}\n\nfunction getDisableBody(serverGroup: IAppengineServerGroup, loadBalancers: any[]): string {\n const expectedAllocations = expectedAllocationsAfterDisableOperation(serverGroup, loadBalancers);\n return `<div class=\"well well-sm\">\n <p>For App Engine, a disable operation sets this server group's allocation to 0% and redistributes traffic to the other enabled server groups.</p>\n <p>If you would like more fine-grained control, edit <b>${\n serverGroup.loadBalancers?.[0]\n }</b> under the <b>Load Balancers</b> tab.</p>\n <div class=\"row\"><div class=\"col-md-12\">${buildExpectedAllocationsTable(expectedAllocations)}</div></div>\n </div>`;\n}\n\nfunction getDestroyBody(app: Application, serverGroup: IAppengineServerGroup, loadBalancers: any[]): string {\n let body = '';\n const params: IConfirmationModalParams = {} as IConfirmationModalParams;\n ServerGroupWarningMessageService.addDestroyWarningMessage(app, serverGroup, params);\n if (params.body) {\n body += params.body;\n }\n if (!serverGroup.disabled) {\n body += `<div class=\"well well-sm\">\n <p>A destroy operation will first disable this server group.</p>\n <p>For App Engine, a disable operation sets this server group's allocation to 0% and redistributes traffic to the other enabled server groups.</p>\n <p>If you would like more fine-grained control, edit <b>${\n serverGroup.loadBalancers?.[0]\n }</b> under the <b>Load Balancers</b> tab.</p>\n <div class=\"row\"><div class=\"col-md-12\">${buildExpectedAllocationsTable(\n expectedAllocationsAfterDisableOperation(serverGroup, loadBalancers),\n )}</div></div>\n </div>`;\n }\n return body;\n}\n\nexport function AppengineServerGroupActions({ app, serverGroup }: IServerGroupActionsProps) {\n const appengineServerGroup = serverGroup as IAppengineServerGroup;\n const loadBalancers = getLoadBalancers(app);\n\n const clone = () => {\n commandBuilder.buildServerGroupCommandFromExisting(app, appengineServerGroup).then((command) => {\n AppengineCloneServerGroupModal.show({ application: app, command, title: `Clone ${serverGroup.name}` });\n });\n };\n\n const start = () =>\n ConfirmationModalService.confirm({\n header: `Really start ${serverGroup.name}?`,\n buttonText: `Start ${serverGroup.name}`,\n account: appengineServerGroup.account,\n taskMonitorConfig: { application: app, title: `Starting ${serverGroup.name}` },\n submitMethod: () => writer.startServerGroup(appengineServerGroup, app),\n askForReason: true,\n ...platformHealthParams(app),\n });\n\n const stop = () =>\n ConfirmationModalService.confirm({\n header: `Really stop ${serverGroup.name}?`,\n buttonText: `Stop ${serverGroup.name}`,\n account: appengineServerGroup.account,\n body: !appengineServerGroup.disabled\n ? `<div class=\"alert alert-danger\"><p>Stopping this server group will scale it down to zero instances.</p><p>This server group is currently serving traffic from <b>${appengineServerGroup.loadBalancers?.[0]}</b>. Traffic directed to this server group after it has been stopped will not be handled.</p></div>`\n : undefined,\n taskMonitorConfig: { application: app, title: `Stopping ${serverGroup.name}` },\n submitMethod: () => writer.stopServerGroup(appengineServerGroup, app),\n askForReason: true,\n ...platformHealthParams(app),\n });\n\n const enable = () =>\n ConfirmationModalService.confirm({\n header: `Really enable ${serverGroup.name}?`,\n buttonText: `Enable ${serverGroup.name}`,\n account: appengineServerGroup.account,\n body: `<div class=\"well well-sm\"><p>Enabling <b>${serverGroup.name}</b> will set its traffic allocation for <b>${appengineServerGroup.loadBalancers?.[0]}</b> to 100%.</p><p>If you would like more fine-grained control, edit <b>${appengineServerGroup.loadBalancers?.[0]}</b> under the <b>Load Balancers</b> tab.</p></div>`,\n taskMonitorConfig: { application: app, title: `Enabling ${serverGroup.name}` },\n submitMethod: (params: any) => writer.enableServerGroup(appengineServerGroup, app, params),\n askForReason: true,\n ...platformHealthParams(app),\n });\n\n const disable = () =>\n ConfirmationModalService.confirm({\n header: `Really disable ${serverGroup.name}?`,\n buttonText: `Disable ${serverGroup.name}`,\n account: appengineServerGroup.account,\n body: getDisableBody(appengineServerGroup, loadBalancers),\n taskMonitorConfig: { application: app, title: `Disabling ${serverGroup.name}` },\n submitMethod: (params: any) => writer.disableServerGroup(appengineServerGroup, app, params),\n askForReason: true,\n ...platformHealthParams(app),\n });\n\n const destroy = () =>\n ConfirmationModalService.confirm({\n header: `Really destroy ${serverGroup.name}?`,\n buttonText: `Destroy ${serverGroup.name}`,\n account: appengineServerGroup.account,\n body: getDestroyBody(app, appengineServerGroup, loadBalancers),\n taskMonitorConfig: { application: app, title: `Destroying ${serverGroup.name}` },\n submitMethod: (params: any) => writer.destroyServerGroup(appengineServerGroup, app, params),\n askForReason: true,\n ...platformHealthParams(app),\n });\n\n return (\n <div className=\"actions\">\n <button className=\"btn btn-sm btn-default\" onClick={clone} type=\"button\">\n Clone\n </button>\n <button\n className=\"btn btn-sm btn-default\"\n disabled={!canStartServerGroup(appengineServerGroup)}\n onClick={start}\n type=\"button\"\n >\n Start\n </button>\n <button\n className=\"btn btn-sm btn-default\"\n disabled={!canStopServerGroup(appengineServerGroup)}\n onClick={stop}\n type=\"button\"\n >\n Stop\n </button>\n <button className=\"btn btn-sm btn-default\" onClick={enable} type=\"button\">\n Enable\n </button>\n <button\n className=\"btn btn-sm btn-default\"\n disabled={!canDisableServerGroup(appengineServerGroup, loadBalancers)}\n onClick={disable}\n type=\"button\"\n >\n Disable\n </button>\n <button\n className=\"btn btn-sm btn-default\"\n disabled={!canDestroyServerGroup(appengineServerGroup, loadBalancers)}\n onClick={destroy}\n type=\"button\"\n >\n Destroy\n </button>\n </div>\n );\n}\n","import type { IApplicationNameValidator, IValidationResult } from '@spinnaker/core';\nimport { ApplicationNameValidator } from '@spinnaker/core';\n\n// See https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version\nclass AppengineApplicationNameValidator implements IApplicationNameValidator {\n public validate(name = ''): IValidationResult {\n const warnings: string[] = [];\n const errors: string[] = [];\n if (name.length) {\n this.validateSpecialCharacters(name, errors);\n this.validateLength(name, warnings, errors);\n }\n return { warnings, errors };\n }\n\n private validateSpecialCharacters(name: string, errors: string[]): void {\n const pattern = /^[a-z0-9]*$/g;\n if (!pattern.test(name)) {\n errors.push('Only numbers and lowercase letters are allowed.');\n }\n }\n\n private validateLength(name: string, warnings: string[], errors: string[]): void {\n if (name.length > 58) {\n errors.push('The maximum length for an App Engine application name is 63 characters.');\n return;\n }\n if (name.length > 48) {\n if (name.length >= 56) {\n warnings.push('You will not be able to include a stack or detail field for clusters.');\n } else {\n const remaining = 56 - name.length;\n warnings.push(`If you plan to include a stack or detail field for clusters, you will only have\n ${remaining} character${remaining > 1 ? 's' : ''} to do so.`);\n }\n }\n }\n}\n\nApplicationNameValidator.registerValidator('appengine', new AppengineApplicationNameValidator());\n","import { CloudProviderRegistry, DeploymentStrategyRegistry } from '@spinnaker/core';\n\nimport './helpContents/appengineHelpContents';\nimport { AppengineInstanceDetails } from './instance/details/AppengineInstanceDetails';\nimport { AppengineCreateLoadBalancerModal } from './loadBalancer/configure/AppengineCreateLoadBalancerModal';\nimport {\n AppengineLoadBalancerActions,\n AppengineLoadBalancerDetailsSection,\n useAppengineLoadBalancerDetails,\n} from './loadBalancer/details';\nimport { AppengineLoadBalancerTransformer } from './loadBalancer/transformer';\nimport logo from './logo/appengine.logo.png';\nimport './pipeline/stages/deployAppengineConfig/deployAppengineConfigStage';\nimport './pipeline/stages/destroyAsg/appengineDestroyAsgStage';\nimport './pipeline/stages/disableAsg/appengineDisableAsgStage';\nimport './pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage';\nimport './pipeline/stages/enableAsg/appengineEnableAsgStage';\nimport './pipeline/stages/shrinkCluster/appengineShrinkClusterStage';\nimport './pipeline/stages/startServerGroup/appengineStartServerGroupStage';\nimport './pipeline/stages/stopServerGroup/appengineStopServerGroupStage';\nimport { AppengineServerGroupCommandBuilder } from './serverGroup/configure/serverGroupCommandBuilder.service';\nimport { AppengineCloneServerGroupModal } from './serverGroup/configure/wizard/AppengineCloneServerGroupModal';\nimport {\n AppengineServerGroupActions,\n appengineServerGroupDetailsGetter,\n AppengineServerGroupDetailsSection,\n} from './serverGroup/details';\nimport { AppengineServerGroupTransformer } from './serverGroup/transformer';\nimport './validation/ApplicationNameValidator';\n\nimport './logo/appengine.logo.less';\n\nCloudProviderRegistry.registerProvider('appengine', {\n name: 'App Engine',\n instance: {\n details: AppengineInstanceDetails,\n },\n serverGroup: {\n transformer: AppengineServerGroupTransformer,\n commandBuilder: AppengineServerGroupCommandBuilder,\n detailsActions: AppengineServerGroupActions,\n detailsGetter: appengineServerGroupDetailsGetter,\n detailsSections: [AppengineServerGroupDetailsSection],\n CloneServerGroupModal: AppengineCloneServerGroupModal,\n skipUpstreamStageCheck: true,\n },\n loadBalancer: {\n transformer: AppengineLoadBalancerTransformer,\n useDetailsHook: useAppengineLoadBalancerDetails,\n detailsActions: AppengineLoadBalancerActions,\n detailsSections: [AppengineLoadBalancerDetailsSection],\n CreateLoadBalancerModal: AppengineCreateLoadBalancerModal,\n },\n logo: {\n path: logo,\n },\n});\n\nDeploymentStrategyRegistry.registerProvider('appengine', ['custom']);\n","import React from 'react';\n\ninterface IAppengineInstanceDetailsProps {\n instance: {\n account: string;\n instanceId: string;\n provider: string;\n region: string;\n };\n}\n\nexport function AppengineInstanceDetails({ instance }: IAppengineInstanceDetailsProps) {\n return (\n <div className=\"details-panel\">\n <div className=\"header\">\n <div className=\"header-text horizontal middle\">\n <i className=\"fa icon-instance\" />\n <h3 className=\"horizontal middle space-between flex-1\">{instance.instanceId}</h3>\n </div>\n </div>\n <div className=\"content\">\n <dl className=\"dl-horizontal dl-narrow\">\n <dt>Account</dt>\n <dd>{instance.account}</dd>\n <dt>Region</dt>\n <dd>{instance.region}</dd>\n <dt>Provider</dt>\n <dd>{instance.provider}</dd>\n </dl>\n </div>\n </div>\n );\n}\n","import { isEmpty } from 'lodash';\nimport { Observable } from 'rxjs';\n\nimport type { IServerGroupDetailsProps } from '@spinnaker/core';\nimport { ServerGroupReader } from '@spinnaker/core';\n\nimport type { IAppengineLoadBalancer, IAppengineServerGroup } from '../../domain';\n\nfunction extractServerGroupSummary(props: IServerGroupDetailsProps): Promise<IAppengineServerGroup> {\n const { app, serverGroup } = props;\n return app.ready().then(() => {\n let summary: IAppengineServerGroup = app.serverGroups.data.find((candidate: IAppengineServerGroup) => {\n return (\n candidate.name === serverGroup.name &&\n candidate.account === serverGroup.accountId &&\n candidate.region === serverGroup.region\n );\n });\n\n if (!summary) {\n app.loadBalancers.data.some((loadBalancer: IAppengineLoadBalancer) => {\n if (loadBalancer.account === serverGroup.accountId && loadBalancer.region === serverGroup.region) {\n return (loadBalancer.serverGroups || []).some((candidate: IAppengineServerGroup) => {\n if (candidate.name === serverGroup.name) {\n summary = candidate;\n return true;\n }\n return false;\n });\n }\n return false;\n });\n }\n\n return summary;\n });\n}\n\nexport function appengineServerGroupDetailsGetter(\n props: IServerGroupDetailsProps,\n autoClose: () => void,\n): Observable<IAppengineServerGroup> {\n const { app, serverGroup: serverGroupInfo } = props;\n return new Observable<IAppengineServerGroup>((observer) => {\n extractServerGroupSummary(props).then((summary) => {\n ServerGroupReader.getServerGroup(\n app.name,\n serverGroupInfo.accountId,\n serverGroupInfo.region,\n serverGroupInfo.name,\n ).then((serverGroup: IAppengineServerGroup) => {\n Object.assign(serverGroup, summary, { account: serverGroupInfo.accountId });\n\n if (!isEmpty(serverGroup)) {\n observer.next(serverGroup);\n } else {\n autoClose();\n }\n }, autoClose);\n }, autoClose);\n });\n}\n","import React from 'react';\n\nimport type { IServerGroupDetailsSectionProps } from '@spinnaker/core';\n\nimport type { IAppengineServerGroup } from '../../domain';\n\nexport function AppengineServerGroupDetailsSection({ serverGroup }: IServerGroupDetailsSectionProps) {\n const appengineServerGroup = serverGroup as IAppengineServerGroup;\n\n return (\n <div className=\"content-section\">\n <div className=\"content-section-heading\">App Engine Details</div>\n <dl className=\"dl-horizontal dl-narrow\">\n <dt>Account</dt>\n <dd>{appengineServerGroup.account}</dd>\n <dt>Region</dt>\n <dd>{appengineServerGroup.region}</dd>\n <dt>Status</dt>\n <dd>{appengineServerGroup.servingStatus || appengineServerGroup.status || 'Unknown'}</dd>\n <dt>Environment</dt>\n <dd>{appengineServerGroup.env || 'Unknown'}</dd>\n <dt>Scaling</dt>\n <dd>{appengineServerGroup.scalingPolicy?.type || 'Unknown'}</dd>\n </dl>\n </div>\n );\n}\n","import { useEffect, useState } from 'react';\n\nimport type { IUseDetailsHookProps, UseDetailsResult } from '@spinnaker/core';\n\nimport type { IAppengineLoadBalancer } from '../../domain';\n\nexport function useAppengineLoadBalancerDetails({\n app,\n loadBalancerParams,\n autoClose,\n}: IUseDetailsHookProps): UseDetailsResult<IAppengineLoadBalancer> {\n const [data, setData] = useState<IAppengineLoadBalancer>();\n const [loading, setLoading] = useState(true);\n\n const refetch = async () => {\n setLoading(true);\n await app.getDataSource('loadBalancers').ready();\n const loadBalancer = app.getDataSource('loadBalancers').data.find((candidate: IAppengineLoadBalancer) => {\n return candidate.name === loadBalancerParams.name && candidate.account === loadBalancerParams.accountId;\n });\n\n setData(loadBalancer);\n setLoading(false);\n\n if (!loadBalancer) {\n autoClose();\n }\n };\n\n useEffect(() => {\n refetch();\n const unsubscribe = app.getDataSource('loadBalancers').onRefresh(refetch);\n return () => unsubscribe();\n }, [loadBalancerParams.name, loadBalancerParams.accountId, loadBalancerParams.region]);\n\n return { data, loading, error: null, refetch };\n}\n","import React from 'react';\n\nimport type { ILoadBalancerDetailsSectionProps } from '@spinnaker/core';\n\nimport type { IAppengineLoadBalancer } from '../../domain';\n\nexport function AppengineLoadBalancerDetailsSection({ loadBalancer }: ILoadBalancerDetailsSectionProps) {\n const appengineLoadBalancer = loadBalancer as IAppengineLoadBalancer;\n const allocations = appengineLoadBalancer.split?.allocations || {};\n\n return (\n <div className=\"content-section\">\n <div className=\"content-section-heading\">Traffic Split</div>\n <dl className=\"dl-horizontal dl-narrow\">\n <dt>Account</dt>\n <dd>{appengineLoadBalancer.account || appengineLoadBalancer.credentials}</dd>\n <dt>Region</dt>\n <dd>{appengineLoadBalancer.region}</dd>\n <dt>Shard By</dt>\n <dd>{appengineLoadBalancer.split?.shardBy || 'Unspecified'}</dd>\n </dl>\n {Object.keys(allocations).length > 0 && (\n <table className=\"table table-condensed\">\n <thead>\n <tr>\n <th>Server Group</th>\n <th>Allocation</th>\n </tr>\n </thead>\n <tbody>\n {Object.entries(allocations).map(([serverGroup, allocation]) => (\n <tr key={serverGroup}>\n <td>{serverGroup}</td>\n <td>{Math.round(allocation * 1000) / 10}%</td>\n </tr>\n ))}\n </tbody>\n </table>\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","mappings":";onCAEqB,CACnB,CACEA,IAAK,0CACLC,MAAO,6MAGT,CACED,IAAK,0CACLC,MAAO,oLAGT,CACED,IAAK,0CACLC,MAAO,qLAGT,CACED,IAAK,+BACLC,MAAO,sFAET,CACED,IAAK,iDACLC,MAAO,qOAIT,CACED,IAAK,wCACLC,MAAO,gTAIT,CACED,IAAK,oCACLC,MAAO,sfAMT,CACED,IAAK,4CACLC,MAAO,mYAMT,CACED,I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AAiM,EAA6B9L,cAAe;AAEhE,OACE2B,EAAAiD,cAAC,OAAIC,UAAU,kDACZ,OAAIA,UAAU,2BAA0B,gCACzClD,EAAAiD,cAAC,MAAGC,UAAU,0DACX,UAAG,0BACJlD,EAAAiD,cAAC,UAAIqX,EAAsBtb,SAAWsb,EAAsBvb,4BAC5DiB,EAAAiD,cAAC,UAAG,yBACJjD,EAAAiD,cAAC,UAAIqX,EAAsBlb,uBAC3BY,EAAAiD,cAAC,UAAG,2BACJjD,EAAAiD,cAAC,WAAI,OAAAqH,EAAAgQ,EAAsBpc,YAAtB,EAAAoM,EAA6B3L,UAAW,gBAE9CmT,OAAO4C,KAAKrW,GAAa0D,OAAS,kBACjC/B,EAAAiD,cAAC,SAAMC,UAAU,wCACflD,EAAAiD,cAAC,4BACCjD,EAAAiD,cAAC,yBACCjD,EAAAiD,cAAC,UAAG,+CACH,UAAG,+BAGRjD,EAAAiD,cAAC,aACE6O,OAAOD,QAAQxT,GAAayE,IAAI,EAAEC,EAAaxE,oBAC9CyB,EAAAiD,cAAC,MAAGvF,IAAKqF,kBACP/C,EAAAiD,cAAC,UAAIF,kBACL/C,EAAAiD,cAAC,UAAItD,KAAKC,MAAmB,IAAbrB,GAAqB,GAAG,SAQxD,GLUIgc,wBAAyB/V,GAE3BgW,KAAM,CACJC,KAAMD,MAIVE,EAA2B3E,iBAAiB,YAAa,CAAC","names":["key","value","forEach","entry","HelpContentsRegistry","register","AppengineLoadBalancerUpsertDescription","convertTrafficSplitToTrafficSplitDescription","split","allocationDescriptions","reduce","allocations","acc","allocation","serverGroupName","concat","locatorType","shardBy","constructor","loadBalancer","this","credentials","account","cloudProvider","loadBalancerName","name","region","migrateTraffic","serverGroups","mapAllocationsToDecimals","splitDescription","description","mapAllocationsToPercentages","Math","round","TARGET_OPTIONS","label","_AppengineCreateLoadBalancerModal","React","Component","super","arguments","state","taskMonitor","TaskMonitor","application","props","app","title","onDismiss","dismissModal","onTaskComplete","getDataSource","refresh","command","buildInitialCommand","update","field","forceUpdate","updateSplit","updateAllocation","index","updateAllocationLocatorType","updated","target","cluster","addAllocation","push","forPipelineConfig","length","removeAllocation","splice","allocationTotal","sum","Number","submit","cloneDeep","closeModal","LoadBalancerWriter","upsertLoadBalancer","show","ReactModal","dialogClassName","slice","map","serverGroup","renderAllocationTarget","createElement","className","checked","onChange","type","event","placeholder","render","isNew","ModalClose","dismiss","Modal","Header","Title","Body","min","onClick","TaskMonitorWrapper","monitor","Footer","disabled","defaultProps","noop","AppengineCreateLoadBalancerModal","canDeleteAppengineLoadBalancer","getDeleteLoadBalancerWarning","serverGroupNames","join","FormikAccountRegionSelector","destroy$","Subject","setRegionList","accountFilter","observableFrom","ready","pipe","takeUntil","subscribe","availableRegions","AppListExtractor","getRegions","sort","setState","accountChanged","credentialsField","componentName","componentDidMount","formik","get","values","componentWillUnmount","next","accounts","FormikFormField","input","ReactSelectInput","stringOptions","clearable","required","_DeployAppengineConfigForm","onTemplateArtifactEdited","artifact","setFieldValue","artifactAccount","onTemplateArtifactSelected","id","removeInputArtifact","getInputArtifact","stage","AccountService","listAccounts","StageArtifactSelectorDelegate","excludedArtifactTypePatterns","excludedArtifactTypes","expectedArtifactId","onArtifactEdited","helpKey","onExpectedArtifactSelected","pipeline","excludeAllTypesExcept","ArtifactTypePatterns","BITBUCKET_FILE","CUSTOM_OBJECT","EMBEDDED_BASE64","GCS_OBJECT","GITHUB_FILE","GITLAB_FILE","S3_OBJECT","HTTP_FILE","ORACLE_OBJECT","DeployAppengineConfigForm","validateDeployAppengineConfigurationStage","formValidator","FormValidator","validateForm","Registry","registerStage","component","updateStage","stageWithDefaults","useMemo","FormikStageConfig","liveStage","validate","producesArtifacts","executionDetailsSections","ExecutionDetailsTasks","ExecutionArtifactTab","validateFn","_AppengineHealth","PLATFORM","AppengineHealth","initializeAppengineServerGroupStage","cloudProviderType","_a","attributes","platformHealthOnlyShowOverride","_b","platformHealthOnly","interestingHealthProviderNames","AppengineServerGroupStageConfig","showHealthOverride","setAccounts","useState","useEffect","then","loadedAccounts","defaultCredentials","appengine","find","getAppengineAccountRegion","strategy","AccountRegionClusterSelector","disableRegionSelect","onAccountUpdate","getAccountDetails","accountDetails","onComponentUpdate","singleRegion","StageConfigField","TargetSelect","model","options","StageConstants","TARGET_LIST","PlatformHealthOverride","platformHealthType","AppengineServerGroupStageConfigWithHealthOverride","FailureMessages","failures","_c","context","exception","details","errors","_d","failureMessages","message","ServerGroupConfigDetails","AppengineStartServerGroupExecutionDetails","ExecutionDetailsSection","current","AppengineStopServerGroupExecutionDetails","AppengineEditLoadBalancerExecutionDetails","loadBalancers","provides","validators","fieldName","fieldLabel","setLoadBalancers","catch","editLoadBalancer","filter","_loadBalancer","i","removeLoadBalancer","colSpan","shrinkToSize","allowDeleteActive","retainLargerOverNewer","toString","style","width","AppengineProviderSettings","SETTINGS","providers","defaults","resetToOriginal","resetProvider","AppengineSourceType","AppengineServerGroupCommandBuilder","getTriggerOptions","triggers","trigger","source","project","slug","branch","master","job","getExpectedArtifacts","expectedArtifacts","buildNewServerGroupCommand","selectedProvider","mode","dataToFetch","getAllAccountDetailsForProvider","storageAccounts","StorageAccountReader","getStorageAccounts","viewState","submitButtonLabel","getSubmitButtonLabel","disableStrategySelection","resolveAll","backingData","getCredentials","getRegion","fromArtifact","configArtifacts","configFilepaths","configFiles","sourceType","buildServerGroupCommandFromExisting","stack","freeFormDetails","detail","buildNewServerGroupCommandForPipeline","_stage","Promise","resolve","triggerOptions","buildServerGroupCommandFromPipeline","accountNames","includes","_account","entries","Object","all","promise","result","AppengineDeployDescription","provider","repositoryUrl","promote","stopPreviousVersion","strategyApplication","strategyPipeline","fromTrigger","gitCredentialType","a","applicationDirectoryRoot","expectedArtifact","storageAccountName","containerImageUrl","suppressVersionString","AppengineServerGroupWriter","cloneServerGroup","TaskExecutor","executeTask","startServerGroup","buildJob","stopServerGroup","enableServerGroup","params","disableServerGroup","destroyServerGroup","writer","_AppengineCloneServerGroupModal","GIT","normalizeAppengineServerGroupCommandForSubmit","AppengineCloneServerGroupModal","commandBuilder","canStartOrStopServerGroup","env","scalingPolicy","canStartServerGroup","servingStatus","canStopServerGroup","expectedAllocationsAfterDisableOperation","toCheck","keys","denominator","precision","canDisableServerGroup","canDestroyServerGroup","buildExpectedAllocationsTable","expectedAllocations","platformHealthParams","getDisableBody","getDestroyBody","body","ServerGroupWarningMessageService","addDestroyWarningMessage","ApplicationNameValidator","registerValidator","warnings","validateSpecialCharacters","validateLength","test","remaining","CloudProviderRegistry","registerProvider","instance","instanceId","transformer","normalizeServerGroup","convertServerGroupCommandToDeployConfiguration","detailsActions","appengineServerGroup","call","data","getLoadBalancers","ConfirmationModalService","confirm","header","buttonText","taskMonitorConfig","submitMethod","askForReason","detailsGetter","autoClose","serverGroupInfo","Observable","observer","summary","candidate","accountId","some","extractServerGroupSummary","ServerGroupReader","getServerGroup","assign","isEmpty","detailsSections","status","CloneServerGroupModal","skipUpstreamStageCheck","normalizeLoadBalancer","instanceCounts","buildInstanceCounts","instances","detachedInstances","transformInstance","activeServerGroups","isDisabled","chain","flatten","convertLoadBalancerForEditing","upToDateLoadBalancer","convertLoadBalancerToUpsertDescription","has","camelCase","health","up","down","outOfService","succeeded","failed","starting","unknown","healthState","useDetailsHook","loadBalancerParams","setData","loading","setLoading","refetch","async","unsubscribe","onRefresh","error","deleteLoadBalancer","appengineLoadBalancer","CreateLoadBalancerModal","logo","path","DeploymentStrategyRegistry"],"ignoreList":[],"sources":["../src/helpContents/appengineHelpContents.ts","../src/loadBalancer/transformer.ts","../src/loadBalancer/configure/AppengineCreateLoadBalancerModal.tsx","../src/loadBalancer/details/AppengineLoadBalancerActions.tsx","../src/common/FormikAccountRegionSelector.tsx","../src/pipeline/stages/deployAppengineConfig/DeployAppengineConfigForm.tsx","../src/pipeline/stages/deployAppengineConfig/DeployAppengineConfigurationConfig.tsx","../src/pipeline/stages/deployAppengineConfig/deployAppengineConfigStage.ts","../src/common/appengineHealth.ts","../src/pipeline/stages/AppengineServerGroupStageConfig.tsx","../src/pipeline/stages/AppengineExecutionDetails.tsx","../src/pipeline/stages/destroyAsg/appengineDestroyAsgStage.ts","../src/pipeline/stages/disableAsg/appengineDisableAsgStage.ts","../src/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.ts","../src/pipeline/stages/editLoadBalancer/AppengineEditLoadBalancerStageConfig.tsx","../src/pipeline/stages/enableAsg/appengineEnableAsgStage.ts","../src/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.ts","../src/pipeline/stages/startServerGroup/appengineStartServerGroupStage.ts","../src/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.ts","../src/appengine.settings.ts","../src/serverGroup/configure/serverGroupCommandBuilder.service.ts","../src/serverGroup/transformer.ts","../src/serverGroup/writer/serverGroup.write.service.ts","../src/serverGroup/configure/wizard/AppengineCloneServerGroupModal.tsx","../src/serverGroup/details/AppengineServerGroupActions.tsx","../src/validation/ApplicationNameValidator.ts","../src/appengine.module.ts","../src/instance/details/AppengineInstanceDetails.tsx","../src/serverGroup/details/appengineServerGroupDetailsGetter.ts","../src/serverGroup/details/AppengineServerGroupDetailsSection.tsx","../src/loadBalancer/details/useAppengineLoadBalancerDetails.ts","../src/loadBalancer/details/AppengineLoadBalancerDetailsSection.tsx"],"sourcesContent":["import { HelpContentsRegistry } from '@spinnaker/core';\n\nconst helpContents = [\n {\n key: 'appengine.serverGroup.gcs.repositoryUrl',\n value: `The full URL to the GCS bucket or TAR file containing the source files for this deployment,\n including 'gs://'. For example, <b>gs://my-bucket/my-app</b> or <b>gs://my-bucket/app.tar</b>.`,\n },\n {\n key: 'appengine.serverGroup.git.repositoryUrl',\n value: `The full URL to the git repository containing the source files for this deployment,\n including protocol. For example, <b>https://github.com/spinnaker/deck.git</b>`,\n },\n {\n key: 'appengine.serverGroup.gitCredentialType',\n value: `The credential type that will be used to access the git repository for this deployment.\n You can configure these credentials alongside your App Engine credentials.`,\n },\n {\n key: 'appengine.serverGroup.branch',\n value: 'The name of the branch in the above git repository to be used for this deployment.',\n },\n {\n key: 'appengine.serverGroup.applicationDirectoryRoot',\n value: `(Optional) Path to the directory root of the application to be deployed,\n starting from the root of the git repository. This is the directory from which\n <code>gcloud app deploy</code> will be run.`,\n },\n {\n key: 'appengine.serverGroup.configFilepaths',\n value: `Paths to App Engine application configuration files, starting from the application directory root,\n specified above. In most cases, this will be <code>app.yaml</code> or <code>cron.yaml</code>,\n but could be <code>path/to/app.yaml</code> or <code>path/to/cron.yaml</code>.`,\n },\n {\n key: 'appengine.serverGroup.configFiles',\n value: `<p>(Optional) The contents of an App Engine config file (e.g., an <code>app.yaml</code> or\n <code>cron.yaml</code> file). These files should not conflict with the config filepaths above:\n if you include, for example, the contents of an <code>app.yaml</code>\n file here, you should <b>not</b> specify the file path to an <code>app.yaml</code> above.<br></p>\n <p>If this is a pipeline stage, you can use Spinnaker Pipeline Expressions here.</p>`,\n },\n {\n key: 'appengine.serverGroup.configFilesRequired',\n value: `<p>The contents of an App Engine config file (e.g., an <code>app.yaml</code> or\n <code>cron.yaml</code> file).</p>\n <p>An <code>app.yaml</code> file is required and must have <code>runtime: custom</code> in\n order to deploy successfully.</p>\n <p>If this is a pipeline stage, you can use Spinnaker Pipeline Expressions here.</p>`,\n },\n {\n key: 'appengine.serverGroup.matchBranchOnRegex',\n value: `(Optional) A Jenkins trigger may produce details from multiple repositories and branches.\n Spinnaker will use the regex specified here to help resolve a branch for the deployment.\n If Spinnaker cannot resolve exactly one branch from the trigger, this pipeline will fail.`,\n },\n {\n key: 'appengine.serverGroup.promote',\n value: 'If selected, the newly deployed server group will receive all traffic.',\n },\n {\n key: 'appengine.serverGroup.stopPreviousVersion',\n value: `If selected, the previously running server group in this server group's <b>service</b>\n (Spinnaker load balancer) will be stopped. This option will be respected only if this server group will\n be receiving all traffic and the previous server group is using manual scaling.`,\n },\n {\n key: 'appengine.serverGroup.containerImageUrl',\n value: `The full URL to the container image to use for deployment. The URL must be one of the valid GCR hostnames,\n for example <b>gcr.io/my-project/image:tag</b>`,\n },\n {\n key: 'appengine.serverGroup.suppress-version-string',\n value: `Spinnaker automatically versions your server groups. This means deployments through Spinnaker receive a\n short version string at the end of their name, like \"v001\". In most cases you will want to keep this\n version as part of the name. Preventing this string from being added to your server group will stop\n it from being considered when rolling back, promoting new versions or executing deployment strategies.\n If you are certain that you do not want the version string applied to this server group then check\n this box.`,\n },\n {\n key: 'appengine.loadBalancer.shardBy.cookie',\n value:\n 'Diversion based on a specially named cookie, \"GOOGAPPUID.\" The cookie must be set by the application itself or no diversion will occur.',\n },\n {\n key: 'appengine.loadBalancer.shardBy.ip',\n value: 'Diversion based on applying the modulus operation to a fingerprint of the IP address.',\n },\n {\n key: 'appengine.loadBalancer.migrateTraffic',\n value: `If selected, traffic will be gradually shifted to a single version. For gradual traffic migration,\n the target version must be located within instances that are configured for\n both warmup requests and automatic scaling.\n Gradual traffic migration is not supported in the App Engine flexible environment.`,\n },\n {\n key: 'appengine.loadBalancer.allocations',\n value: 'An allocation is the percent of traffic directed to a server group.',\n },\n {\n key: 'appengine.loadBalancer.textLocator',\n value: `Either the name of a server group, or a Spinnaker Pipeline Expression\n that resolves to the name of a server group.`,\n },\n {\n key: 'appengine.instance.availability',\n value: `\n An instance's <b>availability</b> is determined by its version (Spinnaker server group).\n <ul>\n <li>Manual scaling versions use resident instances</li>\n <li>Basic scaling versions use dynamic instances</li>\n <li>Auto scaling versions use dynamic instances - but if you specify a number, N,\n of minimum idle instances, the first N instances will be resident,\n and additional dynamic instances will be created as necessary.\n </li>\n </ul>`,\n },\n {\n key: 'appengine.instance.averageLatency',\n value: 'Average latency over the last minute in milliseconds.',\n },\n {\n key: 'appengine.instance.vmStatus',\n value: 'Status of the virtual machine where this instance lives.',\n },\n {\n key: 'appengine.instance.qps',\n value: 'Average queries per second over the last minute.',\n },\n {\n key: 'appengine.instance.errors',\n value: 'Number of errors since this instance was started.',\n },\n {\n key: 'appengine.instance.requests',\n value: 'Number of requests since this instance was started.',\n },\n];\n\nhelpContents.forEach((entry) => HelpContentsRegistry.register(entry.key, entry.value));\n","import { camelCase, chain, cloneDeep, filter, get, has, reduce } from 'lodash';\n\nimport type {\n Application,\n IInstance,\n IInstanceCounts,\n ILoadBalancer,\n ILoadBalancerUpsertCommand,\n IServerGroup,\n} from '@spinnaker/core';\nimport type { IAppengineLoadBalancer, IAppengineTrafficSplit, ShardBy } from '../domain/index';\n\nexport interface IAppengineAllocationDescription {\n serverGroupName?: string;\n target?: string;\n cluster?: string;\n allocation: number;\n locatorType: 'fromExisting' | 'targetCoordinate' | 'text';\n}\n\nexport interface IAppengineTrafficSplitDescription {\n shardBy: ShardBy;\n allocationDescriptions: IAppengineAllocationDescription[];\n}\n\nexport class AppengineLoadBalancerUpsertDescription implements ILoadBalancerUpsertCommand, IAppengineLoadBalancer {\n public credentials: string;\n public account: string;\n public loadBalancerName: string;\n public name: string;\n public splitDescription: IAppengineTrafficSplitDescription;\n public split?: IAppengineTrafficSplit;\n public migrateTraffic: boolean;\n public region: string;\n public cloudProvider: string;\n public serverGroups?: any[];\n\n public static convertTrafficSplitToTrafficSplitDescription(\n split: IAppengineTrafficSplit,\n ): IAppengineTrafficSplitDescription {\n const allocationDescriptions = reduce(\n split.allocations,\n (acc: IAppengineAllocationDescription[], allocation: number, serverGroupName: string) => {\n return acc.concat({ serverGroupName, allocation, locatorType: 'fromExisting' });\n },\n [],\n );\n\n return { shardBy: split.shardBy, allocationDescriptions };\n }\n\n constructor(loadBalancer: IAppengineLoadBalancer) {\n this.credentials = loadBalancer.account || loadBalancer.credentials;\n this.account = this.credentials;\n this.cloudProvider = loadBalancer.cloudProvider;\n this.loadBalancerName = loadBalancer.name;\n this.name = loadBalancer.name;\n this.region = loadBalancer.region;\n this.migrateTraffic = loadBalancer.migrateTraffic || false;\n this.serverGroups = loadBalancer.serverGroups;\n }\n\n public mapAllocationsToDecimals() {\n this.splitDescription.allocationDescriptions.forEach((description) => {\n description.allocation = description.allocation / 100;\n });\n }\n\n public mapAllocationsToPercentages() {\n this.splitDescription.allocationDescriptions.forEach((description) => {\n // An allocation percent has at most one decimal place.\n description.allocation = Math.round(description.allocation * 1000) / 10;\n });\n }\n}\n\nexport class AppengineLoadBalancerTransformer {\n public normalizeLoadBalancer(loadBalancer: ILoadBalancer): Promise<ILoadBalancer> {\n loadBalancer.provider = loadBalancer.type;\n loadBalancer.instanceCounts = this.buildInstanceCounts(loadBalancer.serverGroups);\n loadBalancer.instances = [];\n loadBalancer.serverGroups.forEach((serverGroup) => {\n serverGroup.account = loadBalancer.account;\n serverGroup.region = loadBalancer.region;\n\n if (serverGroup.detachedInstances) {\n serverGroup.detachedInstances = (serverGroup.detachedInstances as any).map((id: string) => ({ id }));\n }\n serverGroup.instances = serverGroup.instances\n .concat(serverGroup.detachedInstances || [])\n .map((instance: any) => this.transformInstance(instance, loadBalancer));\n });\n\n const activeServerGroups = filter(loadBalancer.serverGroups, { isDisabled: false });\n loadBalancer.instances = chain(activeServerGroups).map('instances').flatten().value() as IInstance[];\n return Promise.resolve(loadBalancer);\n }\n\n public convertLoadBalancerForEditing(\n loadBalancer: IAppengineLoadBalancer,\n application: Application,\n ): Promise<IAppengineLoadBalancer> {\n return application\n .getDataSource('loadBalancers')\n .ready()\n .then(() => {\n const upToDateLoadBalancer = application\n .getDataSource('loadBalancers')\n .data.find((candidate: ILoadBalancer) => {\n return (\n candidate.name === loadBalancer.name &&\n (candidate.account === loadBalancer.account || candidate.account === loadBalancer.credentials)\n );\n });\n\n if (upToDateLoadBalancer) {\n loadBalancer.serverGroups = cloneDeep(upToDateLoadBalancer.serverGroups);\n }\n return loadBalancer;\n });\n }\n\n public convertLoadBalancerToUpsertDescription(\n loadBalancer: IAppengineLoadBalancer,\n ): AppengineLoadBalancerUpsertDescription {\n return new AppengineLoadBalancerUpsertDescription(loadBalancer);\n }\n\n private buildInstanceCounts(serverGroups: IServerGroup[]): IInstanceCounts {\n const instanceCounts: IInstanceCounts = chain(serverGroups)\n .map('instances')\n .flatten()\n .reduce(\n (acc: IInstanceCounts, instance: any) => {\n if (has(instance, 'health.state')) {\n acc[camelCase(instance.health.state)]++;\n }\n return acc;\n },\n { up: 0, down: 0, outOfService: 0, succeeded: 0, failed: 0, starting: 0, unknown: 0 },\n )\n .value();\n\n instanceCounts.outOfService += chain(serverGroups).map('detachedInstances').flatten().value().length;\n return instanceCounts;\n }\n\n private transformInstance(instance: any, loadBalancer: ILoadBalancer) {\n instance.provider = loadBalancer.type;\n instance.account = loadBalancer.account;\n instance.region = loadBalancer.region;\n instance.loadBalancers = [loadBalancer.name];\n const health = instance.health || {};\n instance.healthState = get(instance, 'health.state') || 'OutOfService';\n instance.health = [health];\n\n return instance as IInstance;\n }\n}\n","import { cloneDeep } from 'lodash';\nimport React from 'react';\nimport { Modal } from 'react-bootstrap';\n\nimport type { ILoadBalancerModalProps } from '@spinnaker/core';\nimport { LoadBalancerWriter, ModalClose, noop, ReactModal, TaskMonitor, TaskMonitorWrapper } from '@spinnaker/core';\n\nimport type { IAppengineLoadBalancer } from '../../domain';\nimport type { IAppengineAllocationDescription } from '../transformer';\nimport { AppengineLoadBalancerUpsertDescription } from '../transformer';\n\nconst TARGET_OPTIONS = [\n { label: 'Current Server Group', value: 'current_asg_dynamic' },\n { label: 'Previous Server Group', value: 'ancestor_asg_dynamic' },\n { label: 'Oldest Server Group', value: 'oldest_asg_dynamic' },\n];\n\nexport function updateAllocationLocatorType(\n allocation: IAppengineAllocationDescription,\n locatorType: IAppengineAllocationDescription['locatorType'],\n): IAppengineAllocationDescription {\n const updated = { ...allocation, locatorType };\n if (locatorType === 'targetCoordinate') {\n delete updated.serverGroupName;\n updated.target = updated.target || TARGET_OPTIONS[0].value;\n } else {\n delete updated.cluster;\n delete updated.target;\n }\n return updated;\n}\n\ninterface IAppengineCreateLoadBalancerModalState {\n taskMonitor: TaskMonitor;\n}\n\nexport class AppengineCreateLoadBalancerModal extends React.Component<\n ILoadBalancerModalProps,\n IAppengineCreateLoadBalancerModalState\n> {\n public static defaultProps: Partial<ILoadBalancerModalProps> = {\n closeModal: noop,\n dismissModal: noop,\n };\n\n public static show(props: ILoadBalancerModalProps & { isNew?: boolean }): Promise<IAppengineLoadBalancer> {\n return ReactModal.show(AppengineCreateLoadBalancerModal, props, { dialogClassName: 'modal-lg' });\n }\n\n public state: IAppengineCreateLoadBalancerModalState = {\n taskMonitor: new TaskMonitor({\n application: this.props.app,\n title: 'Updating your load balancer',\n onDismiss: () => this.props.dismissModal(),\n onTaskComplete: () => this.props.app.getDataSource('loadBalancers').refresh(),\n }),\n };\n\n private command: AppengineLoadBalancerUpsertDescription = this.buildInitialCommand();\n\n private buildInitialCommand(): AppengineLoadBalancerUpsertDescription {\n const loadBalancer = (this.props.loadBalancer || {}) as IAppengineLoadBalancer;\n const command = new AppengineLoadBalancerUpsertDescription({\n ...loadBalancer,\n account: loadBalancer.account || loadBalancer.credentials,\n credentials: loadBalancer.credentials || loadBalancer.account,\n name: loadBalancer.name,\n region: loadBalancer.region,\n serverGroups: loadBalancer.serverGroups || [],\n cloudProvider: 'appengine',\n migrateTraffic: loadBalancer.migrateTraffic || false,\n } as IAppengineLoadBalancer);\n\n command.splitDescription = loadBalancer.splitDescription ||\n (loadBalancer.split &&\n AppengineLoadBalancerUpsertDescription.convertTrafficSplitToTrafficSplitDescription(loadBalancer.split)) || {\n shardBy: 'UNSPECIFIED',\n allocationDescriptions: (loadBalancer.serverGroups || []).slice(0, 1).map((serverGroup) => ({\n allocation: 100,\n locatorType: 'fromExisting',\n serverGroupName: serverGroup.name,\n })),\n };\n command.mapAllocationsToPercentages();\n\n return command;\n }\n\n private update = (field: keyof IAppengineLoadBalancer, value: any) => {\n (this.command as any)[field] = value;\n this.forceUpdate();\n };\n\n private updateSplit = (field: string, value: any) => {\n (this.command.splitDescription as any)[field] = value;\n this.forceUpdate();\n };\n\n private updateAllocation = (index: number, field: string, value: any) => {\n (this.command.splitDescription.allocationDescriptions[index] as any)[field] = value;\n this.forceUpdate();\n };\n\n private updateAllocationLocatorType = (\n index: number,\n locatorType: IAppengineAllocationDescription['locatorType'],\n ) => {\n this.command.splitDescription.allocationDescriptions[index] = updateAllocationLocatorType(\n this.command.splitDescription.allocationDescriptions[index],\n locatorType,\n );\n this.forceUpdate();\n };\n\n private addAllocation = () => {\n this.command.splitDescription.allocationDescriptions.push({\n allocation: 0,\n locatorType: this.props.forPipelineConfig ? 'text' : 'fromExisting',\n serverGroupName: '',\n });\n if (this.command.splitDescription.allocationDescriptions.length > 1 && !this.command.splitDescription.shardBy) {\n this.command.splitDescription.shardBy = 'IP';\n }\n this.forceUpdate();\n };\n\n private removeAllocation = (index: number) => {\n this.command.splitDescription.allocationDescriptions.splice(index, 1);\n this.forceUpdate();\n };\n\n private allocationTotal = () => {\n return this.command.splitDescription.allocationDescriptions.reduce((sum, description) => {\n return sum + Number(description.allocation || 0);\n }, 0);\n };\n\n private submit = () => {\n const description = cloneDeep(this.command);\n description.mapAllocationsToDecimals();\n delete description.serverGroups;\n\n if (this.props.forPipelineConfig) {\n this.props.closeModal(description as any);\n return;\n }\n\n this.state.taskMonitor.submit(() => LoadBalancerWriter.upsertLoadBalancer(description, this.props.app, 'Update'));\n };\n\n private renderAllocationTarget(allocation: IAppengineAllocationDescription, index: number) {\n if (!this.props.forPipelineConfig) {\n return (\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.updateAllocation(index, 'serverGroupName', event.target.value)}\n value={allocation.serverGroupName || ''}\n />\n );\n }\n\n return (\n <div>\n <div className=\"radio\">\n <label>\n <input\n checked={allocation.locatorType === 'text'}\n onChange={() => this.updateAllocationLocatorType(index, 'text')}\n type=\"radio\"\n />{' '}\n Text input\n </label>\n </div>\n <div className=\"radio\">\n <label>\n <input\n checked={allocation.locatorType === 'targetCoordinate'}\n onChange={() => this.updateAllocationLocatorType(index, 'targetCoordinate')}\n type=\"radio\"\n />{' '}\n Target coordinate\n </label>\n </div>\n <div className=\"radio\">\n <label>\n <input\n checked={allocation.locatorType === 'fromExisting'}\n onChange={() => this.updateAllocationLocatorType(index, 'fromExisting')}\n type=\"radio\"\n />{' '}\n Existing server group\n </label>\n </div>\n {allocation.locatorType === 'targetCoordinate' ? (\n <div>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.updateAllocation(index, 'cluster', event.target.value)}\n placeholder=\"Cluster\"\n value={allocation.cluster || ''}\n />\n <select\n className=\"form-control input-sm\"\n onChange={(event) => this.updateAllocation(index, 'target', event.target.value)}\n value={allocation.target || TARGET_OPTIONS[0].value}\n >\n {TARGET_OPTIONS.map((target) => (\n <option key={target.value} value={target.value}>\n {target.label}\n </option>\n ))}\n </select>\n </div>\n ) : (\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.updateAllocation(index, 'serverGroupName', event.target.value)}\n placeholder={allocation.locatorType === 'text' ? 'Server group expression or name' : 'Server group'}\n value={allocation.serverGroupName || ''}\n />\n )}\n </div>\n );\n }\n\n public render() {\n const { dismissModal, isNew } = this.props as ILoadBalancerModalProps & { isNew?: boolean };\n\n return (\n <div>\n <ModalClose dismiss={dismissModal} />\n <Modal.Header>\n <Modal.Title>{isNew ? 'Create' : 'Edit'} App Engine Load Balancer</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <div className=\"form-horizontal\">\n <label>Name</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.update('name', event.target.value)}\n value={this.command.name || ''}\n />\n <label>Account</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => {\n this.update('credentials', event.target.value);\n this.update('account', event.target.value);\n }}\n value={this.command.credentials || this.command.account || ''}\n />\n <label>Region</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.update('region', event.target.value)}\n value={this.command.region || ''}\n />\n <div className=\"checkbox\">\n <label>\n <input\n checked={!!this.command.migrateTraffic}\n onChange={(event) => this.update('migrateTraffic', event.target.checked)}\n type=\"checkbox\"\n />{' '}\n Migrate traffic\n </label>\n </div>\n {(this.command.splitDescription.allocationDescriptions.length > 1 || this.command.migrateTraffic) && (\n <div>\n <label>Shard By</label>\n <select\n className=\"form-control input-sm\"\n onChange={(event) => this.updateSplit('shardBy', event.target.value)}\n value={this.command.splitDescription.shardBy || 'UNSPECIFIED'}\n >\n <option value=\"UNSPECIFIED\">Unspecified</option>\n <option value=\"IP\">IP</option>\n <option value=\"COOKIE\">Cookie</option>\n </select>\n </div>\n )}\n <label>Allocations</label>\n <table className=\"table table-condensed\">\n <thead>\n <tr>\n <th>Server Group</th>\n <th>Allocation %</th>\n <th />\n </tr>\n </thead>\n <tbody>\n {this.command.splitDescription.allocationDescriptions.map((allocation, index) => (\n <tr key={index}>\n <td>{this.renderAllocationTarget(allocation, index)}</td>\n <td>\n <input\n className=\"form-control input-sm\"\n min={0}\n onChange={(event) => this.updateAllocation(index, 'allocation', Number(event.target.value))}\n type=\"number\"\n value={allocation.allocation || 0}\n />\n </td>\n <td>\n <button\n className=\"btn btn-sm btn-link\"\n onClick={() => this.removeAllocation(index)}\n type=\"button\"\n >\n <span className=\"glyphicon glyphicon-trash\" />\n </button>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n <button className=\"btn btn-block btn-sm add-new\" onClick={this.addAllocation} type=\"button\">\n <span className=\"glyphicon glyphicon-plus-sign\" /> Add allocation\n </button>\n {this.allocationTotal() !== 100 && (\n <div className=\"alert alert-warning\">Traffic allocations must add up to 100%.</div>\n )}\n </div>\n </Modal.Body>\n <TaskMonitorWrapper monitor={this.state.taskMonitor} />\n <Modal.Footer>\n <button className=\"btn btn-default\" onClick={() => dismissModal()} type=\"button\">\n Cancel\n </button>\n <button\n className=\"btn btn-primary\"\n disabled={this.allocationTotal() !== 100}\n onClick={this.submit}\n type=\"button\"\n >\n {isNew ? 'Create' : 'Done'}\n </button>\n </Modal.Footer>\n </div>\n );\n }\n}\n","import React from 'react';\n\nimport type { ILoadBalancerActionsProps, ILoadBalancerDeleteCommand } from '@spinnaker/core';\nimport { ConfirmationModalService, LoadBalancerWriter } from '@spinnaker/core';\n\nimport { AppengineCreateLoadBalancerModal } from '../configure/AppengineCreateLoadBalancerModal';\n\nexport function canDeleteAppengineLoadBalancer(loadBalancer: any): boolean {\n return loadBalancer.name !== 'default';\n}\n\nexport function getDeleteLoadBalancerWarning(loadBalancer: any): string {\n const serverGroupNames = (loadBalancer.serverGroups || []).map((serverGroup: any) => serverGroup.name);\n if (!serverGroupNames.length) {\n return null;\n }\n\n if (serverGroupNames.length === 1) {\n return `<div class=\"alert alert-warning\"><p>Deleting <b>${loadBalancer.name}</b> will destroy <b>${serverGroupNames[0]}</b>.</p></div>`;\n }\n\n return `<div class=\"alert alert-warning\"><p>Deleting <b>${\n loadBalancer.name\n }</b> will destroy the following server groups:<ul>${serverGroupNames\n .map((name: string) => `<li>${name}</li>`)\n .join('')}</ul></p></div>`;\n}\n\nexport function AppengineLoadBalancerActions({ app, loadBalancer }: ILoadBalancerActionsProps) {\n const deleteLoadBalancer = () => {\n const command: ILoadBalancerDeleteCommand = {\n cloudProvider: loadBalancer.cloudProvider,\n loadBalancerName: loadBalancer.name,\n credentials: loadBalancer.account,\n };\n\n ConfirmationModalService.confirm({\n header: `Really delete ${loadBalancer.name}?`,\n buttonText: `Delete ${loadBalancer.name}`,\n body: getDeleteLoadBalancerWarning(loadBalancer),\n account: loadBalancer.account,\n taskMonitorConfig: { application: app, title: `Deleting ${loadBalancer.name}` },\n submitMethod: () => LoadBalancerWriter.deleteLoadBalancer(command, app),\n });\n };\n\n return (\n <div className=\"actions\">\n <button\n className=\"btn btn-sm btn-default\"\n onClick={() => AppengineCreateLoadBalancerModal.show({ app, loadBalancer, isNew: false })}\n type=\"button\"\n >\n Edit\n </button>\n <button\n className=\"btn btn-sm btn-default\"\n disabled={!canDeleteAppengineLoadBalancer(loadBalancer)}\n onClick={deleteLoadBalancer}\n type=\"button\"\n >\n Delete\n </button>\n </div>\n );\n}\n","import type { FormikProps } from 'formik';\nimport { get } from 'lodash';\nimport React from 'react';\nimport { from as observableFrom, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport type { Application, IAccount, IServerGroup, IServerGroupFilter, IStage } from '@spinnaker/core';\nimport { AppListExtractor, FormikFormField, ReactSelectInput } from '@spinnaker/core';\n\nexport interface IFormikAccountRegionSelectorProps {\n accounts: IAccount[];\n application: Application;\n cloudProvider: string;\n componentName?: string;\n credentialsField?: string;\n formik: FormikProps<IStage>;\n}\n\nexport interface IFormikAccountRegionSelectorState {\n availableRegions: string[];\n cloudProvider: string;\n componentName: string;\n credentialsField: string;\n}\n\nexport class FormikAccountRegionSelector extends React.Component<\n IFormikAccountRegionSelectorProps,\n IFormikAccountRegionSelectorState\n> {\n private destroy$ = new Subject<void>();\n\n constructor(props: IFormikAccountRegionSelectorProps) {\n super(props);\n const credentialsField = props.credentialsField || 'credentials';\n this.state = {\n availableRegions: [],\n cloudProvider: props.cloudProvider,\n componentName: props.componentName || '',\n credentialsField,\n };\n }\n\n public componentDidMount(): void {\n const { componentName, formik } = this.props;\n const { credentialsField } = this.state;\n const credentials = get(\n formik.values,\n componentName ? `${componentName}.${credentialsField}` : `${credentialsField}`,\n undefined,\n );\n this.setRegionList(credentials);\n }\n\n public componentWillUnmount(): void {\n this.destroy$.next();\n }\n\n private setRegionList = (credentials: string): void => {\n const { application } = this.props;\n const accountFilter: IServerGroupFilter = (serverGroup: IServerGroup) =>\n serverGroup ? serverGroup.account === credentials : true;\n observableFrom(application.ready())\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n const availableRegions = AppListExtractor.getRegions([application], accountFilter);\n availableRegions.sort();\n this.setState({ availableRegions });\n });\n };\n\n public accountChanged = (credentials: string): void => {\n this.setRegionList(credentials);\n };\n\n public render() {\n const { accounts } = this.props;\n const { credentialsField, availableRegions, componentName } = this.state;\n return (\n <div className=\"col-md-9\">\n <div className=\"sp-margin-m-bottom\">\n <FormikFormField\n name={componentName ? `${componentName}.${credentialsField}` : `${credentialsField}`}\n label=\"Account\"\n input={(props) => (\n <ReactSelectInput\n {...props}\n stringOptions={accounts && accounts.map((acc: IAccount) => acc.name)}\n clearable={false}\n />\n )}\n onChange={this.accountChanged}\n required={true}\n />\n </div>\n\n <div className=\"sp-margin-m-bottom\">\n <FormikFormField\n name={componentName ? `${componentName}.region` : 'region'}\n label=\"Region\"\n input={(props) => <ReactSelectInput {...props} stringOptions={availableRegions} clearable={false} />}\n required={true}\n />\n </div>\n </div>\n );\n }\n}\n","import React from 'react';\nimport { from as observableFrom, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport type { IAccount, IArtifact, IExpectedArtifact, IFormikStageConfigInjectedProps } from '@spinnaker/core';\nimport {\n AccountService,\n ArtifactTypePatterns,\n excludeAllTypesExcept,\n StageArtifactSelectorDelegate,\n} from '@spinnaker/core';\nimport { FormikAccountRegionSelector } from '../../../common/FormikAccountRegionSelector';\n\nexport interface IAppEngineDeployConfigSettingsState {\n accounts: IAccount[];\n}\n\nexport class DeployAppengineConfigForm extends React.Component<\n IFormikStageConfigInjectedProps,\n IAppEngineDeployConfigSettingsState\n> {\n private static readonly excludedArtifactTypes = excludeAllTypesExcept(\n ArtifactTypePatterns.BITBUCKET_FILE,\n ArtifactTypePatterns.CUSTOM_OBJECT,\n ArtifactTypePatterns.EMBEDDED_BASE64,\n ArtifactTypePatterns.GCS_OBJECT,\n ArtifactTypePatterns.GITHUB_FILE,\n ArtifactTypePatterns.GITLAB_FILE,\n ArtifactTypePatterns.S3_OBJECT,\n ArtifactTypePatterns.HTTP_FILE,\n ArtifactTypePatterns.ORACLE_OBJECT,\n );\n\n private destroy$ = new Subject<void>();\n public state: IAppEngineDeployConfigSettingsState = {\n accounts: [],\n };\n\n public componentDidMount() {\n observableFrom(AccountService.listAccounts('appengine'))\n .pipe(takeUntil(this.destroy$))\n .subscribe((accounts) => this.setState({ accounts }));\n }\n\n private onTemplateArtifactEdited = (artifact: IArtifact, name: string) => {\n this.props.formik.setFieldValue(`${name}.id`, null);\n this.props.formik.setFieldValue(`${name}.artifact`, artifact);\n this.props.formik.setFieldValue(`${name}.account`, artifact.artifactAccount);\n };\n\n private onTemplateArtifactSelected = (id: string, name: string) => {\n this.props.formik.setFieldValue(`${name}.id`, id);\n this.props.formik.setFieldValue(`${name}.artifact`, null);\n };\n\n private removeInputArtifact = (name: string) => {\n this.props.formik.setFieldValue(name, null);\n };\n\n private getInputArtifact = (stage: any, name: string) => {\n if (!stage[name]) {\n return {\n account: '',\n id: '',\n };\n } else {\n return stage[name];\n }\n };\n\n public render() {\n const stage = this.props.formik.values;\n const accounts = this.state.accounts;\n return (\n <div>\n <div className=\"col-md-offset-0 col-md-9\">\n <h4>Basic Settings</h4>\n </div>\n <div>\n <FormikAccountRegionSelector\n componentName={''}\n accounts={accounts}\n application={this.props.application}\n cloudProvider={'appengine'}\n credentialsField={'account'}\n formik={this.props.formik}\n />\n </div>\n <div className=\"col-md-offset-0 col-md-9\">\n <h4>Configuration Settings</h4>\n </div>\n <div>\n <div className=\"col-md-offset-1 col-md-9\">\n <StageArtifactSelectorDelegate\n artifact={this.getInputArtifact(stage, 'cronArtifact').artifact}\n excludedArtifactTypePatterns={DeployAppengineConfigForm.excludedArtifactTypes}\n expectedArtifactId={this.getInputArtifact(stage, 'cronArtifact').id}\n label=\"Cron Artifact\"\n onArtifactEdited={(artifact) => {\n this.onTemplateArtifactEdited(artifact, 'cronArtifact');\n }}\n helpKey={''}\n onExpectedArtifactSelected={(artifact: IExpectedArtifact) =>\n this.onTemplateArtifactSelected(artifact.id, 'cronArtifact')\n }\n pipeline={this.props.pipeline}\n stage={stage}\n />\n </div>\n <div className=\"col-md-1\">\n <div className=\"form-control-static\">\n <button onClick={() => this.removeInputArtifact('cronArtifact')}>\n <span className=\"glyphicon glyphicon-trash\" />\n <span className=\"sr-only\">Remove field</span>\n </button>\n </div>\n </div>\n </div>\n <div>\n <div className=\"col-md-offset-1 col-md-9\">\n <StageArtifactSelectorDelegate\n artifact={this.getInputArtifact(stage, 'dispatchArtifact').artifact}\n excludedArtifactTypePatterns={DeployAppengineConfigForm.excludedArtifactTypes}\n expectedArtifactId={this.getInputArtifact(stage, 'dispatchArtifact').id}\n label=\"Dispatch Artifact\"\n onArtifactEdited={(artifact) => {\n this.onTemplateArtifactEdited(artifact, 'dispatchArtifact');\n }}\n helpKey={''}\n onExpectedArtifactSelected={(artifact: IExpectedArtifact) =>\n this.onTemplateArtifactSelected(artifact.id, 'dispatchArtifact')\n }\n pipeline={this.props.pipeline}\n stage={stage}\n />\n </div>\n <div className=\"col-md-1\">\n <div className=\"form-control-static\">\n <button onClick={() => this.removeInputArtifact('dispatchArtifact')}>\n <span className=\"glyphicon glyphicon-trash\" />\n <span className=\"sr-only\">Remove field</span>\n </button>\n </div>\n </div>\n </div>\n <div>\n <div className=\"col-md-offset-1 col-md-9\">\n <StageArtifactSelectorDelegate\n artifact={this.getInputArtifact(stage, 'indexArtifact').artifact}\n excludedArtifactTypePatterns={DeployAppengineConfigForm.excludedArtifactTypes}\n expectedArtifactId={this.getInputArtifact(stage, 'indexArtifact').id}\n label=\"Index Artifact\"\n onArtifactEdited={(artifact) => {\n this.onTemplateArtifactEdited(artifact, 'indexArtifact');\n }}\n helpKey={''}\n onExpectedArtifactSelected={(artifact: IExpectedArtifact) =>\n this.onTemplateArtifactSelected(artifact.id, 'indexArtifact')\n }\n pipeline={this.props.pipeline}\n stage={stage}\n />\n </div>\n <div className=\"col-md-1\">\n <div className=\"form-control-static\">\n <button onClick={() => this.removeInputArtifact('indexArtifact')}>\n <span className=\"glyphicon glyphicon-trash\" />\n <span className=\"sr-only\">Remove field</span>\n </button>\n </div>\n </div>\n </div>\n <div>\n <div className=\"col-md-offset-1 col-md-9\">\n <StageArtifactSelectorDelegate\n artifact={this.getInputArtifact(stage, 'queueArtifact').artifact}\n excludedArtifactTypePatterns={DeployAppengineConfigForm.excludedArtifactTypes}\n expectedArtifactId={this.getInputArtifact(stage, 'queueArtifact').id}\n label=\"Queue Artifact\"\n onArtifactEdited={(artifact) => {\n this.onTemplateArtifactEdited(artifact, 'queueArtifact');\n }}\n helpKey={''}\n onExpectedArtifactSelected={(artifact: IExpectedArtifact) =>\n this.onTemplateArtifactSelected(artifact.id, 'queueArtifact')\n }\n pipeline={this.props.pipeline}\n stage={stage}\n />\n </div>\n <div className=\"col-md-1\">\n <div className=\"form-control-static\">\n <button onClick={() => this.removeInputArtifact('queueArtifact')}>\n <span className=\"glyphicon glyphicon-trash\" />\n <span className=\"sr-only\">Remove field</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n}\n","import type { FormikErrors } from 'formik';\nimport { cloneDeep } from 'lodash';\nimport React from 'react';\n\nimport type { IStage, IStageConfigProps } from '@spinnaker/core';\nimport { FormikStageConfig, FormValidator } from '@spinnaker/core';\n\nimport { DeployAppengineConfigForm } from './DeployAppengineConfigForm';\n\nexport function DeployAppengineConfigurationConfig({ application, pipeline, stage, updateStage }: IStageConfigProps) {\n const stageWithDefaults = React.useMemo(() => {\n return {\n ...cloneDeep(stage),\n };\n }, []);\n\n return (\n <FormikStageConfig\n application={application}\n onChange={updateStage}\n pipeline={pipeline}\n stage={stageWithDefaults}\n liveStage={stage}\n validate={validateDeployAppengineConfigurationStage}\n render={(props) => <DeployAppengineConfigForm {...props} />}\n />\n );\n}\n\nexport function validateDeployAppengineConfigurationStage(stage: IStage): FormikErrors<IStage> {\n const formValidator = new FormValidator(stage);\n formValidator.field('account').required();\n formValidator.field('region').required();\n return formValidator.validateForm();\n}\n","import { ExecutionArtifactTab, ExecutionDetailsTasks, Registry } from '@spinnaker/core';\n\nimport {\n DeployAppengineConfigurationConfig,\n validateDeployAppengineConfigurationStage,\n} from './DeployAppengineConfigurationConfig';\n\nexport const DEPLOY_APPENGINE_CONFIG_STAGE_KEY = 'deployAppEngineConfiguration';\n\nRegistry.pipeline.registerStage({\n label: 'Deploy App Engine Configuration',\n description: 'Deploy index, dispatch, cron, and queue configuration to App Engine.',\n key: DEPLOY_APPENGINE_CONFIG_STAGE_KEY,\n component: DeployAppengineConfigurationConfig,\n producesArtifacts: false,\n cloudProvider: 'appengine',\n executionDetailsSections: [ExecutionDetailsTasks, ExecutionArtifactTab],\n validateFn: validateDeployAppengineConfigurationStage,\n});\n","export class AppengineHealth {\n public static PLATFORM = 'App Engine Service';\n}\n","import React, { useEffect, useState } from 'react';\n\nimport type { IStageConfigProps } from '@spinnaker/core';\nimport {\n AccountRegionClusterSelector,\n AccountService,\n PlatformHealthOverride,\n StageConfigField,\n StageConstants,\n TargetSelect,\n} from '@spinnaker/core';\n\nimport { AppengineHealth } from '../../common/appengineHealth';\nimport type { IAppengineAccount } from '../../domain';\n\nexport function getAppengineAccountRegion(accounts: IAppengineAccount[], credentials: string): string {\n return accounts.find((account) => account.name === credentials)?.region;\n}\n\nexport function initializeAppengineServerGroupStage(stage: any, application: any): void {\n stage.cloudProvider = 'appengine';\n stage.cloudProviderType = 'appengine';\n\n if (\n stage.isNew &&\n application?.attributes?.platformHealthOnlyShowOverride &&\n application?.attributes?.platformHealthOnly\n ) {\n stage.interestingHealthProviderNames = [AppengineHealth.PLATFORM];\n }\n}\n\ntype AppengineStageConfigProps = Pick<IStageConfigProps, 'application' | 'pipeline' | 'stage' | 'updateStage'> & {\n showHealthOverride?: boolean;\n};\n\nexport function AppengineServerGroupStageConfig({\n application,\n pipeline,\n stage,\n updateStage,\n showHealthOverride = false,\n}: AppengineStageConfigProps) {\n const [accounts, setAccounts] = useState<IAppengineAccount[]>([]);\n\n useEffect(() => {\n initializeAppengineServerGroupStage(stage, application);\n AccountService.listAccounts('appengine').then((loadedAccounts: IAppengineAccount[]) => {\n setAccounts(loadedAccounts);\n const credentials = stage.credentials || application?.defaultCredentials?.appengine;\n const region = getAppengineAccountRegion(loadedAccounts, credentials);\n if (credentials || region) {\n stage.credentials = credentials || stage.credentials;\n stage.region = region || stage.region;\n updateStage(stage);\n }\n });\n }, []);\n\n const onAccountUpdate = (credentials: string) => {\n AccountService.getAccountDetails(credentials).then((accountDetails: IAppengineAccount) => {\n stage.region = accountDetails?.region || stage.region;\n updateStage(stage);\n });\n };\n\n return (\n <div className=\"form-horizontal\">\n {!pipeline?.strategy && (\n <AccountRegionClusterSelector\n accounts={accounts}\n application={application}\n component={stage}\n disableRegionSelect={true}\n onAccountUpdate={onAccountUpdate}\n onComponentUpdate={updateStage}\n singleRegion=\"true\"\n />\n )}\n <StageConfigField label=\"Target\">\n <TargetSelect\n model={{ target: stage.target }}\n onChange={(target: string) => {\n stage.target = target;\n updateStage(stage);\n }}\n options={StageConstants.TARGET_LIST}\n />\n </StageConfigField>\n {showHealthOverride && application?.attributes?.platformHealthOnlyShowOverride && (\n <PlatformHealthOverride\n interestingHealthProviderNames={stage.interestingHealthProviderNames || []}\n onChange={(interestingHealthProviderNames) => {\n stage.interestingHealthProviderNames = interestingHealthProviderNames;\n updateStage(stage);\n }}\n platformHealthType={AppengineHealth.PLATFORM}\n />\n )}\n </div>\n );\n}\n\nexport function AppengineServerGroupStageConfigWithHealthOverride(props: AppengineStageConfigProps) {\n return <AppengineServerGroupStageConfig {...props} showHealthOverride={true} />;\n}\n\nexport function AppengineShrinkClusterStageConfig({\n application,\n pipeline,\n stage,\n updateStage,\n}: AppengineStageConfigProps) {\n useEffect(() => {\n initializeAppengineServerGroupStage(stage, application);\n if (stage.shrinkToSize === undefined) {\n stage.shrinkToSize = 1;\n }\n if (stage.allowDeleteActive === undefined) {\n stage.allowDeleteActive = false;\n }\n if (stage.retainLargerOverNewer === undefined) {\n stage.retainLargerOverNewer = 'false';\n }\n stage.retainLargerOverNewer = stage.retainLargerOverNewer.toString();\n updateStage(stage);\n }, []);\n\n const update = (field: string, value: any) => {\n stage[field] = value;\n updateStage(stage);\n };\n\n return (\n <div className=\"form-horizontal\">\n <AppengineServerGroupStageConfig\n application={application}\n pipeline={pipeline}\n stage={stage}\n updateStage={updateStage}\n />\n <div className=\"form-group\">\n <label className=\"col-md-3 sm-label-right\">Shrink Options</label>\n <div className=\"col-md-7 form-inline\">\n Shrink to{' '}\n <input\n className=\"form-control input-sm\"\n min={0}\n onChange={(event) => update('shrinkToSize', Number(event.target.value))}\n style={{ width: 60 }}\n type=\"number\"\n value={stage.shrinkToSize || 0}\n />{' '}\n server groups, keeping the{' '}\n <select\n className=\"form-control input-sm\"\n onChange={(event) => update('retainLargerOverNewer', event.target.value)}\n style={{ width: 100 }}\n value={stage.retainLargerOverNewer || 'false'}\n >\n <option value=\"true\">largest</option>\n <option value=\"false\">newest</option>\n </select>\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-offset-3 col-md-7 checkbox\">\n <label>\n <input\n checked={!!stage.allowDeleteActive}\n onChange={(event) => update('allowDeleteActive', event.target.checked)}\n type=\"checkbox\"\n />{' '}\n Allow deletion of active server groups\n </label>\n </div>\n </div>\n {application?.attributes?.platformHealthOnlyShowOverride && (\n <PlatformHealthOverride\n interestingHealthProviderNames={stage.interestingHealthProviderNames || []}\n onChange={(interestingHealthProviderNames) => {\n stage.interestingHealthProviderNames = interestingHealthProviderNames;\n updateStage(stage);\n }}\n platformHealthType={AppengineHealth.PLATFORM}\n />\n )}\n </div>\n );\n}\n","import React from 'react';\n\nimport type { IExecutionDetailsSectionProps } from '@spinnaker/core';\nimport { ExecutionDetailsSection } from '@spinnaker/core';\n\nfunction FailureMessages({ stage }: Pick<IExecutionDetailsSectionProps, 'stage'>) {\n const failures = (stage.context?.exception?.details?.errors || stage.context?.failureMessages || []) as string[];\n if (!failures.length) {\n return null;\n }\n\n return (\n <div className=\"alert alert-danger\">\n {failures.map((message, index) => (\n <p key={index}>{message}</p>\n ))}\n </div>\n );\n}\n\nexport function getServerGroupDisplayName(context: any): string {\n return context.cluster || context.serverGroupName;\n}\n\nfunction ServerGroupConfigDetails(props: IExecutionDetailsSectionProps) {\n const { stage } = props;\n return (\n <div>\n <dl className=\"dl-horizontal dl-narrow\">\n <dt>Account</dt>\n <dd>{stage.context.credentials || stage.context.account}</dd>\n <dt>Region</dt>\n <dd>{stage.context.region}</dd>\n <dt>{stage.context.cluster ? 'Cluster' : 'Server Group'}</dt>\n <dd>{getServerGroupDisplayName(stage.context)}</dd>\n {stage.context.target && [\n <dt key=\"target-label\">Target</dt>,\n <dd key=\"target-value\">{stage.context.target}</dd>,\n ]}\n </dl>\n <FailureMessages stage={stage} />\n </div>\n );\n}\n\nexport function AppengineStartServerGroupExecutionDetails(props: IExecutionDetailsSectionProps) {\n return (\n <ExecutionDetailsSection name={AppengineStartServerGroupExecutionDetails.title} current={props.current}>\n <ServerGroupConfigDetails {...props} />\n </ExecutionDetailsSection>\n );\n}\nAppengineStartServerGroupExecutionDetails.title = 'startServerGroupConfig';\n\nexport function AppengineStopServerGroupExecutionDetails(props: IExecutionDetailsSectionProps) {\n return (\n <ExecutionDetailsSection name={AppengineStopServerGroupExecutionDetails.title} current={props.current}>\n <ServerGroupConfigDetails {...props} />\n </ExecutionDetailsSection>\n );\n}\nAppengineStopServerGroupExecutionDetails.title = 'stopServerGroupConfig';\n\nexport function AppengineEditLoadBalancerExecutionDetails(props: IExecutionDetailsSectionProps) {\n const loadBalancers = props.stage.context.loadBalancers || [];\n return (\n <ExecutionDetailsSection name={AppengineEditLoadBalancerExecutionDetails.title} current={props.current}>\n <table className=\"table table-condensed\">\n <thead>\n <tr>\n <th>Account</th>\n <th>Name</th>\n <th>Region</th>\n </tr>\n </thead>\n <tbody>\n {loadBalancers.map((loadBalancer: any, index: number) => (\n <tr key={index}>\n <td>{loadBalancer.credentials || loadBalancer.account}</td>\n <td>{loadBalancer.name || loadBalancer.loadBalancerName}</td>\n <td>{loadBalancer.region}</td>\n </tr>\n ))}\n </tbody>\n </table>\n <FailureMessages stage={props.stage} />\n </ExecutionDetailsSection>\n );\n}\nAppengineEditLoadBalancerExecutionDetails.title = 'editLoadBalancerConfig';\n","import { Registry } from '@spinnaker/core';\nimport { AppengineServerGroupStageConfig } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n provides: 'destroyServerGroup',\n key: 'destroyServerGroup',\n cloudProvider: 'appengine',\n component: AppengineServerGroupStageConfig,\n validators: [\n {\n type: 'targetImpedance',\n message:\n 'This pipeline will attempt to destroy a server group without deploying a new version into the same cluster.',\n },\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'target' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n});\n","import { Registry } from '@spinnaker/core';\nimport { AppengineServerGroupStageConfigWithHealthOverride } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n provides: 'disableServerGroup',\n key: 'disableServerGroup',\n cloudProvider: 'appengine',\n component: AppengineServerGroupStageConfigWithHealthOverride,\n validators: [\n {\n type: 'targetImpedance',\n message:\n 'This pipeline will attempt to disable a server group without deploying a new version into the same cluster.',\n },\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'target' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n});\n","import { ExecutionDetailsTasks, Registry } from '@spinnaker/core';\n\nimport { AppengineEditLoadBalancerStageConfig } from './AppengineEditLoadBalancerStageConfig';\nimport { AppengineEditLoadBalancerExecutionDetails } from '../AppengineExecutionDetails';\n\nRegistry.pipeline.registerStage({\n label: 'Edit Load Balancer',\n description: 'Edits a load balancer',\n key: 'upsertAppEngineLoadBalancers',\n cloudProvider: 'appengine',\n component: AppengineEditLoadBalancerStageConfig,\n executionDetailsSections: [AppengineEditLoadBalancerExecutionDetails, ExecutionDetailsTasks],\n validators: [],\n});\n","import React, { useEffect } from 'react';\n\nimport type { ILoadBalancer, IStageConfigProps } from '@spinnaker/core';\n\nimport { AppengineCreateLoadBalancerModal } from '../../../loadBalancer/configure/AppengineCreateLoadBalancerModal';\n\nexport function AppengineEditLoadBalancerStageConfig({ application, stage, updateStage }: IStageConfigProps) {\n useEffect(() => {\n stage.loadBalancers = stage.loadBalancers || [];\n stage.cloudProvider = 'appengine';\n updateStage(stage);\n }, []);\n\n const setLoadBalancers = (loadBalancers: ILoadBalancer[]) => {\n stage.loadBalancers = loadBalancers;\n updateStage(stage);\n };\n\n const addLoadBalancer = () => {\n AppengineCreateLoadBalancerModal.show({\n app: application,\n loadBalancer: null,\n forPipelineConfig: true,\n isNew: true,\n } as any)\n .then((loadBalancer) => setLoadBalancers([...(stage.loadBalancers || []), loadBalancer]))\n .catch(() => {});\n };\n\n const editLoadBalancer = (index: number) => {\n AppengineCreateLoadBalancerModal.show({\n app: application,\n loadBalancer: stage.loadBalancers[index],\n forPipelineConfig: true,\n isNew: false,\n } as any)\n .then((loadBalancer) => {\n const loadBalancers = [...stage.loadBalancers];\n loadBalancers[index] = loadBalancer;\n setLoadBalancers(loadBalancers);\n })\n .catch(() => {});\n };\n\n const removeLoadBalancer = (index: number) => {\n setLoadBalancers(stage.loadBalancers.filter((_loadBalancer: ILoadBalancer, i: number) => i !== index));\n };\n\n return (\n <div className=\"well well-sm clearfix\">\n <h4>Load Balancers</h4>\n <table className=\"table table-condensed\">\n <thead>\n <tr>\n <th>Account</th>\n <th>Name</th>\n <th>Region</th>\n <th>Actions</th>\n </tr>\n </thead>\n <tbody>\n {(stage.loadBalancers || []).map((loadBalancer: any, index: number) => (\n <tr key={`${loadBalancer.name}-${index}`}>\n <td>{loadBalancer.credentials || loadBalancer.account}</td>\n <td>{loadBalancer.name}</td>\n <td>{loadBalancer.region}</td>\n <td className=\"condensed-actions\">\n <button className=\"btn btn-sm btn-link\" onClick={() => editLoadBalancer(index)} type=\"button\">\n <span className=\"glyphicon glyphicon-edit\" />\n </button>\n <button\n className=\"btn btn-sm btn-link pad-left\"\n onClick={() => removeLoadBalancer(index)}\n type=\"button\"\n >\n <span className=\"glyphicon glyphicon-trash\" />\n </button>\n </td>\n </tr>\n ))}\n </tbody>\n <tfoot>\n <tr>\n <td colSpan={4}>\n <button className=\"btn btn-block btn-sm add-new\" onClick={addLoadBalancer} type=\"button\">\n <span className=\"glyphicon glyphicon-plus-sign\" /> Add load balancer\n </button>\n </td>\n </tr>\n </tfoot>\n </table>\n </div>\n );\n}\n","import { Registry } from '@spinnaker/core';\nimport { AppengineServerGroupStageConfigWithHealthOverride } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n provides: 'enableServerGroup',\n key: 'enableServerGroup',\n cloudProvider: 'appengine',\n component: AppengineServerGroupStageConfigWithHealthOverride,\n validators: [\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'target' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n});\n","import { Registry } from '@spinnaker/core';\nimport { AppengineShrinkClusterStageConfig } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n provides: 'shrinkCluster',\n key: 'shrinkCluster',\n cloudProvider: 'appengine',\n component: AppengineShrinkClusterStageConfig,\n validators: [\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'shrinkToSize', fieldLabel: 'shrink to [X] Server Groups' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n});\n","import { ExecutionDetailsTasks, Registry } from '@spinnaker/core';\nimport { AppengineStartServerGroupExecutionDetails } from '../AppengineExecutionDetails';\nimport { AppengineServerGroupStageConfigWithHealthOverride } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n label: 'Start Server Group',\n description: 'Starts a server group.',\n key: 'startAppEngineServerGroup',\n component: AppengineServerGroupStageConfigWithHealthOverride,\n executionDetailsSections: [AppengineStartServerGroupExecutionDetails, ExecutionDetailsTasks],\n validators: [\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'target' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n cloudProvider: 'appengine',\n});\n","import { ExecutionDetailsTasks, Registry } from '@spinnaker/core';\nimport { AppengineStopServerGroupExecutionDetails } from '../AppengineExecutionDetails';\nimport { AppengineServerGroupStageConfigWithHealthOverride } from '../AppengineServerGroupStageConfig';\n\nRegistry.pipeline.registerStage({\n label: 'Stop Server Group',\n description: 'Stops a server group.',\n key: 'stopAppEngineServerGroup',\n component: AppengineServerGroupStageConfigWithHealthOverride,\n executionDetailsSections: [AppengineStopServerGroupExecutionDetails, ExecutionDetailsTasks],\n validators: [\n { type: 'requiredField', fieldName: 'cluster' },\n { type: 'requiredField', fieldName: 'target' },\n { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },\n ],\n cloudProvider: 'appengine',\n});\n","import type { IProviderSettings } from '@spinnaker/core';\nimport { SETTINGS } from '@spinnaker/core';\n\nexport interface IAppengineProviderSettings extends IProviderSettings {\n defaults: {\n account?: string;\n };\n}\n\nexport const AppengineProviderSettings: IAppengineProviderSettings = (SETTINGS.providers\n .appengine as IAppengineProviderSettings) || { defaults: {} };\nif (AppengineProviderSettings) {\n AppengineProviderSettings.resetToOriginal = SETTINGS.resetProvider('appengine');\n}\n","import type {\n Application,\n IArtifact,\n IArtifactAccountPair,\n IBuildTrigger,\n IExpectedArtifact,\n IGitTrigger,\n IPipeline,\n IStage,\n} from '@spinnaker/core';\nimport { AccountService, StorageAccountReader } from '@spinnaker/core';\nimport { AppengineProviderSettings } from '../../appengine.settings';\nimport type {\n GitCredentialType,\n IAppengineAccount,\n IAppengineGitTrigger,\n IAppengineJenkinsTrigger,\n IAppengineServerGroup,\n} from '../../domain';\n\nimport type { AppengineDeployDescription } from '../transformer';\n\nexport interface IAppengineServerGroupCommand {\n application?: string;\n stack?: string;\n freeFormDetails?: string;\n configFilepaths?: string[];\n configFiles?: string[];\n configArtifacts?: IArtifactAccountPair[];\n applicationDirectoryRoot: string;\n branch?: string;\n repositoryUrl?: string;\n credentials: string;\n region: string;\n selectedProvider: string;\n promote?: boolean;\n stopPreviousVersion?: boolean;\n suppressVersionString?: boolean;\n type?: string;\n backingData: any;\n viewState: IViewState;\n strategy?: string;\n strategyApplication?: string;\n strategyPipeline?: string;\n fromTrigger?: boolean;\n trigger?: IAppengineGitTrigger | IAppengineJenkinsTrigger;\n gitCredentialType?: GitCredentialType;\n storageAccountName?: string; // GCS only\n interestingHealthProviderNames: string[];\n fromArtifact: boolean;\n expectedArtifactId: string;\n expectedArtifact?: IArtifact;\n sourceType: string;\n containerImageUrl?: string;\n}\n\nexport enum AppengineSourceType {\n GCS = 'gcs',\n GIT = 'git',\n ARTIFACT = 'artifact',\n CONTAINER_IMAGE = 'containerImage',\n}\n\nexport interface IViewState {\n mode: string;\n submitButtonLabel: string;\n disableStrategySelection: boolean;\n stage?: IStage;\n pipeline?: IPipeline;\n}\n\nexport class AppengineServerGroupCommandBuilder {\n private static getTriggerOptions(pipeline: IPipeline): Array<IAppengineGitTrigger | IAppengineJenkinsTrigger> {\n return (pipeline.triggers || [])\n .filter((trigger) => trigger.type === 'git' || trigger.type === 'jenkins' || trigger.type === 'travis')\n .map((trigger: IGitTrigger | IBuildTrigger) => {\n if (trigger.type === 'git') {\n return {\n source: trigger.source,\n project: trigger.project,\n slug: trigger.slug,\n branch: trigger.branch,\n type: 'git',\n };\n } else {\n return { master: trigger.master, job: trigger.job, type: trigger.type };\n }\n });\n }\n\n private static getExpectedArtifacts(pipeline: IPipeline): IExpectedArtifact[] {\n return pipeline.expectedArtifacts || [];\n }\n\n public buildNewServerGroupCommand(\n app: Application,\n selectedProvider: string,\n mode = 'create',\n ): Promise<IAppengineServerGroupCommand> {\n if (selectedProvider == null) {\n selectedProvider = 'appengine';\n }\n const dataToFetch = {\n accounts: AccountService.getAllAccountDetailsForProvider('appengine'),\n storageAccounts: StorageAccountReader.getStorageAccounts(),\n };\n\n const viewState: IViewState = {\n mode,\n submitButtonLabel: this.getSubmitButtonLabel(mode),\n disableStrategySelection: mode === 'create',\n };\n\n return this.resolveAll(dataToFetch).then((backingData: any) => {\n const credentials = this.getCredentials(backingData.accounts);\n const region = this.getRegion(backingData.accounts, credentials);\n\n return {\n application: app.name,\n backingData,\n viewState,\n fromArtifact: false,\n credentials,\n region,\n selectedProvider,\n configArtifacts: [],\n configFilepaths: [],\n configFiles: [],\n interestingHealthProviderNames: [],\n sourceType: AppengineSourceType.GIT,\n } as IAppengineServerGroupCommand;\n });\n }\n\n public buildServerGroupCommandFromExisting(\n app: Application,\n serverGroup: IAppengineServerGroup,\n ): Promise<IAppengineServerGroupCommand> {\n return this.buildNewServerGroupCommand(app, 'appengine', 'clone').then((command) => {\n command.stack = serverGroup.stack;\n command.freeFormDetails = serverGroup.detail;\n return command;\n });\n }\n\n public buildNewServerGroupCommandForPipeline(\n _stage: IStage,\n pipeline: IPipeline,\n ): Promise<{\n viewState: {\n stage: IStage;\n pipeline: IPipeline;\n };\n backingData: {\n triggerOptions: Array<IAppengineGitTrigger | IAppengineJenkinsTrigger>;\n expectedArtifacts: IExpectedArtifact[];\n };\n }> {\n // We can't copy server group configuration for App Engine, and can't build the full command here because we don't have\n // access to the application.\n return Promise.resolve({\n viewState: {\n pipeline,\n stage: _stage,\n },\n backingData: {\n triggerOptions: AppengineServerGroupCommandBuilder.getTriggerOptions(pipeline),\n expectedArtifacts: AppengineServerGroupCommandBuilder.getExpectedArtifacts(pipeline),\n },\n });\n }\n\n public buildServerGroupCommandFromPipeline(\n app: Application,\n cluster: AppengineDeployDescription,\n _stage: IStage,\n pipeline: IPipeline,\n ): Promise<IAppengineServerGroupCommand> {\n return this.buildNewServerGroupCommand(app, 'appengine', 'editPipeline').then(\n (command: IAppengineServerGroupCommand) => {\n command = {\n ...command,\n ...cluster,\n backingData: {\n ...command.backingData,\n triggerOptions: AppengineServerGroupCommandBuilder.getTriggerOptions(pipeline),\n expectedArtifacts: AppengineServerGroupCommandBuilder.getExpectedArtifacts(pipeline),\n },\n credentials: cluster.account || command.credentials,\n viewState: {\n ...command.viewState,\n stage: _stage,\n pipeline,\n },\n } as IAppengineServerGroupCommand;\n return command;\n },\n );\n }\n\n private getCredentials(accounts: IAppengineAccount[]): string {\n const accountNames: string[] = (accounts || []).map((account) => account.name);\n const defaultCredentials: string = AppengineProviderSettings.defaults.account;\n\n return accountNames.includes(defaultCredentials) ? defaultCredentials : accountNames[0];\n }\n\n private getRegion(accounts: IAppengineAccount[], credentials: string): string {\n const account = accounts.find((_account) => _account.name === credentials);\n return account ? account.region : null;\n }\n\n private getSubmitButtonLabel(mode: string): string {\n switch (mode) {\n case 'createPipeline':\n return 'Add';\n case 'editPipeline':\n return 'Done';\n case 'clone':\n return 'Clone';\n default:\n return 'Create';\n }\n }\n\n private resolveAll<T extends Record<string, PromiseLike<any>>>(\n dataToFetch: T,\n ): Promise<{ [K in keyof T]: Awaited<T[K]> }> {\n const entries = Object.entries(dataToFetch);\n return Promise.all(entries.map(([, promise]) => promise)).then((values) => {\n return entries.reduce((result, [key], index) => ({ ...result, [key]: values[index] }), {}) as {\n [K in keyof T]: Awaited<T[K]>;\n };\n });\n }\n}\n","import type { IArtifact, IArtifactAccountPair, IServerGroup } from '@spinnaker/core';\n\nimport type { IAppengineServerGroupCommand } from './configure/serverGroupCommandBuilder.service';\nimport type { GitCredentialType, IAppengineGitTrigger, IAppengineJenkinsTrigger } from '../domain/index';\n\nexport class AppengineDeployDescription {\n public cloudProvider = 'appengine';\n public provider = 'appengine';\n public credentials: string;\n public account: string;\n public application: string;\n public stack?: string;\n public freeFormDetails?: string;\n public repositoryUrl: string;\n public branch: string;\n public configFilepaths: string[];\n public configFiles: string[];\n public configArtifacts: IArtifactAccountPair[];\n public applicationDirectoryRoot: string;\n public promote?: boolean;\n public stopPreviousVersion?: boolean;\n public type: string;\n public region: string;\n public strategy?: string;\n public strategyApplication?: string;\n public strategyPipeline?: string;\n public fromTrigger?: boolean;\n public trigger?: IAppengineGitTrigger | IAppengineJenkinsTrigger;\n public gitCredentialType: GitCredentialType;\n public interestingHealthProviderNames: string[];\n public expectedArtifactId: string;\n public expectedArtifact: IArtifact;\n public fromArtifact: boolean;\n public sourceType: string;\n public storageAccountName?: string;\n public containerImageUrl?: string;\n public suppressVersionString?: boolean;\n\n constructor(command: IAppengineServerGroupCommand) {\n this.credentials = command.credentials;\n this.account = command.credentials;\n this.application = command.application;\n this.stack = command.stack;\n this.freeFormDetails = command.freeFormDetails;\n this.repositoryUrl = command.repositoryUrl;\n this.branch = command.branch;\n this.configFilepaths = command.configFilepaths;\n this.promote = command.promote;\n this.stopPreviousVersion = command.stopPreviousVersion;\n this.type = command.type;\n this.region = command.region;\n this.strategy = command.strategy;\n this.strategyApplication = command.strategyApplication;\n this.strategyPipeline = command.strategyPipeline;\n this.fromTrigger = command.fromTrigger;\n this.trigger = command.trigger;\n this.gitCredentialType = command.gitCredentialType;\n this.configFiles = command.configFiles;\n this.configArtifacts = (command.configArtifacts || []).filter((a) => !!a.id || !!a.artifact);\n this.applicationDirectoryRoot = command.applicationDirectoryRoot;\n this.interestingHealthProviderNames = command.interestingHealthProviderNames || [];\n this.expectedArtifactId = command.expectedArtifactId;\n this.expectedArtifact = command.expectedArtifact;\n this.fromArtifact = command.fromArtifact;\n this.sourceType = command.sourceType;\n this.storageAccountName = command.storageAccountName;\n this.containerImageUrl = command.containerImageUrl;\n this.suppressVersionString = command.suppressVersionString;\n }\n}\n\nexport class AppengineServerGroupTransformer {\n public normalizeServerGroup(serverGroup: IServerGroup): Promise<IServerGroup> {\n return Promise.resolve(serverGroup);\n }\n\n public convertServerGroupCommandToDeployConfiguration(command: IAppengineServerGroupCommand) {\n return new AppengineDeployDescription(command);\n }\n}\n","import type { Application, IJob, ITask, ITaskCommand } from '@spinnaker/core';\nimport { TaskExecutor } from '@spinnaker/core';\n\nimport type { IAppengineServerGroupCommand } from '../configure/serverGroupCommandBuilder.service';\nimport type { IAppengineServerGroup } from '../../domain/index';\nimport { AppengineDeployDescription } from '../transformer';\n\ninterface IAppengineServerGroupWriteJob extends IJob {\n serverGroupName: string;\n region: string;\n credentials: string;\n cloudProvider: string;\n}\n\nexport class AppengineServerGroupWriter {\n public cloneServerGroup(command: IAppengineServerGroupCommand, application: Application): Promise<ITask> {\n command.type = 'createServerGroup';\n\n return TaskExecutor.executeTask({\n job: [new AppengineDeployDescription(command)],\n application,\n description: `Create App Engine Server Group in ${application.name}`,\n });\n }\n\n public startServerGroup(serverGroup: IAppengineServerGroup, application: Application): Promise<ITask> {\n const job = this.buildJob(serverGroup, application, 'startAppEngineServerGroup');\n\n const command: ITaskCommand = {\n job: [job],\n application,\n description: `Start Server Group: ${serverGroup.name}`,\n };\n\n return TaskExecutor.executeTask(command);\n }\n\n public stopServerGroup(serverGroup: IAppengineServerGroup, application: Application): Promise<ITask> {\n const job = this.buildJob(serverGroup, application, 'stopAppEngineServerGroup');\n\n const command: ITaskCommand = {\n job: [job],\n application,\n description: `Stop Server Group: ${serverGroup.name}`,\n };\n\n return TaskExecutor.executeTask(command);\n }\n\n public enableServerGroup(\n serverGroup: IAppengineServerGroup,\n application: Application,\n params: Partial<IAppengineServerGroupWriteJob> = {},\n ): Promise<ITask> {\n const job = { ...params, ...this.buildJob(serverGroup, application, 'enableServerGroup') };\n\n return TaskExecutor.executeTask({\n job: [job],\n application,\n description: `Enable Server Group: ${serverGroup.name}`,\n });\n }\n\n public disableServerGroup(\n serverGroup: IAppengineServerGroup,\n application: Application,\n params: Partial<IAppengineServerGroupWriteJob> = {},\n ): Promise<ITask> {\n const job = { ...params, ...this.buildJob(serverGroup, application, 'disableServerGroup') };\n\n return TaskExecutor.executeTask({\n job: [job],\n application,\n description: `Disable Server Group: ${serverGroup.name}`,\n });\n }\n\n public destroyServerGroup(\n serverGroup: IAppengineServerGroup,\n application: Application,\n params: Partial<IAppengineServerGroupWriteJob> = {},\n ): Promise<ITask> {\n const job = { ...params, ...this.buildJob(serverGroup, application, 'destroyServerGroup') };\n\n return TaskExecutor.executeTask({\n job: [job],\n application,\n description: `Destroy Server Group: ${serverGroup.name}`,\n });\n }\n\n private buildJob(\n serverGroup: IAppengineServerGroup,\n application: Application,\n type: string,\n ): IAppengineServerGroupWriteJob {\n return {\n type,\n region: serverGroup.region,\n serverGroupName: serverGroup.name,\n credentials: serverGroup.account,\n cloudProvider: 'appengine',\n application: application.name,\n };\n }\n}\n","import React from 'react';\nimport { Modal } from 'react-bootstrap';\n\nimport type { Application, IModalComponentProps } from '@spinnaker/core';\nimport { ModalClose, noop, ReactModal, TaskMonitor, TaskMonitorWrapper } from '@spinnaker/core';\n\nimport type { IAppengineServerGroupCommand } from '../serverGroupCommandBuilder.service';\nimport { AppengineSourceType } from '../serverGroupCommandBuilder.service';\nimport { AppengineServerGroupWriter } from '../../writer/serverGroup.write.service';\n\nexport interface IAppengineCloneServerGroupModalProps extends Partial<IModalComponentProps> {\n application: Application;\n command: IAppengineServerGroupCommand;\n title: string;\n}\n\ninterface IAppengineCloneServerGroupModalState {\n taskMonitor: TaskMonitor;\n}\n\nconst writer = new AppengineServerGroupWriter();\n\nexport function normalizeAppengineServerGroupCommandForSubmit(\n command: IAppengineServerGroupCommand,\n): IAppengineServerGroupCommand {\n return {\n ...command,\n configArtifacts: command.configArtifacts || [],\n configFilepaths: command.configFilepaths || [],\n configFiles: command.configFiles || [],\n interestingHealthProviderNames: command.interestingHealthProviderNames || [],\n fromArtifact: command.fromArtifact || false,\n sourceType: command.sourceType || AppengineSourceType.GIT,\n };\n}\n\nexport class AppengineCloneServerGroupModal extends React.Component<\n IAppengineCloneServerGroupModalProps,\n IAppengineCloneServerGroupModalState\n> {\n public static defaultProps: Partial<IAppengineCloneServerGroupModalProps> = {\n closeModal: noop,\n dismissModal: noop,\n };\n\n public static show(props: IAppengineCloneServerGroupModalProps): Promise<IAppengineServerGroupCommand> {\n return ReactModal.show(AppengineCloneServerGroupModal, props, { dialogClassName: 'modal-lg' });\n }\n\n public state: IAppengineCloneServerGroupModalState = {\n taskMonitor: new TaskMonitor({\n application: this.props.application,\n title: 'Creating your server group',\n onDismiss: () => this.props.dismissModal(),\n onTaskComplete: () => this.props.application.serverGroups.refresh(),\n }),\n };\n\n private update = (field: keyof IAppengineServerGroupCommand, value: any) => {\n (this.props.command as any)[field] = value;\n this.forceUpdate();\n };\n\n private submit = () => {\n const { command } = this.props;\n if (command.viewState.mode === 'editPipeline' || command.viewState.mode === 'createPipeline') {\n this.props.closeModal(command);\n return;\n }\n\n this.state.taskMonitor.submit(() =>\n writer.cloneServerGroup(normalizeAppengineServerGroupCommandForSubmit(command), this.props.application),\n );\n };\n\n public render() {\n const { command, dismissModal, title } = this.props;\n\n return (\n <div>\n <ModalClose dismiss={dismissModal} />\n <Modal.Header>\n <Modal.Title>{title}</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <div className=\"form-horizontal\">\n <label>Account</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.update('credentials', event.target.value)}\n value={command.credentials || ''}\n />\n <label>Region</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.update('region', event.target.value)}\n value={command.region || ''}\n />\n <label>Branch</label>\n <input\n className=\"form-control input-sm\"\n onChange={(event) => this.update('branch', event.target.value)}\n value={command.branch || ''}\n />\n </div>\n </Modal.Body>\n <TaskMonitorWrapper monitor={this.state.taskMonitor} />\n <Modal.Footer>\n <button className=\"btn btn-default\" onClick={() => dismissModal()} type=\"button\">\n Cancel\n </button>\n <button className=\"btn btn-primary\" onClick={this.submit} type=\"button\">\n {command.viewState?.submitButtonLabel || 'Clone'}\n </button>\n </Modal.Footer>\n </div>\n );\n }\n}\n","import React from 'react';\n\nimport type { Application, IConfirmationModalParams, IServerGroup, IServerGroupActionsProps } from '@spinnaker/core';\nimport { ConfirmationModalService, ServerGroupWarningMessageService } from '@spinnaker/core';\n\nimport { AppengineHealth } from '../../common/appengineHealth';\nimport { AppengineServerGroupCommandBuilder } from '../configure/serverGroupCommandBuilder.service';\nimport { AppengineCloneServerGroupModal } from '../configure/wizard/AppengineCloneServerGroupModal';\nimport type { IAppengineServerGroup } from '../../domain';\nimport { AppengineServerGroupWriter } from '../writer/serverGroup.write.service';\n\nconst writer = new AppengineServerGroupWriter();\nconst commandBuilder = new AppengineServerGroupCommandBuilder();\n\nexport function canStartOrStopServerGroup(serverGroup: IAppengineServerGroup): boolean {\n return serverGroup.env === 'FLEXIBLE' || ['MANUAL', 'BASIC'].includes(serverGroup.scalingPolicy?.type);\n}\n\nexport function canStartServerGroup(serverGroup: IAppengineServerGroup): boolean {\n return canStartOrStopServerGroup(serverGroup) && serverGroup.servingStatus === 'STOPPED';\n}\n\nexport function canStopServerGroup(serverGroup: IAppengineServerGroup): boolean {\n return canStartOrStopServerGroup(serverGroup) && serverGroup.servingStatus === 'SERVING';\n}\n\nexport function expectedAllocationsAfterDisableOperation(\n serverGroup: IServerGroup,\n loadBalancers: any[] = [],\n): { [key: string]: number } {\n const loadBalancer = loadBalancers.find((toCheck) => {\n return Object.keys(toCheck.split?.allocations || {}).includes(serverGroup.name);\n });\n\n if (!loadBalancer) {\n return null;\n }\n\n const allocations: { [key: string]: number } = { ...loadBalancer.split.allocations };\n delete allocations[serverGroup.name];\n const denominator = Object.values(allocations).reduce((sum, allocation) => sum + allocation, 0);\n if (!denominator) {\n return {};\n }\n\n const precision = loadBalancer.split.shardBy === 'COOKIE' ? 1000 : 100;\n Object.keys(allocations).forEach((serverGroupName) => {\n allocations[serverGroupName] = Math.round((allocations[serverGroupName] / denominator) * precision) / precision;\n });\n return allocations;\n}\n\nexport function canDisableServerGroup(serverGroup: IAppengineServerGroup, loadBalancers: any[] = []): boolean {\n if (!serverGroup || serverGroup.disabled) {\n return false;\n }\n\n return Object.keys(expectedAllocationsAfterDisableOperation(serverGroup, loadBalancers) || {}).length > 0;\n}\n\nexport function canDestroyServerGroup(serverGroup: IAppengineServerGroup, loadBalancers: any[] = []): boolean {\n if (!serverGroup) {\n return false;\n }\n\n return (\n serverGroup.disabled ||\n Object.keys(expectedAllocationsAfterDisableOperation(serverGroup, loadBalancers) || {}).length > 0\n );\n}\n\nfunction buildExpectedAllocationsTable(expectedAllocations: { [key: string]: number }): string {\n const rows = Object.keys(expectedAllocations || {})\n .map(\n (serverGroupName) =>\n `<tr><td>${serverGroupName}</td><td>${expectedAllocations[serverGroupName] * 100}%</td></tr>`,\n )\n .join('');\n\n return `<table class=\"table table-condensed\"><thead><tr><th>Server Group</th><th>Allocation</th></tr></thead><tbody>${rows}</tbody></table>`;\n}\n\nfunction getLoadBalancers(app: Application): any[] {\n return app.getDataSource?.('loadBalancers')?.data || [];\n}\n\nfunction platformHealthParams(app: Application): Partial<IConfirmationModalParams> {\n const params: Partial<IConfirmationModalParams> = {\n platformHealthOnlyShowOverride: app.attributes?.platformHealthOnlyShowOverride,\n platformHealthType: AppengineHealth.PLATFORM,\n interestingHealthProviderNames: [],\n };\n if (app.attributes?.platformHealthOnlyShowOverride && app.attributes?.platformHealthOnly) {\n params.interestingHealthProviderNames = [AppengineHealth.PLATFORM];\n }\n return params;\n}\n\nfunction getDisableBody(serverGroup: IAppengineServerGroup, loadBalancers: any[]): string {\n const expectedAllocations = expectedAllocationsAfterDisableOperation(serverGroup, loadBalancers);\n return `<div class=\"well well-sm\">\n <p>For App Engine, a disable operation sets this server group's allocation to 0% and redistributes traffic to the other enabled server groups.</p>\n <p>If you would like more fine-grained control, edit <b>${\n serverGroup.loadBalancers?.[0]\n }</b> under the <b>Load Balancers</b> tab.</p>\n <div class=\"row\"><div class=\"col-md-12\">${buildExpectedAllocationsTable(expectedAllocations)}</div></div>\n </div>`;\n}\n\nfunction getDestroyBody(app: Application, serverGroup: IAppengineServerGroup, loadBalancers: any[]): string {\n let body = '';\n const params: IConfirmationModalParams = {} as IConfirmationModalParams;\n ServerGroupWarningMessageService.addDestroyWarningMessage(app, serverGroup, params);\n if (params.body) {\n body += params.body;\n }\n if (!serverGroup.disabled) {\n body += `<div class=\"well well-sm\">\n <p>A destroy operation will first disable this server group.</p>\n <p>For App Engine, a disable operation sets this server group's allocation to 0% and redistributes traffic to the other enabled server groups.</p>\n <p>If you would like more fine-grained control, edit <b>${\n serverGroup.loadBalancers?.[0]\n }</b> under the <b>Load Balancers</b> tab.</p>\n <div class=\"row\"><div class=\"col-md-12\">${buildExpectedAllocationsTable(\n expectedAllocationsAfterDisableOperation(serverGroup, loadBalancers),\n )}</div></div>\n </div>`;\n }\n return body;\n}\n\nexport function AppengineServerGroupActions({ app, serverGroup }: IServerGroupActionsProps) {\n const appengineServerGroup = serverGroup as IAppengineServerGroup;\n const loadBalancers = getLoadBalancers(app);\n\n const clone = () => {\n commandBuilder.buildServerGroupCommandFromExisting(app, appengineServerGroup).then((command) => {\n AppengineCloneServerGroupModal.show({ application: app, command, title: `Clone ${serverGroup.name}` });\n });\n };\n\n const start = () =>\n ConfirmationModalService.confirm({\n header: `Really start ${serverGroup.name}?`,\n buttonText: `Start ${serverGroup.name}`,\n account: appengineServerGroup.account,\n taskMonitorConfig: { application: app, title: `Starting ${serverGroup.name}` },\n submitMethod: () => writer.startServerGroup(appengineServerGroup, app),\n askForReason: true,\n ...platformHealthParams(app),\n });\n\n const stop = () =>\n ConfirmationModalService.confirm({\n header: `Really stop ${serverGroup.name}?`,\n buttonText: `Stop ${serverGroup.name}`,\n account: appengineServerGroup.account,\n body: !appengineServerGroup.disabled\n ? `<div class=\"alert alert-danger\"><p>Stopping this server group will scale it down to zero instances.</p><p>This server group is currently serving traffic from <b>${appengineServerGroup.loadBalancers?.[0]}</b>. Traffic directed to this server group after it has been stopped will not be handled.</p></div>`\n : undefined,\n taskMonitorConfig: { application: app, title: `Stopping ${serverGroup.name}` },\n submitMethod: () => writer.stopServerGroup(appengineServerGroup, app),\n askForReason: true,\n ...platformHealthParams(app),\n });\n\n const enable = () =>\n ConfirmationModalService.confirm({\n header: `Really enable ${serverGroup.name}?`,\n buttonText: `Enable ${serverGroup.name}`,\n account: appengineServerGroup.account,\n body: `<div class=\"well well-sm\"><p>Enabling <b>${serverGroup.name}</b> will set its traffic allocation for <b>${appengineServerGroup.loadBalancers?.[0]}</b> to 100%.</p><p>If you would like more fine-grained control, edit <b>${appengineServerGroup.loadBalancers?.[0]}</b> under the <b>Load Balancers</b> tab.</p></div>`,\n taskMonitorConfig: { application: app, title: `Enabling ${serverGroup.name}` },\n submitMethod: (params: any) => writer.enableServerGroup(appengineServerGroup, app, params),\n askForReason: true,\n ...platformHealthParams(app),\n });\n\n const disable = () =>\n ConfirmationModalService.confirm({\n header: `Really disable ${serverGroup.name}?`,\n buttonText: `Disable ${serverGroup.name}`,\n account: appengineServerGroup.account,\n body: getDisableBody(appengineServerGroup, loadBalancers),\n taskMonitorConfig: { application: app, title: `Disabling ${serverGroup.name}` },\n submitMethod: (params: any) => writer.disableServerGroup(appengineServerGroup, app, params),\n askForReason: true,\n ...platformHealthParams(app),\n });\n\n const destroy = () =>\n ConfirmationModalService.confirm({\n header: `Really destroy ${serverGroup.name}?`,\n buttonText: `Destroy ${serverGroup.name}`,\n account: appengineServerGroup.account,\n body: getDestroyBody(app, appengineServerGroup, loadBalancers),\n taskMonitorConfig: { application: app, title: `Destroying ${serverGroup.name}` },\n submitMethod: (params: any) => writer.destroyServerGroup(appengineServerGroup, app, params),\n askForReason: true,\n ...platformHealthParams(app),\n });\n\n return (\n <div className=\"actions\">\n <button className=\"btn btn-sm btn-default\" onClick={clone} type=\"button\">\n Clone\n </button>\n <button\n className=\"btn btn-sm btn-default\"\n disabled={!canStartServerGroup(appengineServerGroup)}\n onClick={start}\n type=\"button\"\n >\n Start\n </button>\n <button\n className=\"btn btn-sm btn-default\"\n disabled={!canStopServerGroup(appengineServerGroup)}\n onClick={stop}\n type=\"button\"\n >\n Stop\n </button>\n <button className=\"btn btn-sm btn-default\" onClick={enable} type=\"button\">\n Enable\n </button>\n <button\n className=\"btn btn-sm btn-default\"\n disabled={!canDisableServerGroup(appengineServerGroup, loadBalancers)}\n onClick={disable}\n type=\"button\"\n >\n Disable\n </button>\n <button\n className=\"btn btn-sm btn-default\"\n disabled={!canDestroyServerGroup(appengineServerGroup, loadBalancers)}\n onClick={destroy}\n type=\"button\"\n >\n Destroy\n </button>\n </div>\n );\n}\n","import type { IApplicationNameValidator, IValidationResult } from '@spinnaker/core';\nimport { ApplicationNameValidator } from '@spinnaker/core';\n\n// See https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version\nclass AppengineApplicationNameValidator implements IApplicationNameValidator {\n public validate(name = ''): IValidationResult {\n const warnings: string[] = [];\n const errors: string[] = [];\n if (name.length) {\n this.validateSpecialCharacters(name, errors);\n this.validateLength(name, warnings, errors);\n }\n return { warnings, errors };\n }\n\n private validateSpecialCharacters(name: string, errors: string[]): void {\n const pattern = /^[a-z0-9]*$/g;\n if (!pattern.test(name)) {\n errors.push('Only numbers and lowercase letters are allowed.');\n }\n }\n\n private validateLength(name: string, warnings: string[], errors: string[]): void {\n if (name.length > 58) {\n errors.push('The maximum length for an App Engine application name is 63 characters.');\n return;\n }\n if (name.length > 48) {\n if (name.length >= 56) {\n warnings.push('You will not be able to include a stack or detail field for clusters.');\n } else {\n const remaining = 56 - name.length;\n warnings.push(`If you plan to include a stack or detail field for clusters, you will only have\n ${remaining} character${remaining > 1 ? 's' : ''} to do so.`);\n }\n }\n }\n}\n\nApplicationNameValidator.registerValidator('appengine', new AppengineApplicationNameValidator());\n","import { CloudProviderRegistry, DeploymentStrategyRegistry } from '@spinnaker/core';\n\nimport './helpContents/appengineHelpContents';\nimport { AppengineInstanceDetails } from './instance/details/AppengineInstanceDetails';\nimport { AppengineCreateLoadBalancerModal } from './loadBalancer/configure/AppengineCreateLoadBalancerModal';\nimport {\n AppengineLoadBalancerActions,\n AppengineLoadBalancerDetailsSection,\n useAppengineLoadBalancerDetails,\n} from './loadBalancer/details';\nimport { AppengineLoadBalancerTransformer } from './loadBalancer/transformer';\nimport logo from './logo/appengine.logo.png';\nimport './pipeline/stages/deployAppengineConfig/deployAppengineConfigStage';\nimport './pipeline/stages/destroyAsg/appengineDestroyAsgStage';\nimport './pipeline/stages/disableAsg/appengineDisableAsgStage';\nimport './pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage';\nimport './pipeline/stages/enableAsg/appengineEnableAsgStage';\nimport './pipeline/stages/shrinkCluster/appengineShrinkClusterStage';\nimport './pipeline/stages/startServerGroup/appengineStartServerGroupStage';\nimport './pipeline/stages/stopServerGroup/appengineStopServerGroupStage';\nimport { AppengineServerGroupCommandBuilder } from './serverGroup/configure/serverGroupCommandBuilder.service';\nimport { AppengineCloneServerGroupModal } from './serverGroup/configure/wizard/AppengineCloneServerGroupModal';\nimport {\n AppengineServerGroupActions,\n appengineServerGroupDetailsGetter,\n AppengineServerGroupDetailsSection,\n} from './serverGroup/details';\nimport { AppengineServerGroupTransformer } from './serverGroup/transformer';\nimport './validation/ApplicationNameValidator';\n\nimport './logo/appengine.logo.less';\n\nCloudProviderRegistry.registerProvider('appengine', {\n name: 'App Engine',\n instance: {\n details: AppengineInstanceDetails,\n },\n serverGroup: {\n transformer: AppengineServerGroupTransformer,\n commandBuilder: AppengineServerGroupCommandBuilder,\n detailsActions: AppengineServerGroupActions,\n detailsGetter: appengineServerGroupDetailsGetter,\n detailsSections: [AppengineServerGroupDetailsSection],\n CloneServerGroupModal: AppengineCloneServerGroupModal,\n skipUpstreamStageCheck: true,\n },\n loadBalancer: {\n transformer: AppengineLoadBalancerTransformer,\n useDetailsHook: useAppengineLoadBalancerDetails,\n detailsActions: AppengineLoadBalancerActions,\n detailsSections: [AppengineLoadBalancerDetailsSection],\n CreateLoadBalancerModal: AppengineCreateLoadBalancerModal,\n },\n logo: {\n path: logo,\n },\n});\n\nDeploymentStrategyRegistry.registerProvider('appengine', ['custom']);\n","import React from 'react';\n\ninterface IAppengineInstanceDetailsProps {\n instance: {\n account: string;\n instanceId: string;\n provider: string;\n region: string;\n };\n}\n\nexport function AppengineInstanceDetails({ instance }: IAppengineInstanceDetailsProps) {\n return (\n <div className=\"details-panel\">\n <div className=\"header\">\n <div className=\"header-text horizontal middle\">\n <i className=\"fa icon-instance\" />\n <h3 className=\"horizontal middle space-between flex-1\">{instance.instanceId}</h3>\n </div>\n </div>\n <div className=\"content\">\n <dl className=\"dl-horizontal dl-narrow\">\n <dt>Account</dt>\n <dd>{instance.account}</dd>\n <dt>Region</dt>\n <dd>{instance.region}</dd>\n <dt>Provider</dt>\n <dd>{instance.provider}</dd>\n </dl>\n </div>\n </div>\n );\n}\n","import { isEmpty } from 'lodash';\nimport { Observable } from 'rxjs';\n\nimport type { IServerGroupDetailsProps } from '@spinnaker/core';\nimport { ServerGroupReader } from '@spinnaker/core';\n\nimport type { IAppengineLoadBalancer, IAppengineServerGroup } from '../../domain';\n\nfunction extractServerGroupSummary(props: IServerGroupDetailsProps): Promise<IAppengineServerGroup> {\n const { app, serverGroup } = props;\n return app.ready().then(() => {\n let summary: IAppengineServerGroup = app.serverGroups.data.find((candidate: IAppengineServerGroup) => {\n return (\n candidate.name === serverGroup.name &&\n candidate.account === serverGroup.accountId &&\n candidate.region === serverGroup.region\n );\n });\n\n if (!summary) {\n app.loadBalancers.data.some((loadBalancer: IAppengineLoadBalancer) => {\n if (loadBalancer.account === serverGroup.accountId && loadBalancer.region === serverGroup.region) {\n return (loadBalancer.serverGroups || []).some((candidate: IAppengineServerGroup) => {\n if (candidate.name === serverGroup.name) {\n summary = candidate;\n return true;\n }\n return false;\n });\n }\n return false;\n });\n }\n\n return summary;\n });\n}\n\nexport function appengineServerGroupDetailsGetter(\n props: IServerGroupDetailsProps,\n autoClose: () => void,\n): Observable<IAppengineServerGroup> {\n const { app, serverGroup: serverGroupInfo } = props;\n return new Observable<IAppengineServerGroup>((observer) => {\n extractServerGroupSummary(props).then((summary) => {\n ServerGroupReader.getServerGroup(\n app.name,\n serverGroupInfo.accountId,\n serverGroupInfo.region,\n serverGroupInfo.name,\n ).then((serverGroup: IAppengineServerGroup) => {\n Object.assign(serverGroup, summary, { account: serverGroupInfo.accountId });\n\n if (!isEmpty(serverGroup)) {\n observer.next(serverGroup);\n } else {\n autoClose();\n }\n }, autoClose);\n }, autoClose);\n });\n}\n","import React from 'react';\n\nimport type { IServerGroupDetailsSectionProps } from '@spinnaker/core';\n\nimport type { IAppengineServerGroup } from '../../domain';\n\nexport function AppengineServerGroupDetailsSection({ serverGroup }: IServerGroupDetailsSectionProps) {\n const appengineServerGroup = serverGroup as IAppengineServerGroup;\n\n return (\n <div className=\"content-section\">\n <div className=\"content-section-heading\">App Engine Details</div>\n <dl className=\"dl-horizontal dl-narrow\">\n <dt>Account</dt>\n <dd>{appengineServerGroup.account}</dd>\n <dt>Region</dt>\n <dd>{appengineServerGroup.region}</dd>\n <dt>Status</dt>\n <dd>{appengineServerGroup.servingStatus || appengineServerGroup.status || 'Unknown'}</dd>\n <dt>Environment</dt>\n <dd>{appengineServerGroup.env || 'Unknown'}</dd>\n <dt>Scaling</dt>\n <dd>{appengineServerGroup.scalingPolicy?.type || 'Unknown'}</dd>\n </dl>\n </div>\n );\n}\n","import { useEffect, useState } from 'react';\n\nimport type { IUseDetailsHookProps, UseDetailsResult } from '@spinnaker/core';\n\nimport type { IAppengineLoadBalancer } from '../../domain';\n\nexport function useAppengineLoadBalancerDetails({\n app,\n loadBalancerParams,\n autoClose,\n}: IUseDetailsHookProps): UseDetailsResult<IAppengineLoadBalancer> {\n const [data, setData] = useState<IAppengineLoadBalancer>();\n const [loading, setLoading] = useState(true);\n\n const refetch = async () => {\n setLoading(true);\n await app.getDataSource('loadBalancers').ready();\n const loadBalancer = app.getDataSource('loadBalancers').data.find((candidate: IAppengineLoadBalancer) => {\n return candidate.name === loadBalancerParams.name && candidate.account === loadBalancerParams.accountId;\n });\n\n setData(loadBalancer);\n setLoading(false);\n\n if (!loadBalancer) {\n autoClose();\n }\n };\n\n useEffect(() => {\n refetch();\n const unsubscribe = app.getDataSource('loadBalancers').onRefresh(refetch);\n return () => unsubscribe();\n }, [loadBalancerParams.name, loadBalancerParams.accountId, loadBalancerParams.region]);\n\n return { data, loading, error: null, refetch };\n}\n","import React from 'react';\n\nimport type { ILoadBalancerDetailsSectionProps } from '@spinnaker/core';\n\nimport type { IAppengineLoadBalancer } from '../../domain';\n\nexport function AppengineLoadBalancerDetailsSection({ loadBalancer }: ILoadBalancerDetailsSectionProps) {\n const appengineLoadBalancer = loadBalancer as IAppengineLoadBalancer;\n const allocations = appengineLoadBalancer.split?.allocations || {};\n\n return (\n <div className=\"content-section\">\n <div className=\"content-section-heading\">Traffic Split</div>\n <dl className=\"dl-horizontal dl-narrow\">\n <dt>Account</dt>\n <dd>{appengineLoadBalancer.account || appengineLoadBalancer.credentials}</dd>\n <dt>Region</dt>\n <dd>{appengineLoadBalancer.region}</dd>\n <dt>Shard By</dt>\n <dd>{appengineLoadBalancer.split?.shardBy || 'Unspecified'}</dd>\n </dl>\n {Object.keys(allocations).length > 0 && (\n <table className=\"table table-condensed\">\n <thead>\n <tr>\n <th>Server Group</th>\n <th>Allocation</th>\n </tr>\n </thead>\n <tbody>\n {Object.entries(allocations).map(([serverGroup, allocation]) => (\n <tr key={serverGroup}>\n <td>{serverGroup}</td>\n <td>{Math.round(allocation * 1000) / 10}%</td>\n </tr>\n ))}\n </tbody>\n </table>\n )}\n </div>\n );\n}\n"]}
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "https://github.com/spinnaker/spinnaker.git"
6
6
  },
7
7
  "license": "Apache-2.0",
8
- "version": "2026.4.0",
8
+ "version": "2026.4.2",
9
9
  "module": "dist/index.js",
10
10
  "typings": "dist/index.d.ts",
11
11
  "publishConfig": {
@@ -40,5 +40,5 @@
40
40
  "shx": "0.3.3",
41
41
  "typescript": "5.0.4"
42
42
  },
43
- "gitHead": "8d2819815061bd8ddc714287d229fce3d3d0a16b"
43
+ "gitHead": "a455cb2bf1d417754d40d8f575ee5514d4bc2abd"
44
44
  }
@@ -20,6 +20,7 @@ export function DeployAppengineConfigurationConfig({ application, pipeline, stag
20
20
  onChange={updateStage}
21
21
  pipeline={pipeline}
22
22
  stage={stageWithDefaults}
23
+ liveStage={stage}
23
24
  validate={validateDeployAppengineConfigurationStage}
24
25
  render={(props) => <DeployAppengineConfigForm {...props} />}
25
26
  />