Add New Module for Project Maintenance Automation (adding tracking issues to multiple repos) #815
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #746
Overview
This PR introduces a new module
project_maintenance.py
designed to help you automate creating a tracking issue across multiple repositories. It also lets you automatically make a card for the issue on a GitHub next generation project board. Finally, it assists with adding a topic to a github repositories based on their presence on the /list?json=1 endpoint on a given Docassemble server. This topic can later be used to decide which repos need tracking issues to be created for them.Features
Usage
This module should be run locally for now. A future task could be to make a user-friendly way to run this via GitHub actions, but it seems it would need a full GUI. Probably commandline usage is enough.
Before using the module, ensure PyGithub is installed.
Command Line Interface
The module can be used via the command line with various subcommands:
Get Package Names
server_name
: Name or IP address of the Docassemble server.Add Tag to Repos
token
: GitHub Personal Access Token (PAT) with appropriate permissions.org_name
: Name of the GitHub organization.repo_names
: List of repository names to which the tag will be added.tag
: The tag to be added to the repositories.Process Packages and Add Tag
server_name
: Name or IP address of the Docassemble server.token
: GitHub Personal Access Token.org_name
: Name of the GitHub organization.tag
: Tag to be added to each repository.Add Issues and Create Classic Cards
token
: GitHub Personal Access Token.org_name
: Name of the GitHub organization.project_name
: Name of the GitHub project.topic
: The GitHub topic to filter repositories by.issue_title
: Title of the issue.issue_body
: Body of the issue.Add Issues and Create Cards (Next-Generation Projects)
token
: GitHub Personal Access Token.org_name
: Name of the GitHub organization.project_name
: Name of the GitHub project.topic
: The GitHub topic to filter repositories by.issue_title
: Title of the issue.issue_body
: Body of the issue.Link Issue Titles to Projects
token
: GitHub Personal Access Token.org_name
: Name of the GitHub organization.project_name
: Name of the GitHub project.topic
: GitHub topic to filter repositories by.issue_title
: Title of the issue to link.Example usage
python docassemble/AssemblyLine/project_maintenance.py add_issues_and_create_cards ghp_... SuffolkLITLab "Add metadata to each live interview" live "Add courtformsonline.org metadata" "Add the metadata needed to work with the new courtformsonline.org repo scanning tool"