Skip to content

Label stacked PRs#1158

Merged
osterman merged 1 commit intomainfrom
stacked-pr
Mar 24, 2025
Merged

Label stacked PRs#1158
osterman merged 1 commit intomainfrom
stacked-pr

Conversation

@osterman
Copy link
Member

@osterman osterman commented Mar 20, 2025

what

  • Label/unlabel a PR as stacked if it doesn't merge into main

why

  • Make it easier to identify the stacked PRs

Summary by CodeRabbit

  • New Features
    • Automated pull request labeling now helps distinguish the intended target branch. Pull requests not aiming at the primary branch are tagged as "stacked" for easier tracking, while those targeting the primary branch have this label removed.

@osterman osterman requested a review from a team as a code owner March 20, 2025 17:02
@osterman osterman added the no-release Do not create a new release (wait for additional code changes) label Mar 20, 2025
@mergify mergify bot added the triage Needs triage label Mar 20, 2025
@mergify
Copy link

mergify bot commented Mar 20, 2025

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added the needs-cloudposse Needs Cloud Posse assistance label Mar 20, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 20, 2025

📝 Walkthrough

Walkthrough

This pull request updates the Mergify configuration by adding two new rules in the .github/mergify.yml file. One rule labels open pull requests as "stacked" if they are not targeting the main branch, and the other rule removes that label when a pull request targets the main branch. The conditions focus on the pull request’s open state and base branch.

Changes

File(s) Change Summary
.github/mergify.yml Added two rules: one to add the "stacked" label for open PRs not targeting main; another to remove the label when PRs target the main branch.

Sequence Diagram(s)

sequenceDiagram
    participant PR
    participant Mergify
    participant LabelManager
    PR->>Mergify: PR created/updated
    Mergify->>Mergify: Check PR state and base branch
    alt Target branch is not "main"
      Mergify->>LabelManager: Add "stacked" label
    else Target branch is "main"
      Mergify->>LabelManager: Remove "stacked" label
    end
Loading

Suggested labels

minor

Suggested reviewers

  • aknysh
  • gberenice
  • kevcube

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.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai 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:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

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

Documentation and Community

  • 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.

Copy link
Contributor

@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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 34cc497 and a27265e.

📒 Files selected for processing (1)
  • .github/mergify.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Analyze (go)
  • GitHub Check: Lint (golangci)
  • GitHub Check: Lint (golangci)
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (go)
  • GitHub Check: Build (windows-latest, windows)
  • GitHub Check: Summary
🔇 Additional comments (1)
.github/mergify.yml (1)

54-62: Conditional Label Rule Implementation Check

The new rule correctly labels PRs as “stacked” when they are open and not targeting the main branch using the condition base!=main. Please verify that this behavior is intended—specifically, that pull requests merging into any branch other than main (for example, those targeting master) should be marked as stacked. If this is by design, then the rule is good to go; otherwise, consider refining the condition.

Comment on lines +63 to +70
- name: Remove stacked label when PR targets main
conditions:
- and: *is_open
- and: *is_default_branch
actions:
label:
remove:
- stacked
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Clarify Removal Rule's Branch Condition

This removal rule uses the alias *is_default_branch, which includes both base=main and base=master. Since the PR objective specifies unlabeling a PR only when it merges into the main branch, there's a potential conflict: pull requests targeting master might inadvertently have the “stacked” label removed. Consider modifying the condition to explicitly check for base==main. For example, you could replace the alias with a direct condition such as [base==main].

@codecov
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 24.35%. Comparing base (34cc497) to head (a27265e).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1158   +/-   ##
=======================================
  Coverage   24.35%   24.35%           
=======================================
  Files         176      176           
  Lines       20181    20181           
=======================================
  Hits         4915     4915           
  Misses      14462    14462           
  Partials      804      804           
Flag Coverage Δ
unittests 24.35% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@osterman osterman merged commit ea4dd3e into main Mar 24, 2025
70 of 72 checks passed
@osterman osterman deleted the stacked-pr branch March 24, 2025 14:16
@mergify mergify bot removed needs-cloudposse Needs Cloud Posse assistance triage Needs triage labels Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Do not create a new release (wait for additional code changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant