chore: ignore *.egg-info build artifacts - #38
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
DEMO_KEY is a globally shared, rate-limited key that can respond slowly under load. The previous 20s timeout caused the GitHub Actions workflow to fail with a read timeout. Use a (10s connect, 45s read) timeout and retry up to 3 times with backoff before failing. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
# Conflicts: # tools/cosmic-daily/cosmic_daily/nasa_client.py
Also removed the tools/cosmic-daily/cosmic_daily.egg-info directory that was accidentally tracked from a local pip install -e . run. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The PR includes an unscoped behavior change in nasa_client.py (retry/backoff) without corresponding tests and doesn’t match the stated PR intent.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR aims to prevent Python build artifacts (*.egg-info/) from being accidentally committed (as previously happened in PR #37). In addition, it modifies the Cosmic Daily NASA APOD client to add retry/backoff behavior and adjust request timeouts.
Changes:
- Add
*.egg-info/to the root.gitignore. - Update
fetch_apodto use a (connect, read) timeout tuple and retry onrequests.RequestExceptionwith backoff.
File summaries
| File | Description |
|---|---|
| tools/cosmic-daily/cosmic_daily/nasa_client.py | Adds retry/backoff + new timeout constants for APOD fetch requests. |
| .gitignore | Ignores *.egg-info/ directories to prevent committing Python build artifacts. |
Review details
- Files reviewed: 1/2 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+62
to
+66
| for attempt in range(1, MAX_ATTEMPTS + 1): | ||
| try: | ||
| response = requests.get( | ||
| APOD_ENDPOINT, | ||
| params={"api_key": configured_key, "date": target_day}, |
Comment on lines
+14
to
+18
| # DEMO_KEY is a shared, rate-limited key; requests can be slow under load, so | ||
| # use a generous read timeout and retry a couple of times before giving up. | ||
| REQUEST_TIMEOUT = (10, 45) | ||
| MAX_ATTEMPTS = 3 | ||
| RETRY_BACKOFF_SECONDS = 5 |
Comment on lines
+75
to
+78
| if response is None: | ||
| raise RuntimeError( | ||
| f"Failed to fetch APOD for {target_day} after {MAX_ATTEMPTS} attempts: {last_error}" | ||
| ) from last_error |
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.
Empêche les artefacts de build Python (*.egg-info/) d'être commités par erreur, comme ce fut le cas dans la PR générée automatiquement #37.