Skip to content

mach: Properly handle empty commit message in the WPT export script#41128

Merged
mrobinson merged 3 commits intoservo:mainfrom
chenura999:fix-wpt-export
Dec 8, 2025
Merged

mach: Properly handle empty commit message in the WPT export script#41128
mrobinson merged 3 commits intoservo:mainfrom
chenura999:fix-wpt-export

Conversation

@chenura999
Copy link
Copy Markdown
Contributor

@chenura999 chenura999 commented Dec 8, 2025

Properly handle empty commit messages when processing commits during WPT export. We shouldn't be landing commits with empty messages into Servo, but sometimes when a PR is in process, the body is empty. In those cases, this change avoids an error during job execution.

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 8, 2025
@mrobinson
Copy link
Copy Markdown
Member

@chenura999 Do you have a link to where this produced an error during WPT import?

@chenura999
Copy link
Copy Markdown
Contributor Author

@mrobinson
The error occurred in Job ID 57413047323.

The failure log showed a TypeError: argument of type 'NoneType' is not iterable in servo/python/wpt/export.py. This happens when the PR body is null (e.g. an empty description), which causes pull_data.get("body") to return None even if a default value is provided to .get() (because the key exists, it just has a null value).

I verified this behavior locally with a reproduction script and the fix ensures we default to an empty string in that case.

@mrobinson
Copy link
Copy Markdown
Member

@chenura999 Can you provide a link to that job? I'm not sure which run it was a part of.

@chenura999
Copy link
Copy Markdown
Contributor Author

@chenura999 Can you provide a link to that job? I'm not sure which run it was a part of.

I tried to access the run again, but the link seems to be expired or invalid now (404).

However, I can confirm the error was a TypeError: argument of type 'NoneType' is not iterable in
servo/python/wpt/export.py
. It happened because the PR body was None (empty), and the script didn't handle that case safely.

The fix I pushed ensures we default to an empty string so this doesn't happen again.

@mukilan
Copy link
Copy Markdown
Member

mukilan commented Dec 8, 2025

@chenura999
Copy link
Copy Markdown
Contributor Author

I think this is the run with that job - https://github.com/servo/servo/actions/runs/20022685522/job/57412925025

Thanks for the log! That confirms it was the NoneType error in the WPT export script caused by an empty PR body.

I've pushed a fix for that script to this branch as well, so the CI should pass now.

@Taym95
Copy link
Copy Markdown
Member

Taym95 commented Dec 8, 2025

I think this is the run with that job - https://github.com/servo/servo/actions/runs/20022685522/job/57412925025

Thanks for the log! That confirms it was the NoneType error in the WPT export script caused by an empty PR body.

I've pushed a fix for that script to this branch as well, so the CI should pass now.

This looks was written using AI.

@mrobinson mrobinson changed the title Fix NoneType error in WPT export script mach: Properly handle commits with empty commit bodies in the WPT export script Dec 8, 2025
Copy link
Copy Markdown
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

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

We shouldn't be landing PRs with empty bodies, but this fix seems fine anyhow.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Dec 8, 2025
@mrobinson mrobinson changed the title mach: Properly handle commits with empty commit bodies in the WPT export script mach: Properly handle empty commit message in the WPT export script Dec 8, 2025
@mrobinson
Copy link
Copy Markdown
Member

mrobinson commented Dec 8, 2025

I have rewritten the PR description in case it was written via LLM. @chenura999, we really appreciate the contributions, but please avoid using AI tools to generate commits or descriptions. It's nothing personal -- just the policy we currently have in place. If you aren't confident about the PR description your write yourself, feel free to ask a reviewer to look it over and make edits. Thank you!

@mrobinson mrobinson enabled auto-merge December 8, 2025 14:43
@mrobinson mrobinson added this pull request to the merge queue Dec 8, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 8, 2025
@chenura999
Copy link
Copy Markdown
Contributor Author

I have rewritten the PR description in case it was written via LLM. @chenura999, we really appreciate the contributions, but please avoid using AI tools to generate commits or descriptions. It's nothing personal -- just the policy we currently have in place. If you aren't confident about the PR description your write yourself, feel free to ask a reviewer to look it over and make edits. Thank you!

Thank you really appreciate it ❤️

Merged via the queue into servo:main with commit 444e123 Dec 8, 2025
32 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 8, 2025
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.

5 participants