You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Azure Pipelines adapter can send pullid: "", rejected by self-hosted Codecov #820
os.getenv("SYSTEM_PULLREQUEST_PULLREQUESTNUMBER") or os.getenv("SYSTEM_PULLREQUEST_PULLREQUESTID")
When both variables are set but empty (as on our Windows agents for non-PR builds), "" or "" evaluates to "", not None. CodecovOption.get_default
(codecov_cli/fallbacks.py) only skips a fallback when it is None, so "" is used. upload_sender.py then sends "pullid": "".
Self-hosted UploadCoverageView passes request.data["pullid"] to CommitSerializer
(Commit.pullid = IntegerField(null=True)). DRF accepts null but rejects "".
Other adapters that return os.getenv(...) directly (Jenkins CHANGE_ID, GitLab CI_MERGE_REQUEST_IID, CircleCI, Drone, Bitbucket, ...) have the same exposure.
Why codecov.io doesn't fail
Probing POST /upload/github/<slug>/upload-coverage with pullid set to "", "None" and "abc":
Endpoint
result
ingest.codecov.io
202 for all three, raw_upload_location under shelter/
self-hosted API
400 {"pullid":["A valid integer is required."]} for all three
So the hosted front end accepts any pullid; the open-source API validates it.
The client bug is hidden on codecov.io.
Normalise empty values to None in the adapters, e.g. for Azure:
return (
os.getenv("SYSTEM_PULLREQUEST_PULLREQUESTNUMBER")
or os.getenv("SYSTEM_PULLREQUEST_PULLREQUESTID")
or None
)
or, more generally, make CIAdapterBase.get_fallback_value return None for "".
Workaround
Unset both variables for the CLI process (env -u SYSTEM_PULLREQUEST_PULLREQUESTNUMBER -u SYSTEM_PULLREQUEST_PULLREQUESTID codecovcli ...), and don't pass --pull-request-number unless the value is numeric.
changed the title [-]Azure Pipelines adapter can send , rejected by self-hosted Codecov[/-][+]Azure Pipelines adapter can send `pullid: ""`, rejected by self-hosted Codecov[/+]on Nov 26, 2026
Activity
[-]Azure Pipelines adapter can send , rejected by self-hosted Codecov[/-][+]Azure Pipelines adapter can send `pullid: ""`, rejected by self-hosted Codecov[/+]