Skip to content

Conversation

@choldgraf
Copy link
Member

@choldgraf choldgraf commented Dec 26, 2025

This fixes two things I noticed in #161

  • Raises an error if the github scrape returns an empty dataframe (instead of silently returning None)
  • Groups the branch filtering logic and improves the error message

Comment on lines +44 to +57
## Filter pull requests by branch

Many repositories work with multiple active branches (e.g., `main`, `develop`, feature branches). When generating a changelog for a specific release, you typically only want to include pull requests that were merged into the release branch.

Use the `--branch` (or `-b`) parameter to filter pull requests by their target branch:

```bash
github-activity org/repo --since v1.0.0 --until v2.0.0 --branch main
```

This will **only include pull requests that targeted the `main` branch**, excluding any PRs merged to other branches like `develop` or feature branches.

```{note}
You can use any git reference (tag, commit hash, etc.) in place of a branch name.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is just documenting pre-existing functionality

Comment on lines +228 to +231
# Wrap in a try/except so we don't have an ugly stack trace if there's an error
try:
if args.all:
md = generate_all_activity_md(args.target, **common_kwargs)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is all just tab-adding. The only difference is the try/except statement, so that if valueerrors happen down below we can display them nicely.

@choldgraf
Copy link
Member Author

I gave this a quick review just to sanity check - it seems OK to me and it makes our tests happy, so I'll merge this and cut a quick release since this fixes our tests!

@choldgraf choldgraf merged commit f088e4a into executablebooks:main Dec 26, 2025
5 checks passed
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.

Failing tests on main due to queries that return an empty result

1 participant