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

Set CLA-related labels ("CLA: Error" & "CLA: Valid") #3577

Open
mgol opened this issue Aug 3, 2022 · 8 comments
Open

Set CLA-related labels ("CLA: Error" & "CLA: Valid") #3577

mgol opened this issue Aug 3, 2022 · 8 comments
Labels
CommunityReported enhancement New feature or request

Comments

@mgol
Copy link

mgol commented Aug 3, 2022

Summary

For the use in jQuery, I'd like it to add a CLA: Error or CLA: Valid based on the current CLA verification status. We had this with the previous CLA system used by jQuery and it was extremely valuable - I could quickly filter PRs with a proper CLA status without opening PR links.

Background

  1. Go to https://github.com/jquery/jquery/pulls
  2. Be able to filter out PRs without valid CLA signatures easily.
  3. Be able to tell at a glance at the PR list which PR authors have signed the CLA and which have not.

User Story

I want to be able to quickly filter PRs with a proper CLA status without opening PR links.

Acceptance Criteria

  1. After EasyCLA runs on a PR, it should assign the CLA: Error or CLA: Valid depending on whether the CLA was signed or not.
  2. Any time the bot re-runs the check: on PR updates, when the CLA was signed, etc., if the state of the CLA signature has changed, the previous CLA label should be removed and the proper one should be set.

References

N/A

@mgol mgol added the enhancement New feature or request label Aug 3, 2022
@nickmango
Copy link
Collaborator

Feature to be discussed
@mlehotskylf

@mlehotskylf
Copy link
Contributor

I believe the "search" functionality is a feature of GitHub, and it's not something we can address from the EasyCLA perspective. If that's the case, I suggest we close this ticket.
@nickmango @jarias-lfx please let me know if I'm wrong.

@mgol
Copy link
Author

mgol commented May 9, 2024

Search is a GitHub feature but attaching labels is very much something that the EasyCLA bot can do - and I provided rationale why that would be useful in my original post.

@nickmango
Copy link
Collaborator

Yea indeed @mlehotskylf we have to add the tagging accordingly on the PR

nickmango added a commit to nickmango/easycla that referenced this issue May 9, 2024
- Added label identifying the EasyCLA status for the Github search feature

Signed-off-by: Harold Wanyama <hwanyama@contractor.linuxfoundation.org>
nickmango added a commit that referenced this issue May 9, 2024
@nickmango
Copy link
Collaborator

@thakurveerendras kindly verify

@thakurveerendras
Copy link
Contributor

Tested on dev site & found that label properly added on new & existing PR, So updating issue status

For existing PR we need to add /easycla comment

image
image
image

nickmango added a commit to nickmango/easycla that referenced this issue May 14, 2024
nickmango added a commit that referenced this issue May 14, 2024
@nickmango
Copy link
Collaborator

nickmango commented May 16, 2024

Hello @mgol , thanks for your patience . Using Github Actions pipeline you can add a label upon the status of the easycla checks. Theres a project thats handling that on their end and creating labels accordingly.. This is one of the reasons it was decided that it would be more flexible with the project owner handling the status updates.
Sample script that would be of use is attached below. Kindly reach out in case of any issues you face

name: Label PR based on EasyCLA status

on:
  check_suite:
    types: [completed]
  check_run:
    types: [completed]

jobs:
  label:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Label PR
      uses: actions/github-script@v5
      if: github.event.check_suite.app.name == 'EasyCLA' || github.event.check_run.app.name == 'EasyCLA'
      with:
        script: |
          const status = (github.event.check_suite || github.event.check_run).conclusion;
          const pr_number = (github.event.check_suite || github.event.check_run).pull_requests[0].number;
          const label = status === 'success' ? 'EasyCLA:Valid' : 'EasyCLA:Error';

          await github.rest.issues.addLabels({
            owner: context.repo.owner,
            repo: context.repo.repo,
            issue_number: pr_number,
            labels: [label]
          });

cc @mlehotskylf

@mlehotskylf
Copy link
Contributor

@mgol please let us know if above script worked for you. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CommunityReported enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants