The emerge job failed on any saved elog, so warn elog from eclasses, such as CONFIG_CHECK without kernel sources in the CI container, failed pull requests whose package was fine. The job now fails only on QA and error elog. Portage also saves log elog now, and every target's elog is uploaded and reported in a new section of the pkgcheck report comment, so reviewers still see the warnings and post-install notes. When dependency resolution or the emerge fails, the section shows the last lines of its output, because the elog alone does not show the cause. The build.log of each package that failed is uploaded as an artifact and linked from its row. pkgcheck-comment now also handles the requested event of pkgcheck and emerge-on-pr, so each section shows that its run is in progress, and removes the elog section when a push leaves no emerge targets. Because runs of both sections and of older pushes edit the same comment at once, upsert-comment-section.sh writes only while the pull request head is still the run's commit, and reads the comment back to write again when another run overwrote its section. Signed-off-by: Zakk <zakk@gentoozh.org>
13 lines
409 B
Bash
Executable File
13 lines
409 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# usage: pr-at-commit.sh <repository> <sha>
|
|
set -euo pipefail
|
|
|
|
repository=${1:?repository}
|
|
sha=${2:?sha}
|
|
|
|
# commits/{sha}/pulls returns nothing for a fork PR, and artifacts are not trusted to name it
|
|
pulls=$(gh api "repos/$repository/pulls?state=open&per_page=100" --paginate --slurp)
|
|
jq -r --arg sha "$sha" '
|
|
first(.[][] | select(.head.sha == $sha) | .number) // empty
|
|
' <<< "$pulls"
|