Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard against overflowing GitHub ID comments #1821

Merged

Conversation

apiraino
Copy link
Contributor

@apiraino apiraino commented Jun 12, 2024

Recently we overflowed the ID counter for comments on GitHub.

This causes some comment IDs from this URL https://rfcbot.rs/api/all to be negative numbers.

This patch is a follow-up to this commit rust-lang/rfcbot-rs@f9d84fa to avoid some tooling (notably meetings agenda generators) crashing when retrieving comments with invalid IDs. It will not retrieve a comment that has an invalid ID (e.g. -2132153390)

More info about this incident at: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/rfcbot.20asleep/near/442898636

cc: @traviscross (we discussed this)

r? @jackh726 (thanks!)

Recently we overflowed the comment ID counter for comments on GitHub.

This causes some comment IDs from this URL https://rfcbot.rs/api/all to be invalid.

This patch is a follow-up to this commit rust-lang/rfcbot-rs@f9d84fa to avoid some tooling (notably meetings agenda generators) crashing when retrieving comments with invalid IDs.

More info about this incident at: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/rfcbot.20asleep/near/442898636
@apiraino
Copy link
Contributor Author

apiraino commented Jul 2, 2024

review plssss 🙇‍♂️

who can have a loook at this?

// We blew out the GH comment incremental counter (a i32 on their end)
// See: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/rfcbot.20asleep
log::debug!("Ignoring overflowed comment id from GitHub");
("".to_string(), "".to_string())
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't fully understand why this is using empty strings. But I'll trust since I assume you do most of the agenda stuff that it works for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes it's a bit of a hack and I am not either very fond of this. initiating_comment_html_url and initiating_comment_content are mandatory fields in FCPDetails, so the minimal change I could think of was to set them to an empty string rather than making them Option<String> and deal with a widerspread change in the codebase.

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks!

@ehuss ehuss merged commit 0ddb063 into rust-lang:master Jul 2, 2024
2 checks passed
@apiraino apiraino deleted the guard-against-overflowing-comment-ids branch July 3, 2024 08:41
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