Skip to content

Conversation

@maxwelldb
Copy link
Contributor

@maxwelldb maxwelldb commented Dec 18, 2025

@jldohmann I noticed 422 errors for our line 1 Vale errors--GitHub was rejecting comment assignment to any lines that were not part of diffs on the PR.

Example: #103787, which had this in its build artifacts:

Sending review comment curl request...
DEBUG payload: {
  "body": "🤖 **[error] AsciiDocDITA.ShortDescription**: Assign [role=\"_abstract\"] to a paragraph to use it as <shortdesc> in DITA. ",
  "commit_id": "fb5c75e03836fff59d0da86e2dcc97dd97110045",
  "path": "security/zero_trust_workload_identity_manager/zero-trust-manager-overview.adoc",
  "line": 1,
  "side": "RIGHT"
}
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   324    0     0  100   324      0   1486 --:--:-- --:--:-- --:--:--  1479
100   685  100   361  100   324    997    895 --:--:-- --:--:-- --:--:--  1887
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "PullRequestReviewComment",
      "code": "custom",
      "field": "pull_request_review_thread.line",
      "message": "could not be resolved"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request",
  "status": "422"
}

This PR attempts to assign all line 1 errors to "file" comments instead. There may be an occasional false positive for anything that truly belongs on line 1, but the comment will not be lost and should still be intelligible.

Demo: #104108

@maxwelldb maxwelldb requested a review from jldohmann December 18, 2025 00:53
@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 18, 2025
@ocpdocs-previewbot
Copy link

ocpdocs-previewbot commented Dec 18, 2025

🤖 Thu Dec 18 17:45:42 - Prow CI generated the docs preview:

https://104109--ocpdocs-pr.netlify.app/

Comment on lines 38 to 39
--arg subject_type "file" \
'{body: $body, commit_id: $commit_id, path: $path, subject_type: $subject_type}')
Copy link
Contributor Author

@maxwelldb maxwelldb Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a bit much.

Suggested change
--arg subject_type "file" \
'{body: $body, commit_id: $commit_id, path: $path, subject_type: $subject_type}')
'{body: $body, commit_id: $commit_id, path: $path, subject_type: "file"}')

Copy link
Contributor

@jldohmann jldohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, i saw your tests in the NEVERMERGE PR: lgtm but i can test in the morning too if necessary

@maxwelldb
Copy link
Contributor Author

maxwelldb commented Dec 18, 2025

@jldohmann I'll wait 'til the morning anyway, as if I see something else, I'll feel compelled to go after that, too. 🙃

@maxwelldb maxwelldb force-pushed the vale-aggregate-file-errors branch from f5fb3da to ab5d1cd Compare December 18, 2025 17:37
@openshift-ci
Copy link

openshift-ci bot commented Dec 18, 2025

@maxwelldb: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@maxwelldb maxwelldb merged commit fd64322 into openshift:main Dec 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants