Repository navigation
fix: add HTTP retries, request timeout, and defensive API parsing in … - #21
Open
shellyco-code wants to merge 1 commit into
Open
shellyco-code wants to merge 1 commit into
shellyco-code wants to merge 1 commit into
Conversation
…generate.py Signed-off-by: shellyco-code <shellyco-code@users.noreply.github.com>
This branch has not been deployed
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.
Fixes #20
Summary of Changes
This PR hardens the data ingestion script in
.github/workflows/generate.pyagainst network hangs, transient API failures, and unhandled parsing crashes:requests.Sessionwithurllib3.util.Retry(total=5, backoff_factor=1, status_forcelist=[429, 500, 502, 503, 504])mounted forhttps://andhttp://.timeout=30to allsession.get()calls to prevent GitHub Actions runners from hanging indefinitely.else: breakwithresponse.raise_for_status()and added a guard (if not projects: raise RuntimeError(...)) to prevent wipingdocs/projects.csvwith empty or truncated data on transient errors.docs/projects.csv.tmpwith explicitencoding="utf-8"and swapped atomically usingos.replace(), guaranteeing that interruptions never leave a corrupt file.project.get("github")and validatesisinstance(..., dict)before accessing"org".project.get("github_repos").github_linkcleanly to avoid writing[None](https://github.com/None).if not s: return ""inescape()to avoidAttributeErroronNoneType.params={"github_only": 1, ...}).Verification & Testing
generate.pyagainstprojects.eclipse.org— retrieved all 450 projects across 6 pages and generated 452 rows indocs/projects.csv.mkdocs build— static site built in_site/in 2.17s with zero errors.Signed-off-by
Signed-off-by: shellyco-code shellyco-code@users.noreply.github.com