Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add auto-labeler based off of code changes #1320

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

monilpat
Copy link
Collaborator

@monilpat monilpat commented Dec 21, 2024

Relates to:

This PR addresses the need to automate the labeling of pull requests based on file paths and branch names, enhancing workflow efficiency and organization. #1325

Risks

  • Risk Level: Low
  • Potential Impact: Misconfiguration may lead to incorrect labels being applied, which could cause confusion among contributors.

Background

What does this PR do?

This PR introduces a GitHub Actions workflow that automatically labels pull requests based on the paths of modified files and branch names. It utilizes the actions/labeler action to apply predefined labels, streamlining the triage process.

What kind of change is this?

  • Features (non-breaking change which adds functionality)

Documentation changes needed?

  • My changes require a change to the project documentation.
  • I have updated the documentation accordingly to include information about the new labeling workflow and how to configure it.

Testing

Where should a reviewer start?

Review the .github/labeler.yml file for label configurations and the .github/workflows/labeler.yml file for the workflow setup.

Detailed testing steps

  1. Review Configuration Files:

    • Ensure that .github/labeler.yml contains accurate label definitions corresponding to file paths and branch naming conventions.
    • Verify that .github/workflows/labeler.yml is correctly configured to trigger on pull request events.
  2. Create Test Pull Requests:

    • Submit pull requests that modify files in various directories or branches to test if the appropriate labels are applied automatically.
  3. Monitor Workflow Execution:

    • Observe the Actions tab in the repository to confirm that the workflow runs as expected and applies the correct labels.
  4. Validate Label Application:

    • Check the pull requests to ensure that the labels applied match the criteria defined in .github/labeler.yml.
  5. Adjust Configurations if Necessary:

    • Based on testing outcomes, refine the label definitions or workflow settings to achieve the desired labeling behavior.

Deployment instructions

No special deployment instructions are required. Once merged, the workflow will be active and apply labels to new pull requests based on the defined criteria.

By implementing this automated labeling system, we aim to improve the efficiency of our pull request management process, ensuring that contributions are accurately categorized and reviewed promptly.

Base automatically changed from develop to main December 22, 2024 07:01
@monilpat monilpat changed the base branch from main to develop December 22, 2024 21:09
Copy link
Collaborator Author

@monilpat monilpat left a comment

Choose a reason for hiding this comment

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

This PR introduces a much-needed automation feature to streamline our workflow by automatically labeling pull requests. The approach using GitHub Actions is well-structured and should significantly enhance our efficiency in managing PRs. However, thorough testing is crucial to ensure that the labeling criteria align perfectly with our existing and future needs. Great job on the detailed testing steps provided, which will help in validating the changes effectively.

pull-requests: write

steps:
- uses: actions/labeler@v4
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ensure that the permissions are set correctly to avoid any security issues, especially with 'pull-requests: write'.


# Label PRs that modify documentation files
Documentation:
- changed-files:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Consider adding comments to clarify the purpose and usage of each label configuration for future maintainability.

Copy link
Collaborator Author

@monilpat monilpat left a comment

Choose a reason for hiding this comment

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

This pull request introduces an innovative automated labeling system that will significantly enhance our workflow efficiency. The implementation appears solid, but I recommend thorough testing with various pull requests to ensure labels are applied correctly. Great work on this!

# .github/labeler.yml

# Label PRs that modify documentation files
Documentation:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Defined clear labeling rules for different directories, which will help maintain organization in our pull requests.

- 'docs/**'

# Label PRs with 'feature' if the head branch name starts with 'feature'
Feature:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ensure that the regex for head-branch accurately matches your desired feature branches. Consider expanding this to include other branch naming conventions if necessary.

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.

1 participant