Uploaded image for project: 'Evergreen'
  1. Evergreen
  2. EVG-12664

Allow setting default project on a per-directory basis.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: current_quarter
    • Component/s: app
    • Labels:
      None

      Description

      On STM we have to work in a large number of repos, branches and Evergreen projects, so it'd be great if the evergreen CLI client let me set default projects on a per-directory basis.

      Here's an example of what I'd like to do in my ~/.evergreen.yml config:

      api_server_host: https://evergreen.mongodb.com/api
      ui_server_host: https://evergreen.mongodb.com
      api_key: ...
      user: richard.samuels
      projects:
      - name: mongodb-mongo-master
        default: true
      directory:
        "/Users/rsamuels/mongodb/mongo":
          project: mongodb-mongo-master
        "/Users/rsamuels/mongodb/myothermongoworktree":
          project: mongodb-mongo-master
        "/Users/rsamuels/mongodb/mongo-v44":
          project: mongodb-mongo-v4.4
        "/Users/rsamuels/mongodb/thingy":
          project: thingy
        "/Users/rsamuels/mongodb/thingy/somebodyusedasubmodulesigh":
          project: otherthing
      

      The existing project "default: true" will behave with the lowest precedence, the new proposed structure is a higher precedence, and the -p flag is the highest precedence, always overriding what's specified in the config file.

      When evergreen patch or evergreen commit-queue merge (and other commands where this makes sense) are called, they'll check if the CWD is one of the directories listed under the directory key above, or a child of one of those directories, and override the default project with the one specified in the directories map if it exists.

      Please check and resolve symbolic links with os.Lstat and os.ReadLink on the CWD and the directories listed in the config. (there is no need to assert that any of these directories exist. Doing so would not be useful) The above structure also allows this override mechanism to be expanded in the future to accommodate additional flags.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-evg Backlog - Evergreen Team
            Reporter:
            richard.samuels Richard Samuels
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: