-
Notifications
You must be signed in to change notification settings - Fork 550
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
refactor(templates): introduce alternative folders #3897
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Continuing @julienrbrt's work with the minimal chain feat, this change updates a little bit the way some template can be overrided. Initially, there was an alternate file `app_config_minimal.go` that existed belong to the other files, and this file had to be excluded by default. I suggest to introduce an alternative using folders, aside the initial `files`. So for the minimal chain, there's now a new `files-minimal` folder that contains all the files that will be overrided from the ones in `files`, when a minimal chain is scaffolded. This simplify the include/exclude logic, which could become very cumbersome if we need to introduce a second alternative like for the consumer chain. This also avoid conflicts. The rule to follow in my opinion is, when the templates contains too many `<%= if IsCondition >`, then you should probably introduce an alternative `files-*` folder. This is exactly what I'm going to do for the consumer chain (see #3660).
tbruyelle
requested review from
salmad3,
toschdev,
ilgooz,
jeronimoalbi,
Pantani,
julienrbrt and
Ehsan-saradar
as code owners
January 19, 2024 11:42
github-actions
bot
added
component:ci
CI/CD workflow and automated jobs.
component:templates
component:configs
labels
Jan 19, 2024
julienrbrt
changed the title
refac(templates): introduce alternative folders
refactor(templates): introduce alternative folders
Jan 19, 2024
julienrbrt
reviewed
Jan 19, 2024
julienrbrt
previously approved these changes
Jan 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK.
julienrbrt
approved these changes
Jan 19, 2024
julienrbrt
reviewed
Jan 19, 2024
julienrbrt
approved these changes
Jan 20, 2024
salmad3
approved these changes
Jan 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice and thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Continuing @julienrbrt's work with the minimal chain feat (#3835), this change updates a little bit the way some template can be overrided.
Initially, there was an alternate file
app_config_minimal.go
that existed belong to the other files, and this file had to be excluded by default.I suggest to introduce an alternative using folders, aside the initial
files
. So for the minimal chain, there's now a newfiles-minimal
folder that contains all the files that will override from the ones infiles
, when a minimal chain is scaffolded.This simplify the include/exclude logic, which could become very cumbersome if we need to introduce a second alternative like for the consumer chain. This also avoid conflicts.
The rule to follow in my opinion is, when the templates contains too many
<%= if IsCondition >
, then you should probably introduce an alternativefiles-*
folder. This is exactly what I'm going to do for the consumer chain (see #3660).