Skip to content

Conversation

@wking
Copy link
Member

@wking wking commented Aug 29, 2025

Originally, the change-log generation focused on merge commits, which are common in many repositories. For example, in this oc repository:

$ git log --graph --oneline -10
*   559c67e11 (HEAD -> main, origin/main) Merge pull request #2083 from wking/oc-adm-upgrade-recommend-certificate-authority
|\
| * b98b2e157 pkg/cli/admin/inspectalerts: Pass through --certificate-authority, etc.
* |   e7900febd Merge pull request #2082 from ardaguclu/code-rabbit-test
|\ \
| |/
|/|
| * ffe752e7c Remove mentioning about IRC channel from README
* | f114b178f OTA-1581: Promote `oc adm upgrade status` to general availability (#2063)
* |   1c54ec072 Merge pull request #2077 from hongkailiu/OTA-1601
|\ \
| * | 5f1dbb8b1 Move not-lines-related table.Write out of the loop
| * | a35266244 Truncate long reasons
| * | 11f9f47e1 Reproduce the long reason issue
| * | 970f883d2 status: improve line break handling for CO Message

4299014 (#1116), and mentioned the insights operator:

$ git clone --depth 10 --branch master https://github.com/openshift/insights-operator
$ cd insights-operator
$ git log --graph --oneline -5
* da45333 (HEAD -> master, origin/master, origin/HEAD) OCPBUGS-60611: virt launcher logs gatherer (#1110)
* 737b59b fix: incorrect anonymization of domains (#1111)
* b5185da feat: add permissions to gather clusterrole (#1106)
* 3099eb0 feat: Allow on-demand gathering during initial periodic run (#1109)
* 7f8b40d RFE-4152: Add missing readonlyRootFilesystem (#1104)

But some repositories also use a mixture of real merges and squash or rebase merges:

$ git clone --depth 20 --branch main https://github.com/openshift/operator-framework-operator-controller
$ cd operator-framework-operator-controller
$ git log --graph --oneline -11
* 9319f22a (HEAD -> main, origin/main, origin/HEAD) UPSTREAM: <carry>: Ensure unique name for bad-catalog tests
* 9b50498a UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
* 2ed1a5c8 UPSTREAM: <carry>: Migrate single/own namespace tests
* 0c4f4303 UPSTREAM: <carry>: [OTE] add catalog tests from openshift/origin
* 28299f38 UPSTREAM: <carry>: remove obsolete owners
* 5aa7897f UPSTREAM: <carry>: [OTE] - Readme:Add info to help use payload-aggregate with new tests
* 0bb19537 UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
* e9e3220f UPSTREAM: <carry>: [OTE] Add webhook to validate openshift-service-ca certificate rotation
*   a7d35272 Merge pull request #453 from openshift-bot/synchronize-upstream
|\
| * d93f9d16 UPSTREAM: <drop>: configure the commit-checker
| * 9a69e8ed UPSTREAM: <drop>: remove upstream GitHub configuration

Before this commit, the logic would find the merge commits, assume that all content came in via merge commits, and not mention the other changes:

$ git log --first-parent --merges --oneline
a7d3527 Merge pull request #453 from openshift-bot/synchronize-upstream
4cae159 Merge pull request #449 from openshift-bot/synchronize-upstream
82f63dc Merge pull request #444 from openshift-bot/synchronize-upstream
6f91d84 Merge pull request #435 from openshift-bot/synchronize-upstream

With this commit, we'll continue to include a line for each of those merges. But we'll also include the count of any elided, non-merge, first-parent commits:

$ git log --first-parent --no-merges --oneline | wc -l
16

Folks interested in what exactly was elided will have to click through to Full changelog or otherwise go digging. But at least they'll get the count of elided commits to know that there is more information there to see behind that click.

Summary by CodeRabbit

  • New Features

    • Changelogs and bug reports now report the number of commits elided by squash/rebase merges.
    • JSON changelog output adds an elidedCommits field for consumers.
    • Human-readable and Markdown outputs include a line for elided commits when present.
    • Summaries prefer first‑parent merge history when mixed merge strategies exist to reduce noise.
  • Tests

    • Tests updated to validate the reported elided commits value.

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Aug 29, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 29, 2025

Walkthrough

Adds tracking of elided commits (from squash/rebase) to merge-log computation and propagates the count through changelog generation. mergeLogForRepo and commitsForRepo return an extra int for elided commits; tests and output rendering are updated to surface the value.

Changes

Cohort / File(s) Summary
Git merge log logic
pkg/cli/admin/release/git.go
Updated mergeLogForRepo signature to return ([]MergeCommit, int, error); introduced elidedCommits counter and squash branch to detect mixed merge histories and compute elided commits via first-parent no-merges logs; adjusted early-exit, empty-output, parsing, and error return paths to propagate elidedCommits.
Release info & rendering
pkg/cli/admin/release/info.go
commitsForRepo now returns an extra elidedCommits int; call sites unpack/use it; ChangeLogImageInfo gains ElidedCommits int (json:"elidedCommits,omitempty"); human/markdown/JSON outputs include the elided commits count when >0.
Tests
pkg/cli/admin/release/git_test.go
Tests updated to capture the new second return value from mergeLogForRepo; test table adds wantElidedCommits and asserts returned elidedCommits matches expectations.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant CLI as CLI: admin release
  participant Info as commitsForRepo
  participant Git as mergeLogForRepo
  participant Out as Output Renderer

  User->>CLI: generate changelog/bugs
  CLI->>Info: commitsForRepo(dir, change)
  Info->>Git: mergeLogForRepo(repo, from, to)
  Git-->>Info: merges[], elidedCommits, err
  alt err
    Info-->>CLI: error
    CLI-->>User: report error
  else success
    Info-->>CLI: url, merges[], elidedCommits
    CLI->>Out: render merges[] (+ elidedCommits if >0)
    Out-->>User: changelog/bugs (includes elided commits count)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I thump my paw at tidy logs,
Counting hops and hidden clogs.
Squash and rebase left tiny trails,
I number crumbs in carrot veils.
Now changelogs sing with honest beats. 🥕


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 74dda80 and 977ac88.

📒 Files selected for processing (3)
  • pkg/cli/admin/release/git.go (5 hunks)
  • pkg/cli/admin/release/git_test.go (2 hunks)
  • pkg/cli/admin/release/info.go (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • pkg/cli/admin/release/git.go
  • pkg/cli/admin/release/git_test.go
  • pkg/cli/admin/release/info.go
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 29, 2025

@wking: This pull request references Jira Issue OCPBUGS-60989, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @zhouying7780

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Originally, the change-log generation focused on merge commits, which are common in many repositories. For example, in this oc repository:

$ git log --graph --oneline -10
*   559c67e11 (HEAD -> main, origin/main) Merge pull request #2083 from wking/oc-adm-upgrade-recommend-certificate-authority
|\
| * b98b2e157 pkg/cli/admin/inspectalerts: Pass through --certificate-authority, etc.
* |   e7900febd Merge pull request #2082 from ardaguclu/code-rabbit-test
|\ \
| |/
|/|
| * ffe752e7c Remove mentioning about IRC channel from README
* | f114b178f [OTA-1581](https://issues.redhat.com//browse/OTA-1581): Promote `oc adm upgrade status` to general availability (#2063)
* |   1c54ec072 Merge pull request #2077 from hongkailiu/OTA-1601
|\ \
| * | 5f1dbb8b1 Move not-lines-related table.Write out of the loop
| * | a35266244 Truncate long reasons
| * | 11f9f47e1 Reproduce the long reason issue
| * | 970f883d2 status: improve line break handling for CO Message

4299014 (#1116), and mentioned the insights operator:

$ git clone --depth 10 --branch master https://github.com/openshift/insights-operator
$ cd insights-operator
$ git log --graph --oneline -5
* da45333 (HEAD -> master, origin/master, origin/HEAD) OCPBUGS-60611: virt launcher logs gatherer (#1110)
* 737b59b fix: incorrect anonymization of domains (#1111)
* b5185da feat: add permissions to gather clusterrole (#1106)
* 3099eb0 feat: Allow on-demand gathering during initial periodic run (#1109)
* 7f8b40d [RFE-4152](https://issues.redhat.com//browse/RFE-4152): Add missing readonlyRootFilesystem (#1104)

But some repositories also use a mixture of real merges and squash or rebase merges:

$ git clone --depth 20 --branch main https://github.com/openshift/operator-framework-operator-controller
$ cd operator-framework-operator-controller
$ git log --graph --oneline -11
* 9319f22a (HEAD -> main, origin/main, origin/HEAD) UPSTREAM: <carry>: Ensure unique name for bad-catalog tests
* 9b50498a UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
* 2ed1a5c8 UPSTREAM: <carry>: Migrate single/own namespace tests
* 0c4f4303 UPSTREAM: <carry>: [OTE] add catalog tests from openshift/origin
* 28299f38 UPSTREAM: <carry>: remove obsolete owners
* 5aa7897f UPSTREAM: <carry>: [OTE] - Readme:Add info to help use payload-aggregate with new tests
* 0bb19537 UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
* e9e3220f UPSTREAM: <carry>: [OTE] Add webhook to validate openshift-service-ca certificate rotation
*   a7d35272 Merge pull request #453 from openshift-bot/synchronize-upstream
|\
| * d93f9d16 UPSTREAM: <drop>: configure the commit-checker
| * 9a69e8ed UPSTREAM: <drop>: remove upstream GitHub configuration

Before this commit, the logic would find the merge commits, assume that all content came in via merge commits, and not mention the other changes:

$ git log --first-parent --merges --oneline
a7d3527 Merge pull request #453 from openshift-bot/synchronize-upstream
4cae159 Merge pull request #449 from openshift-bot/synchronize-upstream
82f63dc Merge pull request #444 from openshift-bot/synchronize-upstream
6f91d84 Merge pull request #435 from openshift-bot/synchronize-upstream

With this commit, we'll continue to include a line for each of those merges. But we'll also include the count of any elided, non-merge, first-parent commits:

$ git log --first-parent --no-merges --oneline | wc -l
16

Folks interested in what exactly was elided will have to click through to Full changelog or otherwise go digging. But at least they'll get the count of elided commits to know that there is more information there to see behind that click.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 29, 2025
@wking wking force-pushed the adm-release-info-mention-elided-commits branch from 7683487 to 74dda80 Compare August 29, 2025 07:04
Copy link

@coderabbitai coderabbitai bot left a comment

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 (3)
pkg/cli/admin/release/git.go (1)

246-270: Count elided first-parent non-merge commits; avoid shadowing for clarity

The approach is sound. Minor readability nit: avoid shadowing args/out in this block.

Apply this refactor for clarity:

-       args := []string{"log", "--no-merges", "--first-parent", "-z", "--format=%H", fmt.Sprintf("%s..%s", from, to)}
-       out, err := g.exec(args...)
+       noMergeArgs := []string{"log", "--no-merges", "--first-parent", "-z", "--format=%H", fmt.Sprintf("%s..%s", from, to)}
+       noMergeOut, err := g.exec(noMergeArgs...)
        if err != nil {
                return nil, 0, gitOutputToError(err, out)
        }
-       elidedCommits = strings.Count(out, "\x00")
+       elidedCommits = strings.Count(noMergeOut, "\x00")
pkg/cli/admin/release/info.go (2)

1962-1963: Bug listing ignores elided-only commits — confirm intent

If a repo mixes merges and first-parent non-merge commits, bugs referenced only in the elided commits won’t surface in --bugs output. If that’s intentional, ignore. Otherwise, consider optionally scanning first-parent non-merge commits for bug refs when merges exist.


2486-2500: commitsForRepo: consistent triple return; minor error-message nits

Behavior is correct. Minor style nit: unify error message casing (“the source…”, “could not…”) to match surrounding errors.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7683487 and 74dda80.

📒 Files selected for processing (3)
  • pkg/cli/admin/release/git.go (5 hunks)
  • pkg/cli/admin/release/git_test.go (2 hunks)
  • pkg/cli/admin/release/info.go (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/cli/admin/release/git_test.go
🧰 Additional context used
🧬 Code graph analysis (1)
pkg/cli/admin/release/info.go (1)
pkg/cli/admin/release/git.go (1)
  • MergeCommit (189-199)
🔇 Additional comments (7)
pkg/cli/admin/release/git.go (4)

218-221: Signature update to surface elided commits: LGTM

Returning (commits, elidedCommits, err) is clear, and the early no-op (from == to) path is correct.


228-243: Consistent error propagation with elided count context

Good retries and clearer errors; return shape is consistent across paths.


283-288: Preserve elidedCommits on parse errors: LGTM

Good that errors keep context via elidedCommits.


330-331: Final return includes elided count: LGTM

Clear and matches callers.

pkg/cli/admin/release/info.go (3)

1797-1808: JSON changelog now carries elided commit count: LGTM

Correctly includes ElidedCommits and guards on (len(commits) > 0 || elided > 0).


1906-1943: Human/markdown output mentions elided commits: LGTM

Clear wording and placement; good UX.


2739-2741: ChangeLogImageInfo.ElidedCommits field: LGTM

Appropriate JSON tag (omitempty) and type.

Comment on lines 280 to 286
for _, entry := range strings.Split(out, "\x00") {
records := strings.Split(entry, "\x1e")
if len(records) != 4 {
return nil, fmt.Errorf("unexpected git log output width %d columns", len(records))
return nil, elidedCommits, fmt.Errorf("unexpected git log output width %d columns", len(records))
}
unixTS, err := strconv.ParseInt(records[1], 10, 64)
if err != nil {
Copy link

@coderabbitai coderabbitai bot Aug 29, 2025

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Harden parsing against trailing NUL entries

git log -z commonly NUL-terminates entries; a trailing NUL would yield an empty entry causing the width check to fail. Skip empty entries to be robust across Git versions.

- for _, entry := range strings.Split(out, "\x00") {
+ for _, entry := range strings.Split(out, "\x00") {
+   if len(entry) == 0 {
+     continue
+   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for _, entry := range strings.Split(out, "\x00") {
records := strings.Split(entry, "\x1e")
if len(records) != 4 {
return nil, fmt.Errorf("unexpected git log output width %d columns", len(records))
return nil, elidedCommits, fmt.Errorf("unexpected git log output width %d columns", len(records))
}
unixTS, err := strconv.ParseInt(records[1], 10, 64)
if err != nil {
@@ -280,6 +280,9 @@
for _, entry := range strings.Split(out, "\x00") {
// Skip any trailing or consecutive NUL-separated empty entries
if len(entry) == 0 {
continue
}
records := strings.Split(entry, "\x1e")
if len(records) != 4 {
return nil, elidedCommits, fmt.Errorf("unexpected git log output width %d columns", len(records))
🤖 Prompt for AI Agents
In pkg/cli/admin/release/git.go around lines 280 to 286, the git log parsing
loop fails when git -z produces a trailing NUL because an empty entry yields the
wrong column count; modify the loop to skip empty entries (e.g., if entry == ""
continue) before splitting into records so the width check only runs on
non-empty entries, leaving the rest of the parsing logic unchanged.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not touching this null-splitting logic in this branch, I'm just adding elidedCommits to the return here to catch it up with the evolving function signature.

Copy link

Choose a reason for hiding this comment

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

@wking Understood! You're absolutely right to keep the scope focused on the elided commits functionality. The parsing robustness improvement can be addressed separately if needed. Thanks for clarifying the scope boundaries of this PR.

@ardaguclu
Copy link
Member

That would be nice to add an example how the page will look like when elidedCommits are found.

@ardaguclu
Copy link
Member

This approach is far better than mine and looks good to me.
/lgtm
/hold
in case you want more reviews

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 29, 2025
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2025
// but do at least mention the fact that there are non-merge commits in the
// first-parent line, so folks who are curious can click through to GitHub for
// details.
args := []string{"log", "--no-merges", "--first-parent", "-z", "--format=%H", fmt.Sprintf("%s..%s", from, to)}
Copy link
Member

Choose a reason for hiding this comment

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

I assume that this filter out the commits that we will print and only select the ones that are discarded?

…mmits

Originally, the change-log generation focused on merge commits, which
are common in many repositories.  For example, in this 'oc' repository:

  $ git log --graph --oneline -10
  *   559c67e (HEAD -> main, origin/main) Merge pull request openshift#2083 from wking/oc-adm-upgrade-recommend-certificate-authority
  |\
  | * b98b2e1 pkg/cli/admin/inspectalerts: Pass through --certificate-authority, etc.
  * |   e7900fe Merge pull request openshift#2082 from ardaguclu/code-rabbit-test
  |\ \
  | |/
  |/|
  | * ffe752e Remove mentioning about IRC channel from README
  * | f114b17 OTA-1581: Promote `oc adm upgrade status` to general availability (openshift#2063)
  * |   1c54ec0 Merge pull request openshift#2077 from hongkailiu/OTA-1601
  |\ \
  | * | 5f1dbb8 Move not-lines-related table.Write out of the loop
  | * | a352662 Truncate long reasons
  | * | 11f9f47 Reproduce the long reason issue
  | * | 970f883 status: improve line break handling for CO Message

4299014 (Add squash-merge support into oc adm release info,
2022-04-26, openshift#1116), and mentioned the insights operator:

  $ git clone --depth 10 --branch master https://github.com/openshift/insights-operator
  $ cd insights-operator
  $ git log --graph --oneline -5
  * da45333 (HEAD -> master, origin/master, origin/HEAD) OCPBUGS-60611: virt launcher logs gatherer (openshift#1110)
  * 737b59b fix: incorrect anonymization of domains (openshift#1111)
  * b5185da feat: add permissions to gather clusterrole (openshift#1106)
  * 3099eb0 feat: Allow on-demand gathering during initial periodic run (openshift#1109)
  * 7f8b40d RFE-4152: Add missing readonlyRootFilesystem (openshift#1104)

But some repositories also use a mixture of real merges and squash or
rebase merges:

  $ git clone --depth 20 --branch main https://github.com/openshift/operator-framework-operator-controller
  $ cd operator-framework-operator-controller
  $ git log --graph --oneline -11
  * 9319f22a (HEAD -> main, origin/main, origin/HEAD) UPSTREAM: <carry>: Ensure unique name for bad-catalog tests
  * 9b50498a UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
  * 2ed1a5c8 UPSTREAM: <carry>: Migrate single/own namespace tests
  * 0c4f4303 UPSTREAM: <carry>: [OTE] add catalog tests from openshift/origin
  * 28299f38 UPSTREAM: <carry>: remove obsolete owners
  * 5aa7897f UPSTREAM: <carry>: [OTE] - Readme:Add info to help use payload-aggregate with new tests
  * 0bb19537 UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
  * e9e3220f UPSTREAM: <carry>: [OTE] Add webhook to validate openshift-service-ca certificate rotation
  *   a7d35272 Merge pull request openshift#453 from openshift-bot/synchronize-upstream
  |\
  | * d93f9d16 UPSTREAM: <drop>: configure the commit-checker
  | * 9a69e8ed UPSTREAM: <drop>: remove upstream GitHub configuration

Before this commit, the logic would find the merge commits, assume
that all content came in via merge commits, and not mention the other
changes:

  $ git log --first-parent --merges --oneline
  a7d3527 Merge pull request openshift#453 from openshift-bot/synchronize-upstream
  4cae159 Merge pull request openshift#449 from openshift-bot/synchronize-upstream
  82f63dc Merge pull request openshift#444 from openshift-bot/synchronize-upstream
  6f91d84 Merge pull request openshift#435 from openshift-bot/synchronize-upstream

With this commit, we'll continue to include a line for each of those
merges.  But we'll also include the count of any elided, non-merge,
first-parent commits:

  $ git log --first-parent --no-merges --oneline | wc -l
  16

Folks interested in what exactly was elided will have to click through
to 'Full changelog' or otherwise go digging.  But at least they'll get
the count of elided commits to know that there is more information
there to see behind that click.
@wking wking force-pushed the adm-release-info-mention-elided-commits branch from 74dda80 to 977ac88 Compare August 29, 2025 07:35
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2025
@wking
Copy link
Member Author

wking commented Aug 29, 2025

I just pushed 74dda80 -> 977ac88 to add a \n to my new line, and with that, the output looks like:

$ ./oc adm release info --changelog=/tmp/git registry.ci.openshift.org/ocp/release:4.20.0-0.nightly-2025-08-18-192426 registry.ci.openshift.org/ocp/release:4.20.0-0.nightly-2025-08-27-065636
...
### [olm-operator-controller](https://github.com/openshift/operator-framework-operator-controller/tree/9b50498a8a7d0a8d4a1f0cfc363151ba1dec506b)

* NO-ISSUE: Synchronize From Upstream Repositories [#453](https://github.com/openshift/operator-framework-operator-controller/pull/453)
* NO-ISSUE: Synchronize From Upstream Repositories [#449](https://github.com/openshift/operator-framework-operator-controller/pull/449)
* NO-ISSUE: Synchronize From Upstream Repositories [#444](https://github.com/openshift/operator-framework-operator-controller/pull/444)
* And 13 elided commits (e.g. from squash or rebase merges)
* [Full changelog](https://github.com/openshift/operator-framework-operator-controller/compare/1a9f810a3338d1d31b4a9a3d63a1390c67a2a8f7...9b50498a8a7d0a8d4a1f0cfc363151ba1dec506b)
...

Which looks good to me.

/hold cancel

I'll still need to collect acknowledge-critical-fixes-only from someone before this merges.

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 29, 2025
@ardaguclu
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 29, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu, wking

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wking
Copy link
Member Author

wking commented Aug 29, 2025

For fun, here's poking at the JSON output for those two nightlies:

$ ./oc adm release info --changelog=/tmp/git -o json registry.ci.openshift.org/ocp/release:4.20.0-0.nightly-2025-08-18-192426 registry.ci.openshift.org/ocp/release:4.20.0-0.nightly-2025-08-27-065636 | jq -c '.updatedImages[] | select(.elidedCommits) | {elidedCommits, commits: (.commits | length), name, fullChangeLog}'
{"elidedCommits":1,"commits":1,"name":"cli, cli-artifacts, deployer, tools","fullChangeLog":"https://github.com/openshift/oc/compare/1c54ec07271de9a954826ae08d9b1b1c423fe0f2...e7900febdfbef1ab88713a85e4f0b16d0f886566"}
{"elidedCommits":3,"commits":15,"name":"console","fullChangeLog":"https://github.com/openshift/console/compare/9f4a18aaed3f9c71365d2fff91e2dc515bafbc5f...2151cf2dcc41fa8ca3af2c038ea1102ac6046832"}
{"elidedCommits":13,"commits":2,"name":"olm-catalogd","fullChangeLog":"https://github.com/openshift/operator-framework-operator-controller/compare/82f63dc73b08b02294a04cd2105bad8fc776c2b6...9b50498a8a7d0a8d4a1f0cfc363151ba1dec506b"}
{"elidedCommits":13,"commits":3,"name":"olm-operator-controller","fullChangeLog":"https://github.com/openshift/operator-framework-operator-controller/compare/1a9f810a3338d1d31b4a9a3d63a1390c67a2a8f7...9b50498a8a7d0a8d4a1f0cfc363151ba1dec506b"}

An elided commit in oc?

$ git log --first-parent --no-merges --oneline 1c54ec07271de9a954826ae08d9b1b1c423fe0f2..e7900febdfbef1ab88713a85e4f0b16d0f886566
f114b178f OTA-1581: Promote `oc adm upgrade status` to general availability (#2063)

Ah, a squash merge.

@ardaguclu
Copy link
Member

ardaguclu commented Aug 29, 2025

For fun, here's poking at the JSON output for those two nightlies:

$ ./oc adm release info --changelog=/tmp/git/git -o json registry.ci.openshift.org/ocp/release:4.20.0-0.nightly-2025-08-18-192426 registry.ci.openshift.org/ocp/release:4.20.0-0.nightly-2025-08-27-065636 | jq -c '.updatedImages[] | select(.elidedCommits) | {elidedCommits, commits: (.commits | length), name, fullChangeLog}'
{"elidedCommits":1,"commits":1,"name":"cli, cli-artifacts, deployer, tools","fullChangeLog":"https://github.com/openshift/oc/compare/1c54ec07271de9a954826ae08d9b1b1c423fe0f2...e7900febdfbef1ab88713a85e4f0b16d0f886566"}
{"elidedCommits":3,"commits":15,"name":"console","fullChangeLog":"https://github.com/openshift/console/compare/9f4a18aaed3f9c71365d2fff91e2dc515bafbc5f...2151cf2dcc41fa8ca3af2c038ea1102ac6046832"}
{"elidedCommits":13,"commits":2,"name":"olm-catalogd","fullChangeLog":"https://github.com/openshift/operator-framework-operator-controller/compare/82f63dc73b08b02294a04cd2105bad8fc776c2b6...9b50498a8a7d0a8d4a1f0cfc363151ba1dec506b"}
{"elidedCommits":13,"commits":3,"name":"olm-operator-controller","fullChangeLog":"https://github.com/openshift/operator-framework-operator-controller/compare/1a9f810a3338d1d31b4a9a3d63a1390c67a2a8f7...9b50498a8a7d0a8d4a1f0cfc363151ba1dec506b"}

An elided commit in oc?

$ git log --first-parent --no-merges --oneline 1c54ec07271de9a954826ae08d9b1b1c423fe0f2..e7900febdfbef1ab88713a85e4f0b16d0f886566
f114b178f [OTA-1581](https://issues.redhat.com//browse/OTA-1581): Promote `oc adm upgrade status` to general availability (#2063)

Ah, a squash merge.

So even in oc, we may not show some commits. Interesting.

@ardaguclu
Copy link
Member

ardaguclu commented Aug 29, 2025

For fun, here's poking at the JSON output for those two nightlies:

$ ./oc adm release info --changelog=/tmp/git -o json registry.ci.openshift.org/ocp/release:4.20.0-0.nightly-2025-08-18-192426 registry.ci.openshift.org/ocp/release:4.20.0-0.nightly-2025-08-27-065636 | jq -c '.updatedImages[] | select(.elidedCommits) | {elidedCommits, commits: (.commits | length), name, fullChangeLog}'
{"elidedCommits":1,"commits":1,"name":"cli, cli-artifacts, deployer, tools","fullChangeLog":"https://github.com/openshift/oc/compare/1c54ec07271de9a954826ae08d9b1b1c423fe0f2...e7900febdfbef1ab88713a85e4f0b16d0f886566"}
{"elidedCommits":3,"commits":15,"name":"console","fullChangeLog":"https://github.com/openshift/console/compare/9f4a18aaed3f9c71365d2fff91e2dc515bafbc5f...2151cf2dcc41fa8ca3af2c038ea1102ac6046832"}
{"elidedCommits":13,"commits":2,"name":"olm-catalogd","fullChangeLog":"https://github.com/openshift/operator-framework-operator-controller/compare/82f63dc73b08b02294a04cd2105bad8fc776c2b6...9b50498a8a7d0a8d4a1f0cfc363151ba1dec506b"}
{"elidedCommits":13,"commits":3,"name":"olm-operator-controller","fullChangeLog":"https://github.com/openshift/operator-framework-operator-controller/compare/1a9f810a3338d1d31b4a9a3d63a1390c67a2a8f7...9b50498a8a7d0a8d4a1f0cfc363151ba1dec506b"}

An elided commit in oc?

$ git log --first-parent --no-merges --oneline 1c54ec07271de9a954826ae08d9b1b1c423fe0f2..e7900febdfbef1ab88713a85e4f0b16d0f886566
f114b178f [OTA-1581](https://issues.redhat.com//browse/OTA-1581): Promote `oc adm upgrade status` to general availability (#2063)

Ah, a squash merge.

I'm wondering why didn't this commit 4299014 catch this commit in oc?

@ardaguclu
Copy link
Member

Since out is not empty

if out == "" {
, that's why, we don't check the squashed commits.

This PR fixes an issue bigger than I anticipated.

@ardaguclu
Copy link
Member

I think, this is a safe change to merge. Also in worst case scenario, it is not likely that it affects customers
/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Aug 29, 2025
@ardaguclu
Copy link
Member

/retest-required

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 559c67e and 2 for PR HEAD 977ac88 in total

@wking
Copy link
Member Author

wking commented Aug 29, 2025

Platform Prometheus targets should not be accessible without auth context deadline exceeded are unrelated to my change.

/retest-required

@wking
Copy link
Member Author

wking commented Aug 29, 2025

This PR fixes an issue bigger than I anticipated

This pull takes us from "silently ignore squash/rebase first-parent entries when there are real merge commits" to "mention a count of elided squash/rebase first-parent entries when there are real merge commits". It would be even nicer if we didn't switch so hard on "when there are real merge commits", and instead had logic that iterated over all the first-parent commits, used the merge-commit parser when the commit was a merge, used the squash parser when the commit was not a merge, and incremented the elided count when squash parser failed (e.g. because it was a rebase merge or whatever). I haven't gone that far, but it would be an interesting follow-up project if anyone's feeling sufficiently motivated.

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 559c67e and 2 for PR HEAD 977ac88 in total

@wking
Copy link
Member Author

wking commented Aug 30, 2025

This time image registry had 18s disruption, but a retest is already running.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 30, 2025

@wking: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-certrotation 977ac88 link false /test e2e-aws-certrotation
ci/prow/security 977ac88 link false /test security

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 31597ed into openshift:main Aug 30, 2025
16 of 18 checks passed
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 30, 2025

@wking: Jira Issue OCPBUGS-60989: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-60989 has been moved to the MODIFIED state.

Details

In response to this:

Originally, the change-log generation focused on merge commits, which are common in many repositories. For example, in this oc repository:

$ git log --graph --oneline -10
*   559c67e11 (HEAD -> main, origin/main) Merge pull request #2083 from wking/oc-adm-upgrade-recommend-certificate-authority
|\
| * b98b2e157 pkg/cli/admin/inspectalerts: Pass through --certificate-authority, etc.
* |   e7900febd Merge pull request #2082 from ardaguclu/code-rabbit-test
|\ \
| |/
|/|
| * ffe752e7c Remove mentioning about IRC channel from README
* | f114b178f [OTA-1581](https://issues.redhat.com//browse/OTA-1581): Promote `oc adm upgrade status` to general availability (#2063)
* |   1c54ec072 Merge pull request #2077 from hongkailiu/OTA-1601
|\ \
| * | 5f1dbb8b1 Move not-lines-related table.Write out of the loop
| * | a35266244 Truncate long reasons
| * | 11f9f47e1 Reproduce the long reason issue
| * | 970f883d2 status: improve line break handling for CO Message

4299014 (#1116), and mentioned the insights operator:

$ git clone --depth 10 --branch master https://github.com/openshift/insights-operator
$ cd insights-operator
$ git log --graph --oneline -5
* da45333 (HEAD -> master, origin/master, origin/HEAD) OCPBUGS-60611: virt launcher logs gatherer (#1110)
* 737b59b fix: incorrect anonymization of domains (#1111)
* b5185da feat: add permissions to gather clusterrole (#1106)
* 3099eb0 feat: Allow on-demand gathering during initial periodic run (#1109)
* 7f8b40d [RFE-4152](https://issues.redhat.com//browse/RFE-4152): Add missing readonlyRootFilesystem (#1104)

But some repositories also use a mixture of real merges and squash or rebase merges:

$ git clone --depth 20 --branch main https://github.com/openshift/operator-framework-operator-controller
$ cd operator-framework-operator-controller
$ git log --graph --oneline -11
* 9319f22a (HEAD -> main, origin/main, origin/HEAD) UPSTREAM: <carry>: Ensure unique name for bad-catalog tests
* 9b50498a UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
* 2ed1a5c8 UPSTREAM: <carry>: Migrate single/own namespace tests
* 0c4f4303 UPSTREAM: <carry>: [OTE] add catalog tests from openshift/origin
* 28299f38 UPSTREAM: <carry>: remove obsolete owners
* 5aa7897f UPSTREAM: <carry>: [OTE] - Readme:Add info to help use payload-aggregate with new tests
* 0bb19537 UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
* e9e3220f UPSTREAM: <carry>: [OTE] Add webhook to validate openshift-service-ca certificate rotation
*   a7d35272 Merge pull request #453 from openshift-bot/synchronize-upstream
|\
| * d93f9d16 UPSTREAM: <drop>: configure the commit-checker
| * 9a69e8ed UPSTREAM: <drop>: remove upstream GitHub configuration

Before this commit, the logic would find the merge commits, assume that all content came in via merge commits, and not mention the other changes:

$ git log --first-parent --merges --oneline
a7d3527 Merge pull request #453 from openshift-bot/synchronize-upstream
4cae159 Merge pull request #449 from openshift-bot/synchronize-upstream
82f63dc Merge pull request #444 from openshift-bot/synchronize-upstream
6f91d84 Merge pull request #435 from openshift-bot/synchronize-upstream

With this commit, we'll continue to include a line for each of those merges. But we'll also include the count of any elided, non-merge, first-parent commits:

$ git log --first-parent --no-merges --oneline | wc -l
16

Folks interested in what exactly was elided will have to click through to Full changelog or otherwise go digging. But at least they'll get the count of elided commits to know that there is more information there to see behind that click.

Summary by CodeRabbit

  • New Features

  • Changelogs and bug reports now report the number of commits elided by squash/rebase merges.

  • JSON changelog output adds an elidedCommits field for consumers.

  • Human-readable and Markdown outputs include a line for elided commits when present.

  • Summaries prefer first‑parent merge history when mixed merge strategies exist to reduce noise.

  • Tests

  • Tests updated to validate the reported elided commits value.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@wking wking deleted the adm-release-info-mention-elided-commits branch August 30, 2025 04:03
@ardaguclu
Copy link
Member

I think, in order to changes are effective, oc needs to be updated
/cc @bradmwilliams

@openshift-ci openshift-ci bot requested a review from bradmwilliams August 30, 2025 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants