Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/postgesql fix #2

Merged
merged 22 commits into from
Feb 27, 2018
Merged

Conversation

ggotti
Copy link
Collaborator

@ggotti ggotti commented Feb 26, 2018

Split scaling out from performance and correction for Postgres provisioning

  • Fixed issue with Postgresql database instance not being provisioned correctly.
  • Split out scaling from performance, to allow instances to be scaled out differently.
  • Limited input for Stack Name input.
  • Correct issue with path name resolution.

Gerard Gigliotti and others added 18 commits January 22, 2018 14:26
New AWS sub-generator which uses Amazon ECS to run JHipster monolithic applications.

Closes jhipster#6773
Moved constants from index.js into a separate aws-containers generator specific file
# Conflicts:
#	generators/aws-containers/index.js
#	generators/aws-containers/prompts.js
#	generators/aws-containers/templates/_application.template.yml
#	generators/aws-containers/templates/_base.template.yml
#	generators/docker-base.js
#	generators/docker-utils.js
#	generators/generator-base.js
const prodDatabaseType = config.prodDatabaseType;

if(prodDatabaseType === databaseTypes.postgresql) {
this.log.ok(` ⚠️ Postgresql databases are currently only supported by Aurora on high-performance database instances`);
Copy link
Owner

Choose a reason for hiding this comment

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

This is not ok, The hot tub is too hot.
change the log and use chalk to either use orange or red

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Dead to me

};
});

if (perf.database.supportedEngines.includes(prodDatabaseType)) {
Copy link
Owner

Choose a reason for hiding this comment

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

what is the else return value?

Copy link
Owner

Choose a reason for hiding this comment

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

Also, could you put the check perf.database.supportedEngines.includes(prodDatabaseType) in a variable?
I'm thinking isEngineSupported

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🌮

choices: performanceLevels,
default: awsConfig.performance,
validate: (input) => {
Copy link
Owner

Choose a reason for hiding this comment

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

Why did you return the validation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because it doesn't work. 🌮 🌷

@@ -1,3 +1,4 @@

Copy link
Owner

Choose a reason for hiding this comment

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

Delete line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🌮


return 'Stack\'s name cannot be empty!';
}
validate: input => ((_.isEmpty(input) || !input.match(CLOUDFORMATION_STACK_NAME)) ? 'Stack name must contain letters, digits, or hyphens ' : true)
Copy link
Owner

Choose a reason for hiding this comment

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

You can ditch the parenthesis. Also I don't know how I feel about the ternary operator for this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done


const AURORA_DB_PASSORD_REGEX = /^[^@"\/]{8,42}$/; // eslint-disable-line
const CLOUDFORMATION_STACK_NAME = /[a-zA-Z][-a-zA-Z0-9]*/; // eslint-disable-line

const SCALING_TO_CONFIG = {
Copy link
Owner

Choose a reason for hiding this comment

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

I think you should merge back the two objects and then move the map done in both scaling and performance prompts here as constants.
Example: performanceLevels from promptPerformance becomes PERFORMANCE_PROMPT_CHOICES.

Copy link
Owner

Choose a reason for hiding this comment

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

Just realised that we did those mapping in the function when there is no need to do so as we don't need anything from the running context

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd prefer to leave this because I've separated the concepts.

let dependency = `${group}:${name}`;
if (version) {
dependency += `:${version}`;
}
try {
jhipsterUtils.rewriteFile({
file: fullPath,
path: directory,
file: 'build.gradle',
Copy link
Owner

Choose a reason for hiding this comment

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

That's very good

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🌮

@carvallegro carvallegro merged commit 058bc59 into feature/aws-containers Feb 27, 2018
BenEdridge pushed a commit that referenced this pull request Feb 27, 2018
* new aws-containers sub-generator

New AWS sub-generator which uses Amazon ECS to run JHipster monolithic applications.

Closes jhipster#6773

* external constants to localised file

Moved constants from index.js into a separate aws-containers generator specific file

* testing and linting errors

* add back missing constants from aws-containers

* address issue where the base.template is not being read correctly

* Pull Requests review fixs

* wording

* Wording

* Use the Spring Cloud Context version from jhipster-dependencies

* Use the version from jhipster-dependencies

* Wording

* Corrected issues with Postgresql database not deploying correctly

* Switched out NLB for ALB

* Split scaling out from performance question

* Added nesting supporting into repo name

* Added stack name checking

* Corrected issues with the path lookup

* Code review feedback

* Fixed linting errors

* Swapped out bootRepackage for bootWar
ggotti added a commit that referenced this pull request Mar 5, 2018
* new aws-containers sub-generator

New AWS sub-generator which uses Amazon ECS to run JHipster monolithic applications.

Closes jhipster#6773

* external constants to localised file

Moved constants from index.js into a separate aws-containers generator specific file

* testing and linting errors

* add back missing constants from aws-containers

* address issue where the base.template is not being read correctly

* Pull Requests review fixs

* wording

* Wording

* Use the Spring Cloud Context version from jhipster-dependencies

* Use the version from jhipster-dependencies

* Wording

* Corrected issues with Postgresql database not deploying correctly

* Switched out NLB for ALB

* Split scaling out from performance question

* Added nesting supporting into repo name

* Added stack name checking

* Corrected issues with the path lookup

* Code review feedback

* Fixed linting errors

* Swapped out bootRepackage for bootWar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants