codecov / feedback

A place to discuss feedback about the pull request and web product experience.
35 stars 6 forks source link

Server 500 when validating YAML #146

Open drazisil opened 11 months ago

drazisil commented 11 months ago

Describe the bug When attempting to use the https://codecov.io/validate endpoint to valid my codecov.yaml, I received a 500 error

To Reproduce Steps to reproduce the behavior:

  1. Create a codecov.yml file with the code snippet below
  2. In the directory where the file is,
  3. run curl --data-binary @codecov.yml https://codecov.io/validate
  4. See error

Expected behavior I would expect to be told what the error is. When checking with https://yamlchecker.com/, it said the YAML was valid. Since the error lies in the schema, and not the YAML parser, I would expect something more helpful then a server failure. I have a large codecov.yml file, and I got lucky at guessing the error.

I also have the Codecov VSCode extension installed, and it reported no error. VSCode is correctly identifying the file type as Codecov

It would be nice if the Codecov UI could also surface the error. The commit here https://app.codecov.io/gh/drazisil/mcos/commit/1bd4e2389eb1a718dcb695c97fd352f6389e1be4 shows an error, but gived no clue as to what and points me to the validation note in the doc.

Additional context The error lies in the type key under component_management: individual_components: component_id: statuses: not being prefixed with a dash.

Test Case

component_management:
    default_rules: # default rules that will be inherited by all components
        statuses:
            - type: project # in this case every component that doens't have a status defined will have a project type one
              target: auto
              branches:
                  - "!main"

    individual_components:
        - component_id: module_nps
          name: Team 2
          statuses:
              type: patch  # <-- This is the offending line
              target: auto
          paths:
              - lib/nps/**
eliatcodecov commented 1 month ago

since this is an old issue, @drazisil-codecov will re-evaluate to see if issue persists.