Github user dmitriy-barkalov commented on a diff in the pull request:

    https://github.com/apache/cordova-medic/pull/41#discussion_r27996739
  
    --- Diff: buildbot-conf/cordova.conf ---
    @@ -234,8 +245,15 @@ plugins_cleanup_steps = [
     common_plugins_steps = plugins_cleanup_steps + get_medic_steps + [
     
         # download medic's config to slave
    -    Download(mastersrc=PROJECTS_CONFIG_FILE, 
slavedest='cordova-medic/cordova-repos.json'),
    -    Download(mastersrc=MEDIC_CONFIG_FILE, 
slavedest='cordova-medic/config.json'),
    +    Download(mastersrc=MEDIC_CONFIG_FILE, 
slavedest='cordova-medic/config.json', description='downloading master\'s 
config'),
    +
    +    # download repo config
    +    # NOTE:
    +    #      only one of these steps should be executed; thanks
    +    #      to Buildbot there is no good if-else construct for
    +    #      builds, so we have two steps with 'doStepIf's
    +    SH(command=['curl', P(REPOS_PROPERTY_NAME), '--output', 
'cordova-medic/cordova-repos.json'], description='downloading custom repo 
config', doStepIf=dont_use_default_repos),
    +    Download(mastersrc=PROJECTS_CONFIG_FILE, 
slavedest='cordova-medic/cordova-repos.json', description='downloading default 
repo config', doStepIf=use_default_repos),
    --- End diff --
    
    I think it is over engineering to use conditional steps here. You have to 
implement 2 extra functions for this. Also it is confusing to user to always 
see two "downloading repo config" steps every time (one of them always skipped).
    
    In this particular place function like this could be used:
    ```
    def IfElse(condition, thenSteps, elseSteps):
        if (condition):
            return thenSteps
        else:
            return elseSteps
    ```
    ...
    ```
    IfElse(P(REPOS_PROPERTY_NAME) is None, 
Download(mastersrc=PROJECTS_CONFIG_FILE, 
slavedest='cordova-medic/cordova-repos.json', description='downloading default 
repo config'), Download(mastersrc=PROJECTS_CONFIG_FILE, 
slavedest='cordova-medic/cordova-repos.json', description='downloading default 
repo config')),
    ```
    This way there will be one step in build downloading repos from right place.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to