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

Validator provides incorrect diagnostics for duplicate mapping keys when tasks are also present

    XMLWordPrintable

    Details

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

      Description

      Given this config:

      buildvariants:
        - matrix_name: "kerberos-unit"
          matrix_spec:
            auth-and-ssl: kerberos
            auth-and-ssl: "noauth-and-nossl"
          tasks:
            - name: "test-kerberos"
      

      Validator reports the following error:

      serene2% evergreen validate .evergreen/test.yml
      ERROR: load project error(s): error unmarshalling into parser project: invalid configuration file: parsing matrix: yaml: unmarshal errors:
        line 7: cannot unmarshal !!map into string
      .evergreen/test.yml is an invalid configuration
      

      This error:

      • Is not understandable by an evergreen user. What is !!map, why is it being unmarshaled into a string, and what does this have to do with the provided configuration?
      • Reports this unintelligible issue on a line which is not problematic (line 7).
      • Does not report the actual issue (auth-and-ssl key is duplicated).

      Removing the task name to obtain this file:

      buildvariants:
        - matrix_name: "kerberos-unit"
          matrix_spec:
            auth-and-ssl: kerberos
            auth-and-ssl: "noauth-and-nossl"
          tasks:
      

      produces the expected error:

      serene2% evergreen validate .evergreen/test.yml
      ERROR: load project error(s): error unmarshalling into parser project: invalid configuration file: parsing matrix: yaml: unmarshal errors:
        line 5: mapping key "auth-and-ssl" already defined at line 4
      .evergreen/test.yml is an invalid configuration
      

      Full working config which validates and has extra fields to validate:

      axes:
        - id: auth-and-ssl
          values:
            - id: kerberos
       
      buildvariants:
        - matrix_name: "kerberos-unit"
          matrix_spec:
            auth-and-ssl: kerberos
          tasks:
            - name: "test-kerberos"
       
      tasks:
        - name: "test-kerberos"
          commands:
            - func: one
       
      functions:
        one:
      

      Same config with the key duplicated producing the error described:

      axes:
        - id: auth-and-ssl
          values:
            - id: kerberos
       
      buildvariants:
        - matrix_name: "kerberos-unit"
          matrix_spec:
            auth-and-ssl: kerberos
            auth-and-ssl: kerberos1
          tasks:
            - name: "test-kerberos"
       
      tasks:
        - name: "test-kerberos"
          commands:
            - func: one
       
      functions:
        one:
      

      serene2% evergreen validate .evergreen/test.yml
      ERROR: load project error(s): error unmarshalling into parser project: invalid configuration file: parsing matrix: yaml: unmarshal errors:
        line 12: cannot unmarshal !!map into string
      .evergreen/test.yml is an invalid configuration
      

        Attachments

          Activity

            People

            Assignee:
            backlog-server-evg Backlog - Evergreen Team
            Reporter:
            oleg.pudeyev Oleg Pudeyev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: