Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-7002

Only list needed imports in persisted configs

    Details

    • Type: Improvement
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: pex_config
    • Labels:
      None
    • Templates:
    • Team:
      Architecture

      Description

      When a config is persisted it may include many irrelevant import statements. There are at least 3 different pieces of code that output import statements to the config, and some of them should either be disabled or moderated.

      I have attached a horrid example that includes nearly 100 imports, including at least one private library, which is not safe. None of the initial imports is required (other than the first one, used for type checking).

      This Jenkins log shows a failure whose exact cause is unknown, but it was triggered by the excessive imports:
      https://ci.lsst.codes/job/stack-os-matrix/compiler=gcc,label=centos-7,python=py2/13307//console

      Here are links from Kian-Tat Lim to various bits of code that write import statements when saving a config, and he reports that there is also a third place where imports are written. The first one is probably responsible for writing out the unwanted configs in question:

      I suggest that only the minimal imports be written out, perhaps only those that were seen in any config override file.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ktl Kian-Tat Lim
                Reporter:
                rowen Russell Owen
                Watchers:
                Fritz Mueller, Jim Bosch, John Swinbank, Kian-Tat Lim, Russell Owen
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel