Skip to content

Add GitHub PR diff context to changelog#94

Merged
redreceipt merged 2 commits intomainfrom
codex/fetch-github-pr-diffs-for-changelog
Aug 1, 2025
Merged

Add GitHub PR diff context to changelog#94
redreceipt merged 2 commits intomainfrom
codex/fetch-github-pr-diffs-for-changelog

Conversation

@redreceipt
Copy link
Member

Summary

  • fetch PR diffs through new get_pr_diff helper
  • collect linked PR diffs for issues in post_weekly_changelog
  • include diff content in chunks sent to OpenAI so the summary has more detail

Testing

  • flake8 github.py jobs.py linear/*.py
  • python -m py_compile github.py jobs.py linear/*.py openai_client.py config.py

https://chatgpt.com/codex/tasks/task_e_688bc5cc0f608324b13311dcccc98198

Copilot AI review requested due to automatic review settings July 31, 2025 19:47
@redreceipt redreceipt temporarily deployed to bug-board-codex-fetch-g-cspgvh July 31, 2025 19:47 Inactive

This comment was marked as outdated.

@redreceipt redreceipt temporarily deployed to bug-board-codex-fetch-g-cspgvh August 1, 2025 01:41 Inactive
@redreceipt redreceipt requested a review from Copilot August 1, 2025 01:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the weekly changelog generation by incorporating GitHub PR diff content to provide more detailed summaries. The change allows the system to fetch PR diffs for issues with linked GitHub PRs and include this diff information as additional context when generating OpenAI summaries.

Key changes:

  • Added GitHub REST API integration to fetch PR diffs
  • Enhanced changelog issue processing to extract and include PR diff content
  • Updated OpenAI prompt instructions to utilize diff context for better summaries

Reviewed Changes

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

File Description
github.py Added get_pr_diff function and REST API configuration for fetching PR diffs
jobs.py Added _get_pr_diffs helper function and integrated diff content into changelog chunks
Comments suppressed due to low confidence (1)

github.py:27

  • The GitHub API version '2022-11-28' appears to be outdated. Consider using a more recent stable version like '2022-11-28' was the latest stable version as of my knowledge cutoff, but newer versions may be available.
    "X-GitHub-Api-Version": "2022-11-28",

try:
diff = get_pr_diff(owner, repo, int(number))
diffs.append(diff)
except Exception as e: # pragma: no cover - network errors are ignored
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

Catching a broad Exception is too generic. Consider catching more specific exceptions like requests.RequestException or requests.HTTPError to handle network-related errors more precisely.

Suggested change
except Exception as e: # pragma: no cover - network errors are ignored
except requests.RequestException as e: # pragma: no cover - network errors are ignored

Copilot uses AI. Check for mistakes.
f"Comments: {comments}",
]
if diffs:
chunk_parts.append("Diff:\n" + "\n".join(diffs))
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

Multiple string concatenations could be inefficient for large diffs. Consider using a single join operation: chunk_parts.append(f"Diff:\n{chr(10).join(diffs)}")

Suggested change
chunk_parts.append("Diff:\n" + "\n".join(diffs))
chunk_parts.append(f"Diff:\n{chr(10).join(diffs)}")

Copilot uses AI. Check for mistakes.
@redreceipt redreceipt merged commit 3e0c545 into main Aug 1, 2025
3 checks passed
@redreceipt redreceipt deleted the codex/fetch-github-pr-diffs-for-changelog branch August 1, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments