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

Make 'notify_team_new_comment' GitHub action re-usable #12567

Closed
MisRob opened this issue Aug 16, 2024 · 19 comments
Closed

Make 'notify_team_new_comment' GitHub action re-usable #12567

MisRob opened this issue Aug 16, 2024 · 19 comments
Assignees
Labels
github_actions Pull requests that update GitHub Actions code help wanted Open source contributors welcome TAG: dev experience Build performance, linting, debugging...

Comments

@MisRob
Copy link
Member

MisRob commented Aug 16, 2024

Summary

In our repositories, there are three same copies of the GitHub action that sends a Slack notification when a contributor comments on issue, .github/workflows/notify_team_new_comment.yml. The other two repositories that have this action in their .github/workflows are Studio and Kolibri Design System.

This is cumbersome since we need three pull requests for each bugfix. This gets amplified by troubles with testing GH actions when we often need to try out more changes to apply a fix.

The goal of this issue is to find a place for this action in our GitHub organization and share it from there between Kolibri, Studio, and Kolibri Design System.

@MisRob
Copy link
Member Author

MisRob commented Aug 16, 2024

I believe @rtibbles mentioned that https://github.com/learningequality/.github repository could be utilized

@MisRob MisRob added TAG: dev experience Build performance, linting, debugging... github_actions Pull requests that update GitHub Actions code labels Aug 16, 2024
@rtibbles
Copy link
Member

Yes, I think the setup would be that we make it as a reusable workflow in the .github repository and then update every place it is currently used to reference it.

@MisRob MisRob added the help wanted Open source contributors welcome label Nov 13, 2024
@rparadowski
Copy link
Contributor

I will make it if it's still free.

@akolson
Copy link
Member

akolson commented Nov 18, 2024

Hi @rparadowski thanks you. I have assigned it to you!

@MisRob
Copy link
Member Author

MisRob commented Nov 19, 2024

Hi @rparadowski, I'm reaching out based on your e-mail. Here's some guidance on how to best organize this work, so we can test it without breaking the production:

We would then review and merge both, and tested it works in test-actions. After that'd be done, we would proceed to move the part from test-actions to Kolibri/Studio/KDS. Let us know if you had any questions.

Before you open .github and test-actions pull requests, it'd be good to have your two own repositories for easier development. However, you may not be able to test it as a whole, and that's not a big deal - we will collaborate with you on fine-tuning the logic to make it work in LE repositories.

@rparadowski
Copy link
Contributor

rparadowski commented Nov 19, 2024

Hi, thank you for instruction.

Note for testing: default branch of dependent repo (eg kolibri, test-actions) needs to be switched to change branch of the PR in order to test the change (https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#issue_comment).

  1. .github PR created: 12567 issue .github#9
  2. test-actions PR created Test notify_team_new_comment workflow test-actions#53 and tested using Test notify_team_new_comment workflow rparadowski/test-actions#1 and private slack. For tests I removed constraints on author and then reverted it.

@MisRob
Copy link
Member Author

MisRob commented Nov 20, 2024

Hi @rparadowski, thanks a lot! Please give me few days to test and preview. I should get back to you no later than some time next week.

@MisRob
Copy link
Member Author

MisRob commented Dec 2, 2024

Hi @rparadowski, I was just able to successfully test this, thanks so much. Would you be interested to complete this issue by opening PRs to all repos that will use .github shared workflow? Please let me know and I can provide more guidance.

@MisRob
Copy link
Member Author

MisRob commented Dec 2, 2024

@rparadowski On .github part, the only tweak I noticed that would be needed is here

text: "*[Kolibri] New comment on issue: <${{ github.event.issue.html_url }}#issuecomment-${{ github.event.comment.id }}|${{ steps.escape_title.outputs.ISSUE_TITLE }} by ${{ github.event.comment.user.login }}>*"

instead of [Kolibri] we need to provide repository name, because this will be different for each repo where we call the shared workflow.

@rparadowski
Copy link
Contributor

@MisRob In case repo name doesn't have to be capitalized, here is dynamic repo name:
learningequality/.github#11
Image

Use reusable workflow in other repos:
#12900
learningequality/studio#4844
learningequality/kolibri-design-system#849
learningequality/ricecooker#543

@rparadowski
Copy link
Contributor

@MisRob
Copy link
Member Author

MisRob commented Dec 4, 2024

Thanks a lot @rparadowski, we will review. The repo name doesn't need to be capitalized, no problem at all.

@MisRob
Copy link
Member Author

MisRob commented Dec 9, 2024

Hi @rparadowski, so far me merged #12900 and it seems to work well so I anticipate we will merge the remaining PRs soon. We use these automations from le-utils repo as well, if you'd like to open the last pull request, but no problem I can do it too. Thanks a lot for this work.

@rparadowski
Copy link
Contributor

I have to admit I don't fully understand. Do you want to:

  1. move notify_team_new_comment workflow definition from .github repo to le-utils repo?
  2. Add additional workflow to le-utils repo so it starts using notify_team_new_comment from now on?

@MisRob
Copy link
Member Author

MisRob commented Dec 9, 2024

@MisRob
Copy link
Member Author

MisRob commented Dec 17, 2024

@rparadowski
Copy link
Contributor

Hi @MisRob and sorry for lack of responsiveness from my side. Please see requested PR: learningequality/le-utils#151

@MisRob
Copy link
Member Author

MisRob commented Jan 15, 2025

Thank you @rparadowski

@MisRob MisRob closed this as completed Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github_actions Pull requests that update GitHub Actions code help wanted Open source contributors welcome TAG: dev experience Build performance, linting, debugging...
Projects
None yet
Development

No branches or pull requests

4 participants