Repository navigation
Handle incomplete survey responses safely - #74
Open
mageroni with github-agentic-autofix[bot] wants to merge 4 commits into
Open
mageroni with github-agentic-autofix[bot] wants to merge 4 commits into
mageroni with github-agentic-autofix[bot] wants to merge 4 commits into
Conversation
Co-authored-by: mageroni <107436170+mageroni@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The PR-number extraction still accepts unrelated numbers in edited survey text, which can corrupt stored survey records when the explicit pull-request marker is absent.
1 open issue
What changed in this PR
Hardens survey webhook parsing for incomplete or edited issue bodies so missing responses no longer abort processing.
Changes:
- Adds defensive handling for missing PR numbers and question markers.
- Defaults missing question responses to empty values.
- Adds regression coverage for incomplete edited survey bodies.
| File | Description |
|---|---|
| test/index.test.js | Adds regression coverage verifying incomplete edited survey bodies are processed safely and persist empty responses. |
| index.js | Adds null-safe parsing for missing PR numbers and question responses during survey webhook processing. |
Review effort: Lite (auto)
Do not include the words Pull Request in the match, just the symbol `#` Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Edited survey bodies without PR numbers or expected question markers could throw during parsing and abort webhook processing.