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

(GH-217) Additional improvements to fine-grained templates #294

Merged
merged 12 commits into from
Dec 30, 2020
Merged

(GH-217) Additional improvements to fine-grained templates #294

merged 12 commits into from
Dec 30, 2020

Conversation

AdmiringWorm
Copy link
Member

@AdmiringWorm AdmiringWorm commented Sep 16, 2020

Depends on PR #292

Description

This pull request adds quite some additional changes, among these changes are:

  1. Change to a seperate class for the actual logic of the template parser (with a factory) (alternatively an absolute path can be passed in to the program to specifically load that file).
  2. Create a template loader to allow both embedded resources and physical files in different locations.
  3. Seperate out the single template file to multiple files that can be overridden alone.
  4. Add a template-dir property in the yaml file to decide where templates are loaded from (or extracted to).
  5. Hide the existing footer yaml properties in the sample (to encourage usage of scriban template files instead)
  6. Improve the generated release notes by removing multiple empty lines (considered bad practice in general, and causes issues with different markdown linters).
  7. I think there was more, but forgot.

Related Issue

Relates to already closed issue #217 (this pull request finishes up that request).

Motivation and Context

To allow more fine-grained release notes.

How Has This Been Tested?

This have been tested through trial and error, mostly with new unit tests but also some basic generation of release notes locally.

Screenshots (if appropriate):

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (On my TODO list)
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed. (Not been able to verify the integration tests due to access restriction).

@AdmiringWorm AdmiringWorm requested a review from gep13 September 16, 2020 10:59
@AdmiringWorm
Copy link
Member Author

Build failure is due to codecov (rebased and force pushed in a too short of a timespan).

@AdmiringWorm AdmiringWorm marked this pull request as ready for review September 16, 2020 22:56
@AdmiringWorm
Copy link
Member Author

@gep13 Documentation is now updated, I believe this is now ready for a review.

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2020

Codecov Report

Merging #294 into develop will increase coverage by 0.52%.
The diff coverage is 81.92%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #294      +/-   ##
===========================================
+ Coverage    78.36%   78.88%   +0.52%     
===========================================
  Files           54       57       +3     
  Lines         1137     1274     +137     
  Branches       131      160      +29     
===========================================
+ Hits           891     1005     +114     
- Misses         225      247      +22     
- Partials        21       22       +1     
Impacted Files Coverage Δ
...tReleaseManager.Core/Configuration/CreateConfig.cs 100.00% <ø> (ø)
...GitReleaseManager.Core/Options/CreateSubOptions.cs 85.71% <0.00%> (ø)
...c/GitReleaseManager.Core/Options/InitSubOptions.cs 0.00% <0.00%> (ø)
src/GitReleaseManager.Core/Commands/InitCommand.cs 26.92% <10.00%> (-60.58%) ⬇️
src/GitReleaseManager.Core/Helpers/FileSystem.cs 27.77% <50.00%> (+11.11%) ⬆️
...easeManager.Core/Configuration/ConfigSerializer.cs 86.66% <72.72%> (-3.34%) ⬇️
...itReleaseManager.Core/Templates/TemplateFactory.cs 80.00% <80.00%> (ø)
...c/GitReleaseManager.Core/Commands/CreateCommand.cs 100.00% <100.00%> (ø)
src/GitReleaseManager.Core/Configuration/Config.cs 100.00% <100.00%> (ø)
...ReleaseManager.Core/Extensions/StringExtensions.cs 100.00% <100.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 156a666...6f58eb7. Read the comment docs.

Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

Just a minor thing that I think needs to be added.

docs/input/docs/configuration/template-configuration.md Outdated Show resolved Hide resolved
@gep13
Copy link
Member

gep13 commented Dec 28, 2020

@AdmiringWorm based on what I am seeing here, am I right in saying that this change isn't a breaking change? Any existing usage of configuration values in the YAML file should continue to work, right?

@gep13
Copy link
Member

gep13 commented Dec 28, 2020

@AdmiringWorm looks like some unit tests are now failing as well. Not sure if that is due to some of the changes that I have made in the develop branch or not.

@AdmiringWorm
Copy link
Member Author

@AdmiringWorm based on what I am seeing here, am I right in saying that this change isn't a breaking change? Any existing usage of configuration values in the YAML file should continue to work, right?

Correct, there shouldn't be any breaking changes, although the intention is for the template files to eventually replace the configured template strings in the yaml file (but for now, just hiding them when they are default values should be enough).

@AdmiringWorm looks like some unit tests are now failing as well. Not sure if that is due to some of the changes that I have made in the develop branch or not.

Hmm, could be related to those changes, but I need to look into it before I can say for sure.

@AdmiringWorm
Copy link
Member Author

I think there might have been a breaking change in the Scriban library (you updated it from 2.1.4 to 3.x), can't seem to find any reference to a breaking change though 😕

@codecov-io
Copy link

Codecov Report

Merging #294 (09c2a6b) into develop (ab75056) will increase coverage by 0.52%.
The diff coverage is 81.92%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #294      +/-   ##
===========================================
+ Coverage    78.36%   78.88%   +0.52%     
===========================================
  Files           54       57       +3     
  Lines         1137     1274     +137     
  Branches       131      160      +29     
===========================================
+ Hits           891     1005     +114     
- Misses         225      247      +22     
- Partials        21       22       +1     
Impacted Files Coverage Δ
...tReleaseManager.Core/Configuration/CreateConfig.cs 100.00% <ø> (ø)
...GitReleaseManager.Core/Options/CreateSubOptions.cs 85.71% <0.00%> (ø)
...c/GitReleaseManager.Core/Options/InitSubOptions.cs 0.00% <0.00%> (ø)
src/GitReleaseManager.Core/Commands/InitCommand.cs 26.92% <10.00%> (-60.58%) ⬇️
src/GitReleaseManager.Core/Helpers/FileSystem.cs 27.77% <50.00%> (+11.11%) ⬆️
...easeManager.Core/Configuration/ConfigSerializer.cs 86.66% <72.72%> (-3.34%) ⬇️
...itReleaseManager.Core/Templates/TemplateFactory.cs 80.00% <80.00%> (ø)
...c/GitReleaseManager.Core/Commands/CreateCommand.cs 100.00% <100.00%> (ø)
src/GitReleaseManager.Core/Configuration/Config.cs 100.00% <100.00%> (ø)
...ReleaseManager.Core/Extensions/StringExtensions.cs 100.00% <100.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab75056...09c2a6b. Read the comment docs.

@gep13
Copy link
Member

gep13 commented Dec 30, 2020

@AdmiringWorm looks like bumping to 3.3.0 has fixed the issues that we were seeing with this PR.

Will take another look over it later today, and get it merged in.

@gep13
Copy link
Member

gep13 commented Dec 30, 2020

This was the Scriban issue for reference.

@gep13
Copy link
Member

gep13 commented Dec 30, 2020

@AdmiringWorm I have no idea why GitVersion is working properly on the CI build, but I am going to YOLO it...

@gep13 gep13 merged commit bac02d9 into GitTools:develop Dec 30, 2020
@gep13
Copy link
Member

gep13 commented Dec 30, 2020

@AdmiringWorm your changes have been merged, thanks for your contribution 👍

gittools-bot pushed a commit that referenced this pull request Dec 30, 2020
Merge pull request #294 from AdmiringWorm/template-improvements

(GH-217) Additional improvements to fine-grained templates
@AdmiringWorm AdmiringWorm deleted the template-improvements branch December 30, 2020 18:01
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.

4 participants