Skip to content

feat: use graph-based compare instead of timestamp when from-tag-name is set - #317

Merged
miroslavpojer merged 11 commits into
masterfrom
feature/compare-mode-for-branching-releases
Jun 5, 2026
Merged

miroslavpojer merged 11 commits into
masterfrom
feature/compare-mode-for-branching-releases

Conversation

@miroslavpojer

@miroslavpojer miroslavpojer commented May 29, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

When generating release notes for a maintenance branch (v2.6.x) while a parallel development
branch (v2.7.x) is also active, the existing timestamp approach returns commits and PRs from both
branches. repo.get_commits(since=timestamp) has no concept of branch ancestry — it returns
everything in the time window regardless of which branch it lives on.

Example: generating notes for v2.6.5 (previous v2.6.4) picks up v2.7.0 and v2.7.1 PRs
that happened to be merged in the same window. The generated release notes are incorrect.

Cherry-picks compound the problem: the fetched PR object has merged_at equal to the original
develop merge date, so timestamp filtering can silently drop the cherry-picked fix from the
maintenance release notes entirely.

Solution

When from-tag-name is explicitly provided, use repo.compare(from_tag, to_tag) (GitHub Compare
API) instead of repo.get_commits(since=…). This is a graph-based operation — it returns only
commits reachable from to_tag but not from from_tag, independent of timestamps or branches.
PR numbers are then extracted from those commit messages and fetched individually by number.

FilterByRelease detects compare mode via a sentinel field (MinedData.compare_commit_shas) and
skips its timestamp check for PRs and commits — the set is already exact.

data.since is still derived from the previous release in compare mode; it is only used for issue
fetching and release-note extraction date-gating — not for PR/commit filtering.

Timestamp mode is unchanged when from-tag-name is absent.

Changes

File Change
release_notes_generator/model/mined_data.py Added compare_commit_shas: set[str] sentinel field
release_notes_generator/data/miner.py Compare-mode branch in mine_data(); _extract_pr_numbers_from_commits() static helper
release_notes_generator/data/filter.py Skip timestamp filter for PRs/commits when compare_commit_shas is non-empty
tests/unit/release_notes_generator/data/test_miner.py 17 new unit tests (7 for helper, 8 for compare path, 2 regression)
tests/unit/release_notes_generator/data/test_filter.py 5 new unit tests (3 compare mode, 2 timestamp regression)
tests/integration/test_compare_mode.py 4 new integration tests
docs/features/compare_mode.md New feature documentation page
docs/features/tag_range.md Linked compare mode in Related Features
README.md Added Compare Mode row in Feature Tutorials table
release_notes_generator/data/SPEC.md TDD spec with confirmed test table

Test coverage

  • 22 new unit tests (all green)
  • 4 new integration tests (all green)
  • 551 total tests passing

Release Notes

  • Compare mode — when from-tag-name is set, commits are selected via the GitHub Compare API instead of a timestamp window, giving correct results for branching release histories (maintenance + develop in parallel).
  • Timestamp mode unchanged — existing behaviour is preserved when from-tag-name is absent.

Related

Closes #316

Summary by CodeRabbit

  • New Features

    • Compare Mode: tag-based commit/PR selection for branching histories; activated by specifying a from-tag.
  • Documentation

    • Added a comprehensive Compare Mode guide with examples, diagrams, and YAML sample.
    • Updated Tag Range Selection and configuration reference to mention Compare Mode and hierarchy behavior.
  • Tests

    • Added integration and unit tests covering Compare Mode behavior, extraction, and regressions.

- Introduced a new compare mode in the release notes generator to handle branching release histories.
- The compare mode activates when `from-tag-name` is provided, allowing for accurate commit selection based on the commit graph rather than timestamps.
- Added functionality to extract PR numbers from commit messages in both squash and merge formats.
- Updated `DataMiner` to utilize the GitHub Compare API for fetching commits unique to the current release.
- Enhanced filtering logic to retain PRs and commits in compare mode, regardless of their merge dates.
- Added comprehensive unit and integration tests to validate the new compare mode functionality.
- Documented the purpose, usage, and configuration of the compare mode in the relevant documentation files.
@miroslavpojer miroslavpojer self-assigned this May 29, 2026
@miroslavpojer
miroslavpojer marked this pull request as draft May 29, 2026 13:59
@coderabbitai

coderabbitai Bot commented May 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

When from-tag-name is set, release notes generation switches from timestamp-based commit selection to graph-based selection via the GitHub Compare API, records compare commit SHAs, extracts PR numbers from compare commits, fetches those PRs, and bypasses timestamp filtering during release assembly.

Changes

Compare Mode Feature

Layer / File(s) Summary
MinedData model with compare mode sentinel
release_notes_generator/model/mined_data.py
MinedData.__init__ now initializes compare_commit_shas: set[str] to track commits selected by graph comparison.
Miner imports and regex/constants
release_notes_generator/data/miner.py
Adds re import, GithubCommit alias, _PR_NUMBER_RE for PR-number parsing in commit subjects, and _COMPARE_COMMITS_MAX_RESULTS truncation cap.
Compare mode mining and PR extraction
release_notes_generator/data/miner.py
DataMiner.mine_data() derives data.since from the resolved release and, when from-tag-name is defined, calls repo.compare(from_tag, to_tag), records comparison commit SHAs in data.compare_commit_shas, initializes data.commits from comparison, extracts PR numbers from commit subjects (_extract_pr_numbers_from_commits), fetches PRs via repo.get_pull, logs truncation warnings, and retains commits without PR references; non-compare path unchanged.
PR-number extraction helper
release_notes_generator/data/miner.py
Adds DataMiner._extract_pr_numbers_from_commits() which scans the first line of commit messages and returns a deduplicated set[int] of PR numbers.
Filter pass-through and timestamp path
release_notes_generator/data/filter.py
FilterByRelease.filter propagates data.compare_commit_shas; if non-empty it clears issues and shallow-copies PRs/commits (compare-mode pass-through), otherwise it runs _filter_issues(data) and applies existing timestamp-based PR/commit reduction.
Miner behavior unit tests
tests/unit/release_notes_generator/data/test_miner.py
Tests cover _extract_pr_numbers_from_commits patterns, compare vs get_commits behavior, PR fetching insertion, multiple PR extraction, data.issues empty in compare mode, data.since selection, skipping missing PRs, commit SHA recording, and truncation/cap warnings; includes timestamp-mode regressions.
Filter behavior unit tests
tests/unit/release_notes_generator/data/test_filter.py
Tests verify compare-mode pass-through for PRs and commits and timestamp-mode filtering that excludes old PRs and retains recent ones.
Compare mode integration tests
tests/integration/test_compare_mode.py
Integration tests confirm compare mode includes PRs/commits dated before since in output and timestamp mode excludes them; covers single PR, multiple PRs, and direct commits.
User-facing documentation and config note
docs/features/compare_mode.md, README.md, docs/features/tag_range.md, docs/configuration_reference.md
Adds Compare Mode tutorial, updates the Feature Tutorials table and Tag Range related-features link, and inserts a configuration-reference note describing hierarchy-enabled issue mining after release filtering.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • Zejnilovic
  • OlivieFranklova

Poem

🐰 I hop through commit trees with a grin,
Comparing tags to see what’s been in,
I fetch PRs by number, not by date,
No stray merges will find their way to the slate,
Release notes tidy — I stamp them with a spin.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.34% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: switching to graph-based compare API instead of timestamp-based selection when from-tag-name is provided.
Description check ✅ Passed The PR description comprehensively addresses the problem, solution, and changes. It includes all required template sections: Overview (Problem and Solution), Release Notes, and Related issue reference.
Linked Issues check ✅ Passed All coding requirements from issue #316 are met: compare-mode branching in miner.py [#316], PR number extraction helper [#316], sentinel field in MinedData [#316], filter logic update to skip timestamps [#316], and timestamp mode preservation [#316].
Out of Scope Changes check ✅ Passed All changes are scoped to implementing compare-mode functionality and its supporting infrastructure. Documentation updates (README, feature docs, config reference) and test additions directly support the feature without introducing unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/compare-mode-for-branching-releases

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

This PR adds a “compare mode” path to the release-notes mining pipeline so that when from-tag-name is provided, commits/PRs are selected via GitHub’s compare graph (ancestry-based) instead of a timestamp window—fixing incorrect results on parallel maintenance/develop branches and cherry-picks.

Changes:

  • Added compare_commit_shas to MinedData as a sentinel for compare mode.
  • Implemented compare-mode mining via repo.compare(from_tag, to_tag) and PR-number extraction from commit messages.
  • Updated filtering to bypass PR/commit timestamp reduction when compare mode is active; added unit + integration coverage and documentation.

Reviewed changes

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

Show a summary per file
File Description
release_notes_generator/data/miner.py Adds compare-mode mining and PR-number extraction helper.
release_notes_generator/data/filter.py Skips PR/commit timestamp filtering when compare mode is detected.
release_notes_generator/model/mined_data.py Adds compare_commit_shas sentinel field.
tests/unit/release_notes_generator/data/test_miner.py Unit tests for PR extraction helper and compare-mode mining path.
tests/unit/release_notes_generator/data/test_filter.py Unit tests for compare-mode filter bypass + timestamp regressions.
tests/integration/test_compare_mode.py End-to-end integration coverage contrasting compare vs timestamp behavior.
docs/features/compare_mode.md New documentation page explaining compare mode behavior and rationale.
docs/features/tag_range.md Links tag-range feature docs to compare mode.
README.md Adds Compare Mode to the feature tutorial index.
release_notes_generator/data/SPEC.md Adds/updates spec describing compare-mode behavior and tests.

Comment thread release_notes_generator/data/miner.py Resolved
Comment thread release_notes_generator/data/miner.py Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
release_notes_generator/data/miner.py (1)

37-45: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Move imports to the top; don't interleave the module constant.

from github.Commit import Commit as GithubCommit (Line 37) is placed after the first-party imports, and _PR_NUMBER_RE (Line 39) is defined in the middle of the import block, with more imports following on Lines 40-45. This trips Pylint (wrong-import-position/wrong-import-order).

Group the github import with the other from github... imports (Lines 29-33) and define the constant after the logger declaration (Line 47).

♻️ Proposed reorganization
-from github.Commit import Commit as GithubCommit
-
-_PR_NUMBER_RE = re.compile(r"\(#(\d+)\)|Merge pull request #(\d+)")
 from release_notes_generator.model.record.issue_record import IssueRecord
 from release_notes_generator.model.mined_data import MinedData
 from release_notes_generator.model.record.pull_request_record import PullRequestRecord
 from release_notes_generator.utils.decorators import safe_call_decorator
 from release_notes_generator.utils.github_rate_limiter import GithubRateLimiter
 from release_notes_generator.utils.record_utils import get_id, parse_issue_id

Add the github import alongside the existing ones (near Line 33):

 from github.Repository import Repository
+from github.Commit import Commit as GithubCommit

And define the constant after the logger (Line 47):

 logger = logging.getLogger(__name__)
+
+_PR_NUMBER_RE = re.compile(r"\(#(\d+)\)|Merge pull request #(\d+)")

As per coding guidelines: "Keep imports at top of file".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@release_notes_generator/data/miner.py` around lines 37 - 45, Move the github
import and the module-level constant so all imports remain grouped at the top:
relocate the line "from github.Commit import Commit as GithubCommit" to join the
other from github... imports (near the existing github import group) and remove
the inlined "_PR_NUMBER_RE" definition from the import block; then place the
"_PR_NUMBER_RE = re.compile(...)" constant immediately after the logger
declaration (the module-level logger variable) so imports are contiguous and the
constant is defined after logger as requested.
🧹 Nitpick comments (1)
tests/unit/release_notes_generator/data/test_miner.py (1)

528-569: ⚖️ Poor tradeoff

Private method exercised directly in tests.

These tests invoke DataMiner._extract_pr_numbers_from_commits(...) directly. Consider exercising this logic through a public entry point (e.g. via mine_data in compare mode, which the later tests already drive), or extracting the parser into a module-level helper so it can be tested without reaching into a private member.

As per coding guidelines: "Must not access private members (names starting with _) of the class under test directly in tests".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/release_notes_generator/data/test_miner.py` around lines 528 -
569, Tests directly call the private method
DataMiner._extract_pr_numbers_from_commits; instead, either exercise this
behavior via the public DataMiner.mine_data (compare mode) or extract the
PR-number parsing into a new module-level helper function (e.g.,
parse_pr_numbers_from_commits) and update tests to call that public helper;
update references in tests from DataMiner._extract_pr_numbers_from_commits to
the chosen public entry (mine_data with appropriate inputs) or the new helper to
comply with the rule against accessing private members.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/features/compare_mode.md`:
- Around line 16-28: Update the fenced code blocks in
docs/features/compare_mode.md to include a language identifier (e.g., ```text)
so they no longer trigger MD040; specifically modify each triple-backtick block
showing the git graph snippets (the blocks starting with the
develop:/maintenance/v2.6.x lines and the other example block that starts with
"from-tag-name provided?") to use ```text instead of bare ```, ensuring all
occurrences noted in the comment (lines ~16–28 and ~103–118) are updated.

In `@release_notes_generator/data/filter.py`:
- Around line 96-109: This file fails Black formatting due to manually wrapped
logger.debug calls and comprehension wrapping around the pulls and commits
filtering; run Black (e.g., black release_notes_generator/data/filter.py or the
repo root) to auto-format the logger.debug invocations and the
commits_dict/pulls_dict comprehensions so they match the project's Black rules,
or manually reflow the logger.debug argument lines and the commits_dict
comprehension used with data.commits and data.since (and the earlier pulls_dict
usage with data.pull_requests) to conform to Black's preferred line breaks.

In `@release_notes_generator/data/miner.py`:
- Around line 74-75: Run Black on the repository (or this file) to fix
formatting; specifically reformat the multi-line logger.info call that passes
ActionInputs.get_from_tag_name() and ActionInputs.get_tag_name() so it matches
Black's expected layout (e.g. a single-line call or Black's preferred wrapped
form), and do the same for the other similar logger.info call later in the file
that wraps ActionInputs methods; search for logger.info and
ActionInputs.get_from_tag_name()/get_tag_name() to locate and reformat the
offending invocations.
- Around line 460-464: The PR-number extraction currently scans the entire
commit message via _PR_NUMBER_RE.finditer(message), which picks up references
from the body; limit the search to the commit subject only by extracting the
first line (e.g. subject = commit.commit.message.splitlines()[0] or
.partition('\n')[0]) and run _PR_NUMBER_RE.finditer(subject) so
pr_numbers.add(int(number_str)) only collects PRs referenced in the subject
(affects the loop handling commit, message, _PR_NUMBER_RE, and pr_numbers).
- Around line 76-81: The call to self._safe_call(repo.compare) can return None,
so before doing list(comparison.commits) guard against comparison being None
(similar to how get_release/get_repo are handled): check if comparison is falsy,
log or warn about the failed compare (include context like
ActionInputs.get_from_tag_name()/get_tag_name()), and return or populate data
with empty compare_commits/compare_commit_shas and data.commits as appropriate
to avoid the AttributeError; update the logic around comparison,
compare_commits, data.compare_commit_shas, and data.commits to handle the None
case.
- Around line 79-81: The code currently converts comparison.commits into
compare_commits and assumes it's complete; add a guard that compares
len(compare_commits) against comparison.total_commits (e.g., if
len(compare_commits) < comparison.total_commits:) and handle the PyGithub
pagination cap case by logging or raising a warning/error and avoiding silent
truncation before setting data.compare_commit_shas and data.commits (referencing
compare_commits, comparison.total_commits, data.compare_commit_shas, and
data.commits).

In `@release_notes_generator/data/SPEC.md`:
- Around line 14-26: The fenced code blocks in SPEC.md (the commit log block
starting with ``` and the git command block using ``` around git log --oneline
--right-only --cherry-pick v2.6.4...v2.6.5) are missing language identifiers and
trigger MD040; update those fences to include appropriate languages (e.g.,
change the commit-log fence to ```text and the git command fence to ```bash) so
the Markdown linter passes.

---

Outside diff comments:
In `@release_notes_generator/data/miner.py`:
- Around line 37-45: Move the github import and the module-level constant so all
imports remain grouped at the top: relocate the line "from github.Commit import
Commit as GithubCommit" to join the other from github... imports (near the
existing github import group) and remove the inlined "_PR_NUMBER_RE" definition
from the import block; then place the "_PR_NUMBER_RE = re.compile(...)" constant
immediately after the logger declaration (the module-level logger variable) so
imports are contiguous and the constant is defined after logger as requested.

---

Nitpick comments:
In `@tests/unit/release_notes_generator/data/test_miner.py`:
- Around line 528-569: Tests directly call the private method
DataMiner._extract_pr_numbers_from_commits; instead, either exercise this
behavior via the public DataMiner.mine_data (compare mode) or extract the
PR-number parsing into a new module-level helper function (e.g.,
parse_pr_numbers_from_commits) and update tests to call that public helper;
update references in tests from DataMiner._extract_pr_numbers_from_commits to
the chosen public entry (mine_data with appropriate inputs) or the new helper to
comply with the rule against accessing private members.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9419181-1673-4e3c-a740-cbcd97701a09

📥 Commits

Reviewing files that changed from the base of the PR and between d5707d6 and 82e6b5c.

📒 Files selected for processing (10)
  • README.md
  • docs/features/compare_mode.md
  • docs/features/tag_range.md
  • release_notes_generator/data/SPEC.md
  • release_notes_generator/data/filter.py
  • release_notes_generator/data/miner.py
  • release_notes_generator/model/mined_data.py
  • tests/integration/test_compare_mode.py
  • tests/unit/release_notes_generator/data/test_filter.py
  • tests/unit/release_notes_generator/data/test_miner.py

Comment thread docs/features/compare_mode.md Resolved
Comment thread release_notes_generator/data/filter.py Resolved
Comment thread release_notes_generator/data/miner.py Resolved
Comment thread release_notes_generator/data/miner.py Resolved
Comment thread release_notes_generator/data/miner.py Resolved
Comment thread release_notes_generator/data/miner.py Resolved
Comment thread release_notes_generator/data/SPEC.md Resolved

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 10 out of 10 changed files in this pull request and generated 2 comments.

Comment thread release_notes_generator/data/SPEC.md Resolved
Comment thread release_notes_generator/data/miner.py Resolved

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 9 out of 9 changed files in this pull request and generated no new comments.

@miroslavpojer
miroslavpojer marked this pull request as ready for review June 1, 2026 11:29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/unit/release_notes_generator/data/test_miner.py (1)

723-744: ⚡ Quick win

Consider covering the comparison is None guard.

The repo.compare → None path (miner.py Lines 82-88) that logs an error and calls sys.exit(1) is not exercised by any unit test. A small test patching mock_repo.compare.return_value = None and asserting sys.exit would lock in that error-exit behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/release_notes_generator/data/test_miner.py` around lines 723 -
744, Add a unit test that exercises the repo.compare → None branch: in the test
(similar to test_mine_data_compare_mode_warns_on_retrieval_cap_without_total)
patch mock_repo.compare.return_value = None, patch sys.exit (or mock it) and
patch the error logger used in release_notes_generator.data.miner, then call
miner.mine_data() and assert that the error log was emitted and sys.exit was
invoked; reference the miner.mine_data method and the repo.compare behavior so
the test covers the comparison is None guard.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/unit/release_notes_generator/data/test_miner.py`:
- Around line 702-744: Add a one-line docstring to each new test function to
state its scenario: for
test_mine_data_compare_mode_warns_on_total_commits_overflow add a docstring like
"Warns when compare mode reports a larger total_commits than retrieved commits
(overflow case)"; for
test_mine_data_compare_mode_warns_on_retrieval_cap_without_total add a docstring
like "Warns when retrieval reaches the internal cap (10,000) but no
total_commits value is provided"; place each docstring as the first statement
inside the respective functions
(test_mine_data_compare_mode_warns_on_total_commits_overflow and
test_mine_data_compare_mode_warns_on_retrieval_cap_without_total).

---

Nitpick comments:
In `@tests/unit/release_notes_generator/data/test_miner.py`:
- Around line 723-744: Add a unit test that exercises the repo.compare → None
branch: in the test (similar to
test_mine_data_compare_mode_warns_on_retrieval_cap_without_total) patch
mock_repo.compare.return_value = None, patch sys.exit (or mock it) and patch the
error logger used in release_notes_generator.data.miner, then call
miner.mine_data() and assert that the error log was emitted and sys.exit was
invoked; reference the miner.mine_data method and the repo.compare behavior so
the test covers the comparison is None guard.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7600d2f0-a0a7-43e0-9c0f-36bd6fca4832

📥 Commits

Reviewing files that changed from the base of the PR and between 82e6b5c and cf95f48.

📒 Files selected for processing (4)
  • docs/features/compare_mode.md
  • release_notes_generator/data/filter.py
  • release_notes_generator/data/miner.py
  • tests/unit/release_notes_generator/data/test_miner.py
✅ Files skipped from review due to trivial changes (1)
  • docs/features/compare_mode.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • release_notes_generator/data/filter.py

@tmikula-dev tmikula-dev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I really like that solution of the issue, that was not easy to investigate and implement. Please react to my comments. I have the information, that the solution was tested successfully on the AquaDuct project. So reviewing only the code.

Comment on lines +121 to +135

## Configuration

```yaml
- name: Generate Release Notes
uses: AbsaOSS/generate-release-notes@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag-name: "v2.6.5" # the release being generated
from-tag-name: "v2.6.4" # providing this activates compare mode
chapters: |
- {"title": "Bugfixes 🛠", "label": "bug"}
- {"title": "Features 🎉", "label": "feature"}
```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I love that solution so far! I just find this configuration a little confusing, since it is runnable as workflow dispatch and from-tag-name input is added by a user in the GH Action tab. This will trigger it, but nobody does it that way.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I am not sure I got the core of message. There are inputs to be used. The from one is optional. Now there is better code delivering exactly the diff only.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am trying to say that configuration as you describe it here is never used by user like that. It is misleading. They are both added as inputs from user:

tag-name: ${{ github.event.inputs.tag-name }}
from-tag-name: ${{ github.event.inputs.from-tag-name }}

So that configuration part of the documentation is not adding anything new. Maybe a sentence about how it triggers would be better, since the workflow is set and then triggered by human never looking into workflow configuration.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed.

Comment thread release_notes_generator/data/miner.py Resolved
Comment thread release_notes_generator/data/miner.py Resolved
Comment thread release_notes_generator/data/miner.py Resolved
Comment thread release_notes_generator/data/miner.py Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@release_notes_generator/data/filter.py`:
- Around line 76-81: The compare-mode branch in filter.py currently zeroes out
issues_dict (issues_dict = {}), which removes issue mining/enrichment; change
this so compare mode only skips timestamp filtering for pull requests and
commits by assigning pulls_dict = dict(data.pull_requests) and commits_dict =
dict(data.commits) but do NOT clear or override issues_dict so the common path
(including calls to _get_issues(data) or later issue enrichment) still runs;
update the debug log to reflect that only PR/commit timestamp filters are
skipped (leave issue processing intact).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5f1bfc09-b338-48a2-96a1-d749a9ecf7cd

📥 Commits

Reviewing files that changed from the base of the PR and between d9a4cce and 26be550.

📒 Files selected for processing (3)
  • docs/configuration_reference.md
  • release_notes_generator/data/filter.py
  • release_notes_generator/data/miner.py
✅ Files skipped from review due to trivial changes (1)
  • docs/configuration_reference.md

Comment thread release_notes_generator/data/filter.py Resolved
@miroslavpojer
miroslavpojer requested a review from tmikula-dev June 5, 2026 06:44
@miroslavpojer
miroslavpojer merged commit b4d6e3f into master Jun 5, 2026
9 checks passed
@miroslavpojer
miroslavpojer deleted the feature/compare-mode-for-branching-releases branch June 5, 2026 10:49
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.

fix: use graph-based compare instead of timestamp when from-tag-name is set

3 participants