Add request timeout, push retry and XML-sanitizing fallback for feed parsing#4
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd8ed4b8a8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| throw new Error(`Status code ${response.status}`); | ||
| } | ||
| const xmlText = await response.text(); | ||
| return response.text(); |
There was a problem hiding this comment.
Keep timeout active while reading response body
fetchFeedXml returns response.text() without awaiting it, so the finally block clears the abort timer as soon as headers arrive. For feeds that send headers quickly but stall while streaming the body, request_timeout no longer applies and the workflow can block far longer than configured. Await the body read (or otherwise delay clearTimeout) so the timeout covers the full download.
Useful? React with 👍 / 👎.
| const pushRetryCount = | ||
| Number.parseInt(core.getInput('push_retry_count'), 10) || 3; |
There was a problem hiding this comment.
Honor explicit zero for push retry count
Using Number.parseInt(..., 10) || 3 makes an explicit push_retry_count: 0 impossible, because 0 is treated as falsy and replaced with 3. In that case the action still performs pull/rebase retry cycles and up to four push attempts, which contradicts the input semantics and prevents disabling retries.
Useful? React with 👍 / 👎.
Motivation
git pushraces from concurrent workflow runs by retrying pushes and rebasing on the latest remote.Description
request_timeoutandpush_retry_counttoaction.ymland documented a new "Performance tuning" section inREADME.md.REQUEST_TIMEOUT, and added logging of estimated worst-case wait times insrc/blog-post-workflow.js.parser.parseURLcalls withfetchFeedXml+parser.parseString, addedsanitizeXmlfallback and anisXmlParseError/shouldRetryFeedRequestpolicy so only network/HTTP errors trigger retries.src/utils.js/dist/blog-post-workflow.jsthat will attemptgit pushup topush_retry_counttimes and rungit pull --rebaseon failures to recover from concurrent upstream updates.Testing
npm run buildand confirmeddist/blog-post-workflow.jswas updated successfully.Codex Task