Skip to content

Conversation

@ardaguclu
Copy link
Member

@ardaguclu ardaguclu commented Aug 29, 2025

oc adm release info --changelog discards the commits, if no associated pull request number is found. This is problematic because discarded commits makes it difficult to find the regression in the changelogs to investigate.

So that this PR prints commit message (with commit url) to at least show the change in the output.

Summary by CodeRabbit

  • Bug Fixes
    • Release generation now correctly handles merge commits without an associated pull request. Such commits are included in the output and no longer cause parsing errors or get skipped, resulting in more complete release notes and smoother runs when direct merges or backports occur. Commits with valid PR references continue to be processed as before.

@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/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 29, 2025
@openshift-ci-robot
Copy link

@ardaguclu: This pull request references Jira Issue OCPBUGS-60989, which is invalid:

  • expected the bug to target the "4.20.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

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

Details

In response to this:

oc adm release info --changelog discards the commits, if no associated pull request number is found. This is problematic because discarded commits makes it difficult to find the regression in the changelogs to investigate.

So that this PR prints commit message (with commit url) to at least show the change in the output.

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.

@coderabbitai
Copy link

coderabbitai bot commented Aug 29, 2025

Walkthrough

Updates mergeLogForRepo to conditionally parse pull-request numbers only when a PR match exists. Non-PR merge commits are now processed without setting PullRequest (left at zero). Invalid PR number parsing still returns an error.

Changes

Cohort / File(s) Summary
Release merge log parsing
pkg/cli/admin/release/git.go
Adjusts control flow to parse PR number only when a match exists (len(m) ≥ 2); logs and continues for commits without PRs; preserves error on invalid PR parsing.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Caller
  participant mergeLogForRepo
  participant Commit
  participant Logger

  Caller->>mergeLogForRepo: Process merge logs
  loop For each Commit
    mergeLogForRepo->>Commit: Inspect merge message
    alt PR pattern found (len(m) ≥ 2)
      mergeLogForRepo->>mergeLogForRepo: Parse PR number
      alt Parse fails
        mergeLogForRepo-->>Caller: Error (invalid PR)
      else Parse succeeds
        mergeLogForRepo->>mergeLogForRepo: Set PullRequest = parsed ID
      end
    else No PR pattern
      mergeLogForRepo->>Logger: Log "no pull-request"
      mergeLogForRepo->>mergeLogForRepo: Leave PullRequest = 0
    end
  end
  mergeLogForRepo-->>Caller: Completed list
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my whiskers at the log’s new flow,
When PRs appear, we parse; if not, we let it go.
No hops are skipped, just gentle checks in time,
Zero stays zero—order neat, sublime.
Thump-thump: a tidy trail through commits I know. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ 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 openshift-ci bot requested review from deads2k and ingvagabund August 29, 2025 06:54
@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

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

@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
@ardaguclu
Copy link
Member Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Aug 29, 2025
@openshift-ci-robot
Copy link

@ardaguclu: This pull request references Jira Issue OCPBUGS-60989, which is valid. The bug has been moved to the POST state.

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 New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @zhouying7780

Details

In response to this:

/jira refresh

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-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Aug 29, 2025
@openshift-ci openshift-ci bot requested a review from zhouying7780 August 29, 2025 06:57
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: 0

🧹 Nitpick comments (3)
pkg/cli/admin/release/git.go (3)

307-308: Log message contradicts behavior; update wording and verbosity

We’re no longer omitting these commits. Suggest clarifying and lowering noise.

Apply this diff:

-            klog.V(2).Infof("Omitted commit %s which has no pull-request", mergeCommit.Commit)
+            klog.V(4).Infof("Commit %s has no associated pull-request; leaving PullRequest=0", mergeCommit.Commit)

195-199: Document sentinel semantics for PullRequest

Make it explicit that 0 means “no PR”. Helps downstream code and future readers.

Apply this diff:

 type MergeCommit struct {
   CommitDate time.Time

   Commit        string
   ParentCommits []string

-  PullRequest int
+  // PullRequest is the associated PR number when detected; 0 means no PR.
+  PullRequest int
   Refs        RefList

259-261: Use klog verbosity API directly instead of manual gating

Avoid unconditional Info-level logging guarded by Enabled(). Use V(5).Infof.

Apply this diff:

-	if klog.V(5).Enabled() {
-		klog.Infof("Got commit info:\n%s", strconv.Quote(out))
-	}
+	klog.V(5).Infof("Got commit info:\n%s", strconv.Quote(out))
📜 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 559c67e and a8cd284.

📒 Files selected for processing (1)
  • pkg/cli/admin/release/git.go (1 hunks)
🔇 Additional comments (2)
pkg/cli/admin/release/git.go (2)

301-306: Good guard: PR parsing only when a match exists

This avoids panics and stops discarding non-PR commits. Leaving PullRequest at 0 is sensible.


301-306: No action required: commits without PRs are retained and display commit URLs for non-PR entries.

@ardaguclu
Copy link
Member Author

I'm closing this PR in favor of #2086 (which is better approach)
/close

@openshift-ci openshift-ci bot closed this Aug 29, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 29, 2025

@ardaguclu: Closed this PR.

Details

In response to this:

I'm closing this PR in favor of #2086 (which is better approach)
/close

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.

@openshift-ci-robot
Copy link

@ardaguclu: This pull request references Jira Issue OCPBUGS-60989. The bug has been updated to no longer refer to the pull request using the external bug tracker.

Details

In response to this:

oc adm release info --changelog discards the commits, if no associated pull request number is found. This is problematic because discarded commits makes it difficult to find the regression in the changelogs to investigate.

So that this PR prints commit message (with commit url) to at least show the change in the output.

Summary by CodeRabbit

  • Bug Fixes
  • Release generation now correctly handles merge commits without an associated pull request. Such commits are included in the output and no longer cause parsing errors or get skipped, resulting in more complete release notes and smoother runs when direct merges or backports occur. Commits with valid PR references continue to be processed as before.

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.

@ardaguclu ardaguclu deleted the ocpbugs-60989 branch August 29, 2025 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants