Skip to content

docs: update copilot instructions with API integration details - #2

Merged
surrealwolf merged 7 commits into
mainfrom
docs/copilot-instructions-update
Oct 20, 2025
Merged

surrealwolf merged 7 commits into
mainfrom
docs/copilot-instructions-update

Conversation

@surrealwolf

Copy link
Copy Markdown
Collaborator

Description

Updates .github/copilot-instructions.md with latest API integration details, test mocking approach, and implementation patterns.

Changes

  • Documents complete Hell Divers 2 API integration (10 scraper methods, 7 database tables)
  • Details unit test mocking approach using unittest.mock.patch (no server dependency)
  • Adds comprehensive patterns for new endpoint development
  • Includes database conventions, error handling, and deployment guidance
  • Updates dependency documentation with types-requests and pytest-asyncio

Related

Completes documentation updates from merged PR #1 (feature/hell-divers-api-integration)

Checklist

  • Documentation is clear and comprehensive
  • Examples are accurate and reflect current codebase
  • All patterns documented are implemented in production code

Copilot AI review requested due to automatic review settings October 20, 2025 03:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Updates the Copilot instructions to reflect the new community API integration, expanded data coverage, and testing/mocking patterns.

  • Switches API source to community Helldivers 2 API with required headers and rate limits
  • Expands documented scraper/database scope and lifecycle/config details
  • Documents unit testing approach using unittest.mock.patch and updated dependency notes

Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings October 20, 2025 03:41
surrealwolf and others added 3 commits October 19, 2025 20:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread .github/copilot-instructions.md
Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings October 20, 2025 04:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment on lines +20 to +29
import httpx

@retry(wait=wait_exponential(multiplier=1, min=2, max=10), stop=stop_after_attempt(5), retry=retry_if_exception_type(httpx.HTTPStatusError))
async def fetch_with_rate_limit(url, headers):
async with httpx.AsyncClient() as client:
response = await client.get(url, headers=headers)
if response.status_code == 429:
raise httpx.HTTPStatusError("Rate limit exceeded", request=response.request, response=response)
response.raise_for_status()
return response.json()

Copilot AI Oct 20, 2025

Copy link

Choose a reason for hiding this comment

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

The pseudocode uses httpx.AsyncClient, but the Dependencies section specifies Requests and the testing guidance patches requests (requests.Session.request). To avoid confusion, either (a) rewrite the example to use requests (sync) or (b) add httpx (and tenacity if mandated) to the Dependencies section and adjust testing examples accordingly (e.g., patching the httpx import path used in scraper.py).

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +35
# Throttle requests in collector/scraper:
semaphore = asyncio.Semaphore(5)
async def throttled_fetch(*args, **kwargs):
async with semaphore:
return await fetch_with_rate_limit(*args, **kwargs)

Copilot AI Oct 20, 2025

Copy link

Choose a reason for hiding this comment

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

Using asyncio.Semaphore(5) limits concurrent requests, not the documented rate of 5 requests per 10 seconds. Replace with a time-window rate limiter (e.g., token bucket) such as aiolimiter: from aiolimiter import AsyncLimiter; limiter = AsyncLimiter(5, 10); async with limiter: ... to enforce the actual time-based rate, and list the chosen limiter in Dependencies if you expect contributors to use it.

Copilot uses AI. Check for mistakes.
@surrealwolf
surrealwolf merged commit 18f4888 into main Oct 20, 2025
8 checks passed
@surrealwolf
surrealwolf deleted the docs/copilot-instructions-update branch October 20, 2025 04:59
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.

2 participants