-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat(publish): Support for custom VCL logic #893
Conversation
Codecov Report
@@ Coverage Diff @@
## master #893 +/- ##
==========================================
- Coverage 91.75% 85.58% -6.18%
==========================================
Files 43 43
Lines 1796 1804 +8
==========================================
- Hits 1648 1544 -104
- Misses 148 260 +112
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #893 +/- ##
==========================================
+ Coverage 91.75% 91.84% +0.08%
==========================================
Files 43 43
Lines 1796 1814 +18
==========================================
+ Hits 1648 1666 +18
Misses 148 148
Continue to review full report at Codecov.
|
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.
- add tests for passing the vlc arguments to test/testPublishCli.js
src/remotepublish.cmd.js
Outdated
@@ -155,6 +158,30 @@ class RemotePublishCommand extends AbstractCommand { | |||
return this; | |||
} | |||
|
|||
withCustomVCL(value) { | |||
if (value && value.length > 0) { |
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.
from an API perspective, I think this should also allow adding single VLCs and update the internal this._vcl
.
otherwise, rename it to withCustomVCLs()
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.
Since the parameter custom-vcl
(list of file paths) has to be transformed into an object (name:contentoffile), I initially thought we could have the 2 methods to have the 2 ways of providing the data: either the list of files or the object directly. But you are right, this is confusing and introduce useless features. I removed the second method.
src/remotepublish.cmd.js
Outdated
return this; | ||
} | ||
|
||
withVCL(value) { |
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.
- no jsdoc
- what's the purpose of this in contrast to
withCustomVCL
? do you really need both? - needs to be an object, so name it
withVCLs
src/remotepublish.cmd.js
Outdated
@@ -155,6 +158,30 @@ class RemotePublishCommand extends AbstractCommand { | |||
return this; | |||
} | |||
|
|||
withCustomVCL(value) { |
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.
no jsdoc?
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.
ah ah. I adopted the jsdoc pattern of that file :) but you are right, that's not a reason, we need to start somewhere.
await remote.run(); | ||
|
||
assert.deepEqual(vcl, { | ||
extensions: fs.readFileSync(e).toString(), |
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.
async, please
|
||
// eslint-disable-next-line no-underscore-dangle | ||
assert.deepEqual(remote._vcl, { | ||
extensions: fs.readFileSync(e).toString(), |
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.
async please
Co-Authored-By: Tobias Bocanegra <tripodsan@users.noreply.github.com>
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
1 similar comment
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
Yeah... managed to bring the code coverage back to positive! |
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
🎉 This PR is included in version 3.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
PR for #812