Error: HTTP 400 - pr must match pattern - Github Actions

Hey, we are using Github Actions and sending reports in matrix after every single framework tests succeed. We are randomly seeing error HTTP 400, which disappears on re-run (usually, not always). Here is stack from Github Actions console:

8157 Pinging Codecov
8158 https://codecov.io/upload/v4?package=bash-tbd&token=secret&branch=messaging%2FInboxAccessibility&commit=f413d9771943fae3efbfbe2078f4c719103f8723&build=103596106&build_url=http%3A%2F%2Fgithub.com%2Fclassdojo%2Fdojo-behavior-ios%2Factions%2Fruns%2F123456789&name=&tag=&slug=classdojo%2Fdojo-behavior-ios&service=github-actions&flags=tests_ci&pr=refs/heads/messaging/InboxAccessibility&job=
8159 /dev/fd/13: line 1626: echo: write error: Broken pipe
8160 -> Uploading
8161 X> Failed to upload
8162 -> Sleeping for 30s and trying again...
8163  -> Uploading to Codecov
8164 HTTP 400
8165 pr must match pattern ^(\d+|false|null|undefined|true)$

I mentioned this also on Github for codecov-bash uploader (Broken pipe when appending adjustments · Issue #226 · codecov/codecov-bash · GitHub) but probably with no luck.

Anyone has similar issues?
We can’t use Github Actions app by Codecov because it doesn’t support -J and custom derived data path.

Thanks!

Hi @kaspik, this is really quite strange. However, I do see that your yaml is invalid. Can you post it here and I can see what the error might be?

Hey @tom, sure thing, thank you!

coverage:
  range: 50..80
  round: down
  precision: 2
  status:
    project:
      default:
        target: auto
      networking:
        flags: networking_tests_ci
      messaging:
        flags: messaging_tests_ci
      cduikit:
        flags: cduikit_tests_ci
      cdfoundation:
        flags: cdfoundation_tests_ci
comment:
  layout: "reach, diff, flags, files"
  behavior: default
  require_changes: false
  require_base: yes
  require_head: yes
  branches: null
flags:
  networking_tests_ci:
    paths:
      - Libraries/Networking
    carryforward: true
  messaging_tests_ci:
    paths:
      - Libraries/Messaging
    carryforward: true
  cduikit_tests_ci:
    paths:
      - Libraries/CDUIKit
    carryforward: true
  cdfoundation_tests_ci:
    paths:
      - Libraries/CDFoundation
    carryforward: true

Hi @Kaspik, can you try this?

coverage:
  range: 50..80
  round: down
  precision: 2
  status:
    project:
      default:
        target: auto
      networking:
        flags:
          - networking_tests_ci
      messaging:
        flags:
          - messaging_tests_ci
      cduikit:
        flags:
          - cduikit_tests_ci
      cdfoundation:
        flags: 
          - cdfoundation_tests_ci
comment:
  layout: "reach, diff, flags, files"
  behavior: default
  require_changes: false
  require_base: yes
  require_head: yes
  branches: null
flags:
  networking_tests_ci:
    paths:
      - Libraries/Networking
    carryforward: true
  messaging_tests_ci:
    paths:
      - Libraries/Messaging
    carryforward: true
  cduikit_tests_ci:
    paths:
      - Libraries/CDUIKit
    carryforward: true
  cdfoundation_tests_ci:
    paths:
      - Libraries/CDFoundation
    carryforward: true
1 Like

Thanks @tom, tried and so far no error yet :slightly_smiling_face:

I also realized we have an issue where every PR still says “Impacted files - 1500” even tho I didn’t touch them, and I think it’s because the codecov file is missing the main project mention (the default one - notice the change in flags with tests_ci - we basically have one project, with 4 frameworks inside, we run 5 PR checks - for each framework + for project tests - and this should cover all of them asynchronously). I updated it to following one, but still no luck and still see about 1500 impacted files on a PR with single line change. Any idea?

coverage:
  range: 50..80
  round: down
  precision: 2
  status:
    project:
      default:
        flags:
          - tests_ci
        target: auto
      networking:
        flags:
          - networking_tests_ci
      messaging:
        flags:
          - messaging_tests_ci
      cduikit:
        flags:
          - cduikit_tests_ci
      cdfoundation:
        flags:
          - cdfoundation_tests_ci
comment:
  layout: "reach, diff, flags, files"
  behavior: default
  require_changes: false
  require_base: yes
  require_head: yes
  branches: null
flags:
  tests_ci:
    carryforward: true
  networking_tests_ci:
    paths:
      - Libraries/Networking
    carryforward: true
  messaging_tests_ci:
    paths:
      - Libraries/Messaging
    carryforward: true
  cduikit_tests_ci:
    paths:
      - Libraries/CDUIKit
    carryforward: true
  cdfoundation_tests_ci:
    paths:
      - Libraries/CDFoundation
    carryforward: true

Thank you!

1 Like

Hi @kaspik, glad that you aren’t getting errors anymore! Would you mind opening up an issue in #support so we can properly track it?

1 Like