Skip to content

Tools to make it easy to manage processes across the opensearch-project org.

License

Notifications You must be signed in to change notification settings

andrross/project-meta

 
 

Repository files navigation

Meta

This project uses meta to operate on all the repositories in the opensearch-project organization.

Install GitHub CLI

Install and configure GitHub CLI from cli.github.com/manual/installation. Authenticate with gh auth login and ensure that it works, e.g. gh issue list.

Install Meta

npm install -g meta

Check Out Repos

meta git update

Use meta git pull to subsequently pull the latest revisions.

Get Repo Info

meta gh issue list

Add a New Repo

meta project import new-repo git@github.com:opensearch-project/new-repo.git

Meta stores a list of repositories in .meta. You can bulk update this file from the opensearch-project org as follows.

./bin/check-repos.sh

Create or Update Labels in All Repos

You can create labels in all opensearch-project repos without checking out any code.

for r in $(gh repo list opensearch-project --limit 100 | cut -f1); do echo $r ;  gh label create 'hacktoberfest' --description 'Global event that encourages people to contribute to open-source.' -c '#3B6BBD' --repo https://github.com/$r; done

For control over a list of repos, use meta.

meta exec "gh label create 'backwards-compatibility' -c '#773AA8'

This makes it easy to create version labels.

meta exec "gh label create 'untriaged' -c '#fbca04'"
meta exec "gh label create 'v1.0.0' -c '#d4c5f9'"
meta exec "gh label create 'v1.1.0' -c '#c5def5'"
meta exec "gh label create 'v2.0.0' -c '#b94c47'"
meta exec "gh label create 'patch' -c '#dd8e2c'"

Create an Issue in All Repos

Create a file for the issue body, e.g. issue.md.

meta exec "gh issue create --label backwards-compatibility --title 'Ensure backwards compatibility' --body-file ../issue.md"

Find Labeled Issues

Find all issues labeled v1.0.0.

meta exec "gh issue list -l v1.0.0"

How many are left?

meta exec "gh issue list -l v1.0.0" | wc -l

Check Tags

Find out whether 1.0.0 tag exists in all repos.

meta exec "git ls-remote | grep -w 'refs/tags/1.0.0$' || echo missing"

Or using local tags.

meta git pull --tags
meta exec "git tag | grep -w '^1.0.0$' || echo missing"

Make a Change in Many Repos

In .github#21 we needed to update all MAINTAINERS.md files.

Check out the source code in all the repos.

meta git update

Ensure you have a fork for your code. Choose "no" when promoted to add a remote.

meta exec "gh repo fork"

Ensure remotes to your fork. Replace your-github-username with your GitHub username.

meta exec "git remote get-url origin | sed s/opensearch-project/your-github-username/g | xargs git remote add your-gi