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

Allow project.prefix to use overridden value #1132

Closed
wants to merge 1 commit into from
Closed

Allow project.prefix to use overridden value #1132

wants to merge 1 commit into from

Conversation

bobbygryzynger
Copy link
Contributor

@bobbygryzynger bobbygryzynger commented Feb 23, 2017

Changes proposed:

  • Allow the commit message hook to get project.prefix from BLT so that an overridden value may be used (such as one in project.local.yml).

@grasmash grasmash added the Enhancement A feature or feature request label Feb 28, 2017
@grasmash
Copy link
Contributor

This makes sense to me, but it further slows down an already very slow set of git hooks. I wonder if we could use a faster approach than running a BLT command?

@bobbygryzynger
Copy link
Contributor Author

We could run yaml-cli get:value $ROOT_DIR/blt/project.yml project.prefix and then check if $ROOT_DIR/blt/project.local.yml exists and has a value for project.prefix.

I don't know that this ends up being substantially faster and I don't like that it essentially duplicates BLT's internal overriding process.

Did you have any other ideas?

@bobbygryzynger
Copy link
Contributor Author

bobbygryzynger commented Mar 6, 2017

@grasmash - another approach I've thought about here is making project.prefix an array.

The reason I'd like to be able to use an overridden value (or multiple values) is that in my multisite context, there are multiple projects, each with their own project prefix. I'm finding myself forced to update my project.yml in order to commit changes and then revert this change to project.yml afterwards (and hope I don't forget and accidentally commit the change later on).

Ideally, project.prefix could be overridden in sites/*/site.yml but I could settle for multiple values being passed to the regular expression in commit-msg.

Would you be open to this change rather than going through BLT itself?

@grasmash
Copy link
Contributor

@bobbygryzynger Can't you just use site.yml right now to override project.prefix on per-site basis?

@grasmash
Copy link
Contributor

If not, yes I'd prefer this approach:

We could run yaml-cli get:value $ROOT_DIR/blt/project.yml project.prefix and then check if $ROOT_DIR/blt/project.local.yml exists and has a value for project.prefix.

Even though it's duplicative. It should be much faster.

@bobbygryzynger
Copy link
Contributor Author

@grasmash unfortunately no, you can't use site.yml because those overrides are loaded by BLT.

Any solution allowing this to be used would require retrieving project.prefix from BLT. But even that is not entirely viable because during a commit you wouldn't be able to specify what site the commits are for in order to load the correct overrides.

For now, just checking values within project.local.yml is the simplest solution. I'll update the PR.

@bobbygryzynger
Copy link
Contributor Author

Closing see #1259.

grasmash pushed a commit that referenced this pull request Mar 25, 2017
* Allow project.prefix to be override with a local value.

* Fix comment typo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A feature or feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants