Include Bazel external coverage HTML in uploaded artifact - #1
Draft
paulquiring with Copilot wants to merge 4 commits into
Draft
paulquiring with Copilot wants to merge 4 commits into
paulquiring with Copilot wants to merge 4 commits into
Conversation
Agent-Logs-Url: https://github.com/paulquiring/baselibs/sessions/ba61dbb5-1631-4c35-b3f4-fbf22aa09337 Co-authored-by: paulquiring <235507552+paulquiring@users.noreply.github.com>
Agent-Logs-Url: https://github.com/paulquiring/baselibs/sessions/ba61dbb5-1631-4c35-b3f4-fbf22aa09337 Co-authored-by: paulquiring <235507552+paulquiring@users.noreply.github.com>
Agent-Logs-Url: https://github.com/paulquiring/baselibs/sessions/ba61dbb5-1631-4c35-b3f4-fbf22aa09337 Co-authored-by: paulquiring <235507552+paulquiring@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix missing HTML coverage pages in artifact generation
Include Bazel external coverage HTML in uploaded artifact
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The coverage workflow generates links to Bazel external-source pages (for example
.../.bazel/execroot/_main/external/flatbuffers+/...), but those pages were missing from the uploaded artifact. As a result, external coverage links in the HTML report were broken even though external files were present in the tracefile.Root cause
actions/upload-artifact@v6defaulted to excluding hidden paths, which dropped.bazel/...content fromcpp_coverage/.genhtmlproduced external links/pages under execroot-shaped paths, but upload omitted that hidden subtree.Workflow changes
include-hidden-files: trueon the coverage artifact step.genhtml:/external/sources, require generated external HTML to exist undercpp_coverage/<execroot>/external.Why this resolves the issue
.bazelpath hierarchy that report links target.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
releases.bazel.build/usr/local/lib/node_modules/@bazel/bazelisk/bazelisk-linux_amd64 /usr/local/lib/node_modules/@bazel/bazelisk/bazelisk-linux_amd64 --version(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
The GitHub Actions coverage workflow in repository
paulquiring/baselibsgenerates an HTML coverage artifact with links that reference Bazel external dependency coverage pages such asbaselibs_cpp_coverage_report/home/runner/.bazel/execroot/_main/external/flatbuffers+/include/flatbuffers/index.html, but those expected pages are missing from the uploaded artifact.Relevant workflow file:
.github/workflows/coverage_report.ymlRelevant failing run/job reference provided by the user:
2623255669177196693828Code Coveragehttps://github.com/paulquiring/baselibs/actions/runs/26232556691/job/77196693828Current workflow behavior:
bazel coverage --config=bl-x86_64-linux -- //score/... -//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_testgenhtml "$(bazel info output_path)/_coverage/_coverage_report.dat" -o=cpp_coverage --show-details --source-directory="$(bazel info execution_root)" --legend --function-coverage --branch-coverage --ignore-errors negativecpp_coverage/as the artifactThe user explicitly requires coverage for external files to be uploaded, not filtered out.
Please create a pull request that updates the coverage workflow so that the generated HTML artifact correctly includes and/or preserves coverage pages for Bazel external files (for example under
external/flatbuffers+). Investigate and implement a robust fix. This may involve adjusting howgenhtmlis invoked, validating or normalizing Bazel execroot/external path handling, generating missing directory pages, copying or restructuring generated output so links resolve correctly in the uploaded artifact, and/or adding verification steps so the artifact contains the expected external coverage HTML pages.Requirements:
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: The generated html coverage report states
baselibs_cpp_coverage_report/home/runner/.bazel/execroot/_main/external/flatbuffers+/include/flatbuffers/index.html
should exist but it does not.
Assistant: The problem is most likely
genhtmlis generating links for files under Bazel’s external workspace tree, but those source files are not actually present under the uploaded report output, so the HTML points at a path that cannot be resolved.The key evidence is in the workflow:
--source-directory="$(bazel info execution_root)"tellsgenhtmlto resolve source paths relative to the Bazel execution root, which includes paths like:/home/runner/.bazel/execroot/_main/.../home/runner/.bazel/execroot/_main/external/flatbuffers+/include/...So when coverage data includes headers from FlatBuffers,
genhtmlemits links for them. But in the artifact you upload, onlycpp_coverage/is archived, not the Bazel execution root or external repos. That means links such as:baselibs_cpp_coverage_report/home/runner/.bazel/execroot/_main/external/flatbuffers+/include/flatbuffers/index.htmlcan be referenced by the report but the corresponding generated pages may never exist if:
genhtmlskipped those files,From the logs, coverage processing is continuing across many files and only shows generic
--- ERROR ---separators, not a hard failure specifically on FlatBuffers. That suggests the report generation itself mostly completed, but some per-file pages were omitted or linked incorrectly.Most likely root cause:
external/flatbuffers+) are present in the coverage data,genhtmloutput does not contain a matching page tree for every referenced external file,Best fixes, in order:
genhtml.This pull request was created from Copilot chat.