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: remove obsolete labels on pr close #335

Merged
merged 2 commits into from
Jan 21, 2025

Conversation

navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Jan 21, 2025

Removes obsolete labels from pull requests when it is merged or closed.

Related to: openedx/wg-coordination#150

Private-ref: FAL-4026

Test instructions:

  • Set GITHUB_PERSONAL_TOKEN=<your_token> and GITHUB_OSPR_PROJECT="openedx:19" environment variables.
  • Select a closed PR to test, you can use my PR
  • Add some labels to PR like: blocked by other work, needs reviewer assigned etc.
  • Get PR json using github cli, for example,
gh api \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/openedx/openedx-webhooks/pulls/327 > /tmp/some.json
  • Update following lines in openedx_webhooks/tasks/pr_tracking.py to make the process faster.
Line 212 in `desired_support_state` function.
-    is_internal = is_internal_pull_request(pr)
+    is_internal = False
Line 268 in `desired_support_state` function.
-    has_signed_agreement = pull_request_has_cla(pr)
+    has_signed_agreement = True
  • Add below snippet to openedx_webhooks/tasks/github.py file and execute it.
if __name__ == '__main__':
    import json
    with open('/tmp/some.json') as f:
        pr = json.load(f)
    pull_request_changed(pr)
  • This should remove the labels listed in GITHUB_MERGED_PR_OBSOLETE_LABELS and GITHUB_CLOSED_PR_OBSOLETE_LABELS variables.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jan 21, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @navinkarkera!

This repository is currently maintained by @feanil.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.72%. Comparing base (97350f9) to head (4401cf3).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #335      +/-   ##
==========================================
+ Coverage   89.53%   89.72%   +0.19%     
==========================================
  Files          38       38              
  Lines        3009     3026      +17     
  Branches      227      229       +2     
==========================================
+ Hits         2694     2715      +21     
+ Misses        283      279       -4     
  Partials       32       32              

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

@navinkarkera navinkarkera changed the title navin/remove obsolete labels feat: remove obsolete labels on pr close Jan 21, 2025
@navinkarkera navinkarkera force-pushed the navin/remove-obsolete-labels branch from a19eb97 to 10f9e11 Compare January 21, 2025 07:37
@feanil feanil force-pushed the navin/remove-obsolete-labels branch from 10f9e11 to 4401cf3 Compare January 21, 2025 19:53
@feanil feanil merged commit 403d1ca into openedx:master Jan 21, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants