Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Integrate with new remote parts #590
Conversation
elopio
reviewed
Jun 23, 2016
| + :param str part_name: The name of the part to query from the wiki | ||
| + :param dict properties: The current set of properties | ||
| + :return: Part properties from the wiki composed with the properties | ||
| + passed as a parameter. If there is no wiki part named name, |
elopio
Jun 23, 2016
Member
What about:
If there is no wiki part with the name passed as parameter, just the properties parameter will be returned.
sergiusens
Jun 23, 2016
Collaborator
I actually need to remove this as we a return a KeyError instead ;-)
elopio
reviewed
Jun 23, 2016
| + passed as a parameter. If there is no wiki part named name, | ||
| + properties will be returned. | ||
| + :rtype: dict | ||
| + :raises KeyError: if the part named name is not found in the wiki. |
elopio
reviewed
Jun 23, 2016
| @@ -144,14 +144,12 @@ def _process_parts(self): | ||
| plugin_name = properties.pop('plugin', None) | ||
| if not plugin_name: | ||
| logger.info( | ||
| - 'Searching the wiki to compose part "{}"'.format( | ||
| - part_name)) | ||
| + 'Searching in the remotes parts cache for part ' |
|
I think the mosquitto example is failing here because it is not defined in the new wiki. test_wiki.WikiTestCase.test_pull_wiki_parttesttools.testresult.real._StringException: output: {{{ Seems legit failure. |
elopio
reviewed
Jun 24, 2016
| + 'in the defined remote parts, {!r} is missing the ' | ||
| + '`plugin` entry and is not defined in the current ' | ||
| + 'remote parts cache, try to run `snapcraft update` ' | ||
| + 'to refresh'.format(part_name)) |
elopio
Jun 24, 2016
Member
This is hard to read, three commas in a sentence. I would remove the first sentence and just say: {!r} is not defined in the current remote parts cache, try to run snapcraft update to refresh. And maybe add a help entry were we explain more? So we can finish the message with: Type snapcraft help remote-parts for more information.
Just my opinion, I'm not sure my proposal is better.
elopio
reviewed
Jun 24, 2016
| - # The wiki still supports using 'type' for snapcraft 1.x | ||
| - if 'type' in properties: | ||
| - del properties['type'] | ||
| + except KeyError: |
elopio
reviewed
Jun 24, 2016
| + 'in the defined remote parts, {!r} is missing the ' | ||
| + '`plugin` entry and is not defined in the current ' | ||
| + 'remote parts cache, try to run `snapcraft update` ' | ||
| + 'to refresh'.format(part_name)) | ||
| if not plugin_name: | ||
| raise PluginNotDefinedError(part_name) |
elopio
Jun 24, 2016
Member
this is also missing coverage. Seems closely related to your branch, but feel free to report it as an error to be fixed later.
elopio
reviewed
Jun 24, 2016
| self._part_names.append(dep) | ||
| + else: | ||
| + logger.info('Maybe {!r} is defined as a remote part, ' | ||
| + 'run `snapcraft update` to refresh') |
elopio
Jun 24, 2016
Member
also missing a test. And should this be an error, shouldn't it?
This logic is so weird. I think this else should raise the exception.
And I don't have it clear if in that case, the following statement is needed.
Splitting smaller functions with nice names out of these loops would be nice, but again, maybe for a future refactor.
sergiusens
Jun 24, 2016
Collaborator
El 24/06/16 a las 03:04, Leo Arias escribió:
In snapcraft/internal/yaml.py
ubuntu-core#590 (comment):self._part_names.append(dep)
else:logger.info('Maybe {!r} is defined as a remote part, ''run `snapcraft update` to refresh')also missing a test. And should this be an error, shouldn't it?
This logic is so weird. I think this else should raise the exception.
And I don't have it clear if in that case, the following statement is
needed.
Splitting smaller functions with nice names out of these loops would be
nice, but again, maybe for a future refactor.
I couldn't agree more, tis is all horrible legacy code that needs some love (all of snapcraft.internal.yaml)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/ubuntu-core/snapcraft/pull/590/files/a60b0459d698406fc3c67017a4c1009550f38566#r68357000,
or mute the thread
https://github.com/notifications/unsubscribe/ABF_5ZWIuEVRP5YigYeqE-UeqU8CXCZVks5qO3N7gaJpZM4I7W40.
sergiusens
added some commits
Jun 22, 2016
|
|
sergiusens commentedJun 22, 2016
No description provided.