feat: sync linked issue labels to pull requests#1876
feat: sync linked issue labels to pull requests#1876cheese-cakee wants to merge 2 commits intohiero-ledger:mainfrom
Conversation
Replaces the existing beginner issue template with a structurally distinct design focused on increasing completion rates. Key changes: - Readiness self-check so contributors can assess if they are ready - Single "The Task" section replaces the Description/Solution/Steps split - "Where to Start" exploration pointers replace step-by-step recipes - Compact workflow quick-reference table instead of full tutorial - Common pitfalls section addressing real failure patterns - External Python documentation references alongside project docs - All links converted to absolute URLs for correct issue rendering - AI guidance folded into pitfalls (no standalone section) Resolves: #1651 Signed-off-by: cheese-cakee <farzanaman99@gmail.com>
- Adds workflow to compute labels from linked issues - Adds workflow to add labels via actions-ecosystem-add-labels - Skips bot-authored PRs, handles dry-run mode - Implements single-responsibility functions for maintainability Signed-off-by: cheese-cakee <farzanaman99@gmail.com>
|
Hi, this is MergeConflictBot. Please resolve these conflicts locally and push the changes. Quick Fix for CHANGELOG.md ConflictsIf your conflict is only in CHANGELOG.md, you can resolve it easily using the GitHub web editor:
For all other merge conflicts, please read: Thank you for contributing! |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (5)
WalkthroughThis PR introduces a workflow system to synchronize pull request labels from linked issues, rewrites the beginner issue template with enhanced guidance for first-time contributors, and updates the changelog. The label syncing feature includes a GitHub Actions script that extracts linked issue numbers, collects labels from those issues, computes missing labels, and applies them to the PR via two coordinated workflows. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant GitHub as GitHub<br/>(PR Event)
participant ComputeWF as Compute Workflow
participant Script as Label Sync Script
participant GitHubAPI as GitHub API
participant AddWF as Add Workflow
User->>GitHub: Open/Update PR with linked issue
GitHub->>ComputeWF: Trigger on pr event
ComputeWF->>Script: Run sync-issue-labels.js
Script->>GitHubAPI: Fetch PR data
Script->>GitHubAPI: Fetch linked issue labels
Script->>Script: Compute missing labels
ComputeWF->>GitHub: Upload labels.json artifact
GitHub->>AddWF: Trigger on compute success
AddWF->>GitHub: Download artifact
AddWF->>GitHubAPI: Apply labels to PR
GitHubAPI-->>User: PR now labeled
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 📋 Issue PlannerLet us write the prompt for your AI agent so you can ship faster (with fewer bugs). View plan for ticket: ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
Description
Adds an automated GitHub workflow + bot script to sync labels from linked issues to pull requests.
When a PR body includes closing keywords (for example
Fixes #123), the workflow fetches labels from those linked issues and adds missing labels to the PR.Related issue(s)
Fixes #1716
What changed
.github/workflows/sync-issue-labels-compute.ymlpull_request_targetonopened,edited,reopened,synchronize, andready_for_reviewharden-runner, checkoutmain, pinned action SHAs)workflow_dispatchwithpr_number+dry_run.github/workflows/sync-issue-labels-add.ymlworkflow_run(notpull_request_target)actions-ecosystem-add-labelsaction to add labels.github/scripts/sync-issue-labels.jsfixes/closes/resolves)[Unreleased] -> .GithubScope note
This PR intentionally implements label sync only (additive). It does not remove labels from PRs and does not include assignee sync.
Architecture
Two separate workflows to avoid
pull_request_targetlimitations:sync-issue-labels-compute.yml- reads labels (runs in pull_request_target context)sync-issue-labels-add.yml- writes labels (runs in workflow_run context with write permissions)Testing
Local validation
node --check .github/scripts/sync-issue-labels.jsChecklist