Skip to content

fix: skip unavailable issue comments endpoint#582

Draft
johncomar wants to merge 1 commit into
MeltanoLabs:mainfrom
johncomar:fix-skip-disabled-issue-comments
Draft

fix: skip unavailable issue comments endpoint#582
johncomar wants to merge 1 commit into
MeltanoLabs:mainfrom
johncomar:fix-skip-disabled-issue-comments

Conversation

@johncomar

@johncomar johncomar commented Jun 15, 2026

Copy link
Copy Markdown

Summary

This PR lets the tap handle repositories where GitHub disables the repository-level issue comments endpoint.

GitHub can return "has_issues": false and "has_pull_requests": false in a repository payload. For those repositories, GET /repos/{owner}/{repo}/issues/comments can return 404 Not Found even though the repository itself is readable and other endpoints can still be extracted.

Instead of failing the sync for that case, the tap now skips issue comment extraction for repositories where GitHub explicitly reports that both Issues and Pull Requests are disabled.

This follows the same conservative pattern added for repositories with pull requests disabled in #571.

Behavior

  • When has_issues and has_pull_requests are both exactly false, the tap skips the /issues/comments request for that repository.
  • When either flag is true, missing, null, 0, or otherwise unknown, behavior is unchanged: the tap still requests /issues/comments and surfaces GitHub errors normally.
  • The change applies only to issue comment extraction.

Implementation

  • Includes GitHub's has_issues field in repository records.
  • Carries that flag to repository child stream context alongside has_pull_requests.
  • Checks both flags before requesting /repos/{owner}/{repo}/issues/comments.

Related stream audit

This PR does not broadly gate every issue-adjacent stream.

The issue comments endpoint can include pull request conversation comments because GitHub models pull requests as issues. For that reason, the tap skips only when GitHub explicitly reports that both Issues and Pull Requests are disabled.

The following streams were intentionally left unchanged and continue to delegate normally when has_issues is false:

  • issues
  • issue_events
  • milestones
  • labels

The focused change is limited to issue_comments, where the repository-level issue comments endpoint can fail when both Issues and Pull Requests are disabled.

What this does not change

  • It does not add broad 404 or 403 tolerance.
  • It does not suppress generic GitHub errors.
  • It does not change pull request extraction.
  • It does not change discussion extraction.

Validation

LOGLEVEL=WARNING uv run pytest tests/test_tap.py -k 'has_issues or issue_comments or issue_capability'
# 16 passed, 18 deselected

uv run --with ruff==0.15.15 ruff check tap_github/repository_streams.py tests/test_tap.py
# All checks passed

uv run mypy tap_github
# Success: no issues found in 12 source files

uv run ty check tap_github
# All checks passed

git diff --check
# passed

@johncomar johncomar changed the title fix: skip issue comments when issues are disabled fix: skip unavailable issue comments endpoint Jun 15, 2026
@johncomar johncomar force-pushed the fix-skip-disabled-issue-comments branch from 29f54e5 to af029c8 Compare June 15, 2026 14:13
if (
context
and context.get("has_issues", True) is False
and context.get("has_pull_requests", True) is False

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.

Good catch to recognize this stream is valid if either is True!

@stray-nick stray-nick 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.

Looks like this follows #571 exactly, but for issues.

Only comment I have is given this is a second occurrence of the same issue, should we extend it to other "potentially-disableable" github artifacts now? cc @TrishGillett

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.

3 participants