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

Add workflows to ping about play reviews #7177

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

Conversation

keunes
Copy link
Member

@keunes keunes commented May 10, 2024

Description

Set up two workflows to:

  • Add the 'Needs: Review reply' to an issue in case an added or edited issue comment contains the old or the new links to Play store reviews in the Google Play Console.
  • Add a comment tagging an organisation team on an issue when a new release is published if the issue a) is closed (assuming it's been implemented/addressed) and b) has the 'Needs: Review reply' label (assuming that there are links to Google Play reviews which need a reply.

Once replied, the user should remove the label in order to avoid being tagged again.
For this to work, I have also set up the 'review-replyers' team, which when tagged should ping all team members (currently only me).

Checklist

owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: 'This feature or fix is now released! @AntennaPod/review-replyers, time to inform relevant reviews in Google Play console (please see links in one or more of the comments above).'
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I think this part is quite hard to do. We often close issues on the develop branch after the feature freeze of the beta version. So this would tag things that are not actually released.

Copy link
Member Author

@keunes keunes May 10, 2024

Choose a reason for hiding this comment

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

Thanks for taking a look.
This workflow only runs when you create a public release (see line 4), i.e. when it's available on Google Play. Only at that point it posts messages on closed issues (thus not as soon as the issue gets closed).

Copy link
Member

Choose a reason for hiding this comment

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

Yup but when creating the release, we have already closed additional issues that are not in that release but the release after that

For example, "download without subscribing" is closed but will be in 3.5.0, not 3.4.0

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, that's what you mean. Right.

Then either we should start linking issues with milestones, or I get tagged twice on some issues (which is not a huge problem).

@keunes
Copy link
Member Author

keunes commented May 11, 2024

Actually, I just thought of another approach to get the list of issues/PRs which are actually included in the release: replicate a process like in https://github.com/AntennaPod/AntennaPod/blob/develop/scripts%2FgetChangelog.py

@ByteHamster
Copy link
Member

ByteHamster commented May 18, 2024

Yeah, using that script sounds more reliable. Maybe it could even just add a column to the changelog output checking if the issue in the PR description contains a review?

@keunes
Copy link
Member Author

keunes commented May 18, 2024

Maybe it could even just add a column to the changelog output checking if the issue in the PR description contains a review?

Hmm, that might be an idea. We could apply the label at issue level still, and then check for that. Otherwise we'd have to cycle through all comments in the script, and there's already a delay to not hit the rate limit.

@ByteHamster
Copy link
Member

Sounds good

})

# Create a list of dictionaries with commits for in CSV file
# /// NOTE maybe it's better to move this up to before the PR list generation (but after the list of unique PRs has been created) as it clears some of the memory used
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to care about memory here. To fill gigabytes of RAM on a PC, you need a lot of PRs.

# Define variables
owner = os.getenv('OWNER', "AntennaPod") # The owner (organisation or user) of the repository
repo = os.getenv('REPO', "AntennaPod") # The repository name
token = os.getenv('GITHUB_API_TOKEN') # The GitHub API token [evnironment variable, otherwise user input]
Copy link
Member

Choose a reason for hiding this comment

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

Nice, doing this via an environment variable avoids having to re-type the api token every time

Comment on lines +23 to +24
base_ref = os.getenv('BASE') # The base reference (release code or branch); point of reference [user input]
head_ref = os.getenv('HEAD') # The head reference (release code or branch); environment containing the changes [user input]
Copy link
Member

Choose a reason for hiding this comment

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

If this is always user input, I don't think it needs to be read from the environment variables

Comment on lines +20 to +21
owner = os.getenv('OWNER', "AntennaPod") # The owner (organisation or user) of the repository
repo = os.getenv('REPO', "AntennaPod") # The repository name
Copy link
Member

Choose a reason for hiding this comment

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

Can't we hard-code this instead of using a variable? That would maybe reduce the complexity of the code a bit.

token = os.getenv('GITHUB_API_TOKEN') # The GitHub API token [evnironment variable, otherwise user input]
base_ref = os.getenv('BASE') # The base reference (release code or branch); point of reference [user input]
head_ref = os.getenv('HEAD') # The head reference (release code or branch); environment containing the changes [user input]
max_associatedPRs = 5 # The maximum number of pull requests that the script will fetch per commit
Copy link
Member

Choose a reason for hiding this comment

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

I would move this closer to where it is used. Makes it easier to read

Comment on lines +128 to +144
If you're using bash or zsh, you can add the following line to your shell profile file (.bashrc, .bash_profile or .zshrc):
export GITHUB_API_TOKEN='{token}'

If you're using Fish shell, you can add the following line to your config.fish file:
set -x GITHUB_API_TOKEN '{token}'

After adding this line, you'll need to restart your terminal or run 'source ~/.bashrc' (or the appropriate file for your shell) for the changes to take effect.

On Windows, you can set environment variables through the System Properties. Here's how:
1. Right-click on Computer on the desktop or in the Start menu.
2. Choose Properties.
3. Click on Advanced system settings.
4. Click on Environment Variables.
5. Click on New under the User or System variables sections.
6. Enter 'GITHUB_API_TOKEN' as the variable name and '{token}' as the variable value.
7. Click OK in all windows.

Copy link
Member

Choose a reason for hiding this comment

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

Do we really need this tutorial in our changelog script? I think users of this script can google themselves how to set an environment variable. This again reduces the length/complexity of the script.


# Define head_ref
if not head_ref:
print("\nThen, from which environment would you like to see the changes (the head)?")
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand environment here. Maybe just "where do you want the changes to start`?

# Create string with issue & PR number(s) that need review replies
numbers = []
maximum_hit = False
if any(label['id'] == 'LA_kwDOAFAGHc8AAAABoGK6aw' for label in prdata['labels']['nodes']):
Copy link
Member

Choose a reason for hiding this comment

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

Can this be done based on the label name instead of label id? That would make it easier to read

comment:
runs-on: ubuntu-latest
steps:
- name: "Tag review replyers in closed issues with 'Needs: Review reply' label"
Copy link
Member

Choose a reason for hiding this comment

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

This workflow is no longer needed, right? Now that the script checks it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants