Repository navigation
Conversation
| return addon.name.match(pluginNameRegex)[2]; | ||
| _plugins: function() { | ||
| var registry = new PluginRegistry(this.project, this.config, this.ui); | ||
| return registry.plugins(); |
There was a problem hiding this comment.
@achambers for when you rebase, I think the call to the validation function might go here (?)
24d62c1 to
a17adad
Compare
| }); | ||
|
|
||
| if (unknownAddons.length) { | ||
| var message = chalk.yellow('You have referenced the following uninstalled addons in `' + configKey + '`:\n'); |
There was a problem hiding this comment.
nitpick but
is uninstalled the right wording here? I assume this is replacing the old
plugins configuration references plugins which are not available. message right?
maybe should be You have referenced the following addons in ... and they're not installed or something similar
There was a problem hiding this comment.
Yeh, I'm not precious about the copy. Happy to change it to whatever you feel describes things best
There was a problem hiding this comment.
cool, luke approves so feel free to take what I have up there
|
@achambers had a first look, very nice! just a couple of tiny comments so far. |
| } else { | ||
| ui.writeError('Use of the `config.plugins` property has been deprecated.\n'); | ||
| ui.writeError('Please use the new plugin controls\n'); | ||
| ui.writeError('See https://some-url for more information\n'); |
There was a problem hiding this comment.
TODO: update the URL here
There was a problem hiding this comment.
Yep, the one failing test is reminding me of exactly that
a17adad to
6fb2f26
Compare
|
@achambers could you close and reopen to target |
|
|
||
| _pluginNameFromAddonName: function(addon) { | ||
| var pluginNameRegex = /^(ember\-cli\-deploy\-)(.*)$/; | ||
| return addon.name.match(pluginNameRegex)[2]; |
There was a problem hiding this comment.
on an initial test in a real project this ends up erroring badly
I think you need to guard this or maybe there's something else going on?
There was a problem hiding this comment.
Thanks mate. Will have a look tonight
There was a problem hiding this comment.
@achambers I think you just need to move line 47 var name = self._pluginNameFromAddonName(currentAddon); to inside the following if block. Testing on one of my apps works with that change. I think we need to add a test simulating the presence of an ember-cli addon that is not an ember-cli-deploy plugin,
|
works for me, if then you can also rebase that branch it would be golden |
|
Yep. Of course
|
|
Code and test coverage look good. I find the the chained functional style in the plugin registry a little hard to follow as a reader, but I think it's fine when paired with the comprehensive test coverage. |
|
Hmm. Bummer. Because I did it they way to make it easier to understand. There is quite a lot of logic going on to get the list of plugins so that style was intended to be more intention revealing. To tell a story about how we get from a list of adding to a list of plugins. Any thoughts on how I make it easier for the reader then? (Not something that's worth changing on this PR now but would like to follow up with it as this is there bulk of where the logic is so would like to make it easier to follow) |
|
PS - Thanks for reviewing. I'll fix up that error and at that test. |
|
@achambers not sure -- as you say, there is a lot of logic. The use of the intention-revealing method names is good. The names reveal "what" is happening. Perhaps code comments within the body of each of those methods could describe "how" it is happening? |
|
@lukemelia I guess I was trying to write it such that you don't really need to know how....The intention was that from this list: you can understand the following:
I was hoping, as a reader of the code, you wouldn't really need to know how each of those things worked. HOWEVER, I have had a couple of things on my mind in regards to things.
Are the 3 points described above more what you mean about the "how" it's working? I'm certainly happy to make some changes to make it more understandable as this is where the bulk of the work goes and, before pulling the logic out in to this object, I continuously got confused about what was going on in the pipeline if I wasn't frequently in the code....The same could still happen with this so it's in our own interests to make it easy to understand for when we find ourselves back here. |
|
I'll add some comments to the functions and push and see how we get on |
|
PS - I just ran some tests with some real deploys and all seems good to me once that bug is fixed. Anyone else see any major broken things? |
|
@achambers you summarized the challenges I had very well. Comments describing return value structure could help a bunch. For naming, I would expect the things you mentioned to be called "addon", "plugin", and "pluginInstance". |
|
Okie doke. Will apply the above and see what we come up with. Thanks Luke |
|
Not quite sure what the deal is with these failing tests....Can't seem to replicate on my local env.... Yu guys seen this? /cc @ghedamat @lukemelia |
0348197 to
9163752
Compare
|
Thanks for pushing this over the finish line! |
What Changed & Why
Explain what changed and why.
Related issues
Link to related issues in this or other repositories (if any)
PR Checklist
People
Mention people who would be interested in the changeset (if any)