Skip to content

docs_update: Skip if a PR is already open - #2242

Merged
Urgau merged 2 commits into
rust-lang:masterfrom
ehuss:docs-update-skip-open-pr
Jan 1, 2026
Merged

Urgau merged 2 commits into
rust-lang:masterfrom
ehuss:docs-update-skip-open-pr

Conversation

@ehuss

@ehuss ehuss commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

This fixes an issue where triagebot would get stuck in a loop trying to update a PR every few hours if a PR is already open for a docs update.

The solution here is to just skip the update if a pull request is already open. This uses a GraphQL search query because it is relatively cheap (costs 1 graphql point), and there wasn't anything that already did anything similar.

This fixes an issue where triagebot would get stuck in a loop trying to
update a PR every few hours if a PR is already open for a docs update.

The solution here is to just skip the update if a pull request is
already open. This uses a GraphQL search query because it is relatively
cheap (costs 1 graphql point), and there wasn't anything that already
did anything similar.
@Urgau

Urgau commented Dec 31, 2025 •

Copy link
Copy Markdown
Member

As an alternative to the GraphQL search query, we could use the Pulls REST API with state=open&head=rustbot:update-docs, as in this example.

@ehuss

ehuss commented Dec 31, 2025

Copy link
Copy Markdown
Contributor Author

I have no real preference. Looks like they both use about 1 point. I can update it if you like.

@Urgau

Urgau commented Jan 1, 2026

Copy link
Copy Markdown
Member

I have a slight preference for the Pulls API, but that's just because I find it easier to reason about than the "weird" syntax of GraphQL.

Let's stay with the GraphQL search query since it works.

@Urgau Urgau left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested the GraphQL query with curl, works as expected.

Just a small nit.

View changes since this review

Comment thread src/handlers/docs_update.rs Resolved
@Urgau
Urgau added this pull request to the merge queue Jan 1, 2026
Merged via the queue into rust-lang:master with commit a687d32 Jan 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants