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

Community contribution label #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

iamshobhraj
Copy link

Description

Add GitHub Actions workflow to automatically manage the "community-contribution-in-progress" label on issues based on external contributor assignments. This PR adds both the workflow configuration and the label management script.

Issue addressed

Addresses learningequality/kolibri#12923

Changelog

Steps to test

  1. Set up a repository to call this reusable workflow
  2. Assign an issue to an external contributor
    • Verify the label is automatically added
  3. Unassign the issue
    • Verify the label is automatically removed
  4. Test with internal contributors
    • Verify the label behavior is correct

(optional) Implementation notes

At a high level, how did you implement this?

This PR adds:

  1. A reusable GitHub Actions workflow (community-contribution-label.yml)
  2. A Python script to handle the label management logic (community-contribution-label.py)

The workflow:

  • Is triggered as a reusable workflow
  • Uses Python to interact with GitHub API
  • Manages labels based on assignee status (internal/external)

The script:

  • Checks if issue assignees are external contributors
  • Adds/removes the 'community-contribution-in-progress' label accordingly
  • Handles GitHub API interactions securely

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included (N/A)
  • Critical and brittle code paths are covered by unit tests
  • The change is described in the changelog section above

Reviewer guidance

  • Is the code clean and well-commented?
  • Are there tests for this change?
  • Are all UI components LTR and RTL compliant (if applicable)?
  • Add other things to check for here

After review

  • The changelog item has been pasted to the CHANGELOG.md

Comments

@MisRob MisRob requested review from rtibbles and MisRob January 21, 2025 19:08
@MisRob
Copy link
Member

MisRob commented Jan 22, 2025

Thank you, @iamshobhraj, we will review.

Following-up on your comment

Since I had to use this GitHub Action in my personal repository, I created and used GitHub tokens. For the organization, we'll need to ensure we have a similar token set up if it isn’t already covered.

I think this @rtibbles's guidance from another pull request should be relevant

For the Github token, we will be using the LE Github App for authentication. You can see how we use the token generation action by tibdex here: https://github.com/learningequality/kolibri/blob/develop/.github/workflows/update_h5p.yml#L84 to use those secrets to generate a token we can use for Github authentication.

@iamshobhraj
Copy link
Author

@MisRob i added the tidbex token generation, but i dont know if the token generated will have the permissions needed to add label to issues and read collaborators from the repository.

@MisRob
Copy link
Member

MisRob commented Jan 23, 2025

Thanks @iamshobhraj, we will test that and follow-up

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.

3 participants