-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
base: develop
Are you sure you want to change the base?
Conversation
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).' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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).
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 |
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? |
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. |
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 |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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
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] |
There was a problem hiding this comment.
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
owner = os.getenv('OWNER', "AntennaPod") # The owner (organisation or user) of the repository | ||
repo = os.getenv('REPO', "AntennaPod") # The repository name |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
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. | ||
|
There was a problem hiding this comment.
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)?") |
There was a problem hiding this comment.
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']): |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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
Description
Set up two workflows to:
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
./gradlew checkstyle spotbugsPlayDebug spotbugsDebug :app:lintPlayDebug