Closed Tcharl closed 2 years ago
Not sure to understand well this ticket. It's probably related to what @mshima has already done with liquibase ?
Hi @pascalgrimaud , sorry for not being clear enough, let me take a concrete example so that it will illustrate what I have in mind.
In a first round, the end user will define a simple (sprint 0) jdl entity:
entity Article {
name String
}
Instead of generating an article.json
in the .jhipster folder of a project, it would generate a <timetamp>-article.json
file with the exact following content:
{
"name": "Article",
"action": "add"
"fields": [
{
"fieldName": "title",
"fieldType": "String",
"action": "add"
}]
}
Then, in a second time, the user will improve his entity model, for example adding a new field:
entity Article {
name String
description String
}
While reimporting, instead of erasing the article.json file, it would generate another <timetamp2>-article.json
file containing only the patch compared to the first generation
{
"name": "Article",
"action": "modify"
"fields": [
{
"fieldName": "description",
"fieldType": "String",
"action": "add"
}]
}
Are the benefits expressed in the "motivation" section of the ticket now more clear?
Ok I understand the feature, thanks.
Now, my next question is:
It there a specific usecase which is important for having this, for our end-users ?
My workflow on real JHipster projects:
In my workflow, I don't look into entity.json
, having 1 or more, doesn't impact my work, but I'd like to understand the value of having xxxx-entity.json ?
Let me try to describe the potential value brought by this approach.
I use the exact same workflow as you hopefully, but I'm sometimes struggling with this, here are my pain points:
Sometimes, I added some 'hand crafted' logic on the generated entities. Concrete examples I've currently:
@Field(type = FieldType.Keyword)
on some of my entity's attributes, a @Secured(roleAllowed=...) on some serviceImpl, a specific @Setting
on some entities, or even some inheritance on my entities (it's a 3 million-line microservice project, so there are for sure some edge cases).So usually, I unfortunately do a compare and cherry pick the regenerated changes at your step 2 instead of blindly accepting what jhipster regenerated for me: so loss of time, no really confident to deliver what has been modified and finally a not that enjoyable jhipster experience. However it works and jhipster fill my need: free stack update is a breeze so I'm really happy to be a hipster.
Pro-tip: I found another way process to mitigate that pain points for the second step:
--json-only
flag while generatingNow, let see how patches could resolve or mitigate my pain points:
Ok then.
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
Overview of the feature request
We may be inspired by framework we're using in our generated code, for example liquibase in this particular case. Generating patch (commitid-entityname.json or timestamp-entityname.json) could bring some new cool capabilities to our end users
Motivation for or Use Case
What do you think about it?