jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.48k stars 4.02k forks source link

Blueprint generator fails on upgrade command #15617

Closed sendilkumarn closed 2 years ago

sendilkumarn commented 3 years ago
Overview of the issue

When running upgrade command from a project generated with blueprint, the upgrade command fails with version undefined error.

Motivation for or Use Case

It should not be mandatory for blueprints to implement upgrade subgenerator

Reproduce the error

Install KHipster & run khipster upgrade

.yo-rc.json
{
"generator-jhipster": {
"blueprints": [
{
"name": "generator-jhipster-kotlin",
"version": "1.12.1"
}
],
"otherModules": [
{
"name": "generator-jhipster-kotlin",
"version": "1.12.1"
}
],
"applicationType": "monolith",
"baseName": "test",
"jhipsterVersion": "7.0.1",
"skipClient": false,
"skipServer": false,
"skipUserManagement": false,
"skipCheckLengthOfIdentifier": false,
"skipFakeData": false,
"jhiPrefix": "jhi",
"entitySuffix": "",
"dtoSuffix": "DTO",
"testFrameworks": [],
"pages": [],
"creationTimestamp": 1624602504902,
"serviceDiscoveryType": false,
"reactive": false,
"authenticationType": "jwt",
"packageName": "com.mycompany.myapp",
"serverPort": "8080",
"cacheProvider": "ehcache",
"enableHibernateCache": true,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "postgresql",
"buildTool": "gradle",
"serverSideOptions": [],
"websocket": false,
"searchEngine": false,
"messageBroker": false,
"enableSwaggerCodegen": false,
"clientFramework": "react",
"withAdminUi": true,
"clientTheme": "none",
"enableTranslation": true,
"nativeLanguage": "en",
"packageFolder": "com/mycompany/myapp",
"jwtSecretKey": "YTEwMzFlZGM3NDA0ZTNlOWM0OWI2ZmY3MmUwZjdhNDYyN2RkYmUyZWM2YWEzZTZkOGUyNWVmYTdkN2RhYTIxNDk4YmY0YzdiM2Y0MzU0MWRmYTM4NzJjYTA3NmY1ODkxYWJjMDE5ZTViZDVjMDZiODJlYTFjMGU3MzIwZWFjZTY=",
"clientPackageManager": "npm",
"clientThemeVariant": "",
"languages": ["en"]
}
}
Related issues

https://github.com/jhipster/jhipster-kotlin/issues/286

Suggest a Fix

This check should return true when the version is undefined.

JHipster Version(s)

< 7.1.0

JHipster configuration

refer above

Entity configuration(s) entityName.json files generated in the .jhipster directory

N/A

Browsers and Operating System

N/A

mshima commented 3 years ago

Currently the blueprint version is required: https://github.com/jhipster/generator-jhipster/blob/ad341f560fe4130c9d3ba45cd4b5f15256f84530/generators/upgrade/index.js#L387 Just workaround that condition will not fix the problem.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

mshima commented 2 years ago

I will try to reproduce soon.

mraible commented 2 years ago

@sendilkumarn This references the Kotlin blueprint. Do you have an opinion about this?

mshima commented 2 years ago

Maybe this was fixed by https://github.com/jhipster/generator-jhipster/pull/17742/commits/d61fd1e2a8c086bd27c427a0fcdab89263782eaf