Provides an option to remove the inessential version number from the generated models #18081
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
Fixes: #15597
Description
The linked issue started with a point raised on why we include the commit hash in the version number. This does no harm to keep. But the discussion continued to ask if it's necessary to output the version number at all and established that it's not essential, but could be useful for debugging.
The downside - and we found this when working on umbraco.com - is every Umbraco upgrade leads to a lot of changes to these files, which are seemingly unnecessary and can clutter pull requests.
To avoid a behavioural breaking change, even if a harmless one, I've added configuration option to allow you to switch off the inclusion of the version number.
We could consider making this option default to
false
in a future version, but it's probably OK as is and can be turned on for people that want to avoid the version writing behaviour.To Test:
\umbraco\models\
), and that they include the version number in the[GeneratedCode]
attribute.\umbraco\models\
), and that they don't include the version number.