-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2821/add cap mta prompting #2889
base: main
Are you sure you want to change the base?
Conversation
…ng MTA to CAP project during deployment
🦋 Changeset detectedLatest commit: 77fffb4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
5ac258b
to
bbf0d8a
Compare
22ae923
to
bcb7c7d
Compare
|
if (isCAPMissingMTA) { | ||
DeploymentGenerator.logger?.debug(t('cfGen.debug.capMissingMTA')); | ||
// If launched as root generator, add a prompt to allow user decide if they want to add an MTA config | ||
let questions = (await getCFApprouterQuestionsForCap({ | ||
projectRoot: this.projectRoot ?? process.cwd() | ||
})) as Question[]; | ||
questions = withCondition(questions, (answers: Answers) => answers.addCapMtaContinue === true); | ||
questions.unshift(...getConfirmMtaContinuePrompt()); | ||
this.appRouterAnswers = (await this.prompt(questions)) as CfAppRouterDeployConfigAnswers; | ||
if ((this.appRouterAnswers as Answers).addCapMtaContinue !== true) { | ||
this.abort = true; | ||
return; | ||
} | ||
// Configure defaults | ||
this.destinationName = DefaultMTADestination; | ||
this.options.overwrite = true; // Don't prompt the user to overwrite files we've just written! | ||
this.answers = {}; | ||
this.answers.destinationName = this.destinationName; | ||
this.answers.addManagedAppRouter = false; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe put all the mta related code in this condition into a new function? But its just a suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @longieirl
- Code is clear
- Good test coverage added
- Not tested
Fix for #2821
Please note,
Add deployment
option is not shown to the user on the project attributes page if the mta config is missing, this, this is an as-is flow and is not changing. Launching the deployment generator as a root generator is where this change is only triggered.