Coverage uploads silently dropped on busy default branches due to "not the latest commit" rejection
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza con action.yml para confirmar los valores de commit y ref del push-event y, a continuación, investiga la validación de la API del lado del servidor que rechaza los commits que no están en la punta. El trabajo estará terminado cuando la cobertura de un commit alcanzable en el ref se acepte y almacene sin requerir que siga siendo la punta más reciente de la rama.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
On repositories with frequent merges to the default branch, coverage uploads for push events are almost always rejected with:
Warning: Coverage upload returned HTTP 200 (report not stored): Coverage report for <sha> cannot be uploaded for main because it is not the latest commit on the branch
This happens because CI takes time (install deps, build, test, upload) — often several minutes. In an active repository, another PR is typically merged to main before the workflow finishes. At that point the commit that triggered the workflow is no longer the branch tip, and the API refuses to store the report.
The result is that busy repositories can never get coverage data on their default branch, which is the primary use case for tracking coverage trends over time.
Reproduction
- Have a repository with frequent merges to
main(e.g. multiple per hour) - Configure the action on
pushtomain - Observe that coverage uploads succeed only when no other commit lands on
mainduring the CI run — which on active repos is rare
Suggested improvement
Looking at action.yml, for push events the action currently sends:
COMMIT_OID="${{ github.sha }}"
REF="${{ github.ref }}"
The server-side API then validates that COMMIT_OID is the current tip of REF and rejects otherwise. This design makes coverage upload inherently racy for any branch with concurrent activity.
Proposed solution
Coverage data is valid for the commit it was generated from, regardless of whether newer commits exist on the branch. The API should accept and store coverage for any commit reachable on the ref, not only the tip. The "latest" constraint could be relaxed to:
-
Accept coverage for any commit on the branch — Store it keyed by commit SHA. The UI/API can still display the most recent report when showing "current branch coverage," but historical reports for older commits remain queryable and useful (e.g. for trend lines, PR comparisons against the base commit at the time the PR was opened).
-
If the API must keep "latest only" semantics for display purposes, at minimum allow uploads for commits that were the tip when the workflow was triggered (i.e. trust the
pushevent's SHA as valid), even if the tip has since advanced. The workflow event itself proves the commit was on the branch.
Alternative client-side mitigations (less ideal)
- Retry with updated SHA: The action could fetch the current branch tip and re-upload, but the coverage data wouldn't match that commit's code — this is semantically wrong.
- Upload earlier in the workflow: Not practical since coverage requires tests to complete first.
Impact
This affects any team using the action on a default branch with more than a handful of merges per day. As adoption grows, this will become more prevalent. Currently there is no workaround — the upload either wins the race or the data is lost.
This is also tricky for us, because only run certain tests if the relevant code has changed. Future commits may not even trigger the test run.
Thank you for building this action. The integration is clean and the DX is excellent. This is the one rough edge we've hit in practice.
- Lenguaje dominante
- Python
- Estrellas
- 99
- Forks
- 20
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de actions/upload-code-coverage
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
actions/upload-code-coverage#26 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
actions/upload-code-coverage#18 · 1 comentario ·
-
Enable immutable releases Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
-
Please add a LICENSE file Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 45/100
actions/upload-code-coverage#20 · 2 comentarios · 3 reacciones ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
actions/upload-code-coverage#16 · 2 comentarios · 5 reacciones ·
Todos los issues de actions/upload-code-coverage
Issues similares
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Abiertoarea: harness bug status: needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Human-Agent-Society/reef#625 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
learningequality/kolibri#15351 · 2 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Name consistency Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
eellak/triplestore#65 · 1 comentario ·