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

opensearch-project/project-meta

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 [email protected]: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-github-username"

Make code changes as needed. In our example, we used VSCode, opened all files called MAINTAINERS.md (using a open all files extension) and made bulk search/replace edits.

Create a new branch with the changes and commit the code. Replace your-github-username with your GitHub username.

meta exec "git checkout -b updated-maintainers"
meta exec "git add --all"
meta exec "git commit -s -m 'Updated MAINTAINERS.md to match recommended opensearch-project format.'"
meta exec "git push your-github-username updated-maintainers"

Set the default repo.

meta exec "git remote get-url origin | sed s/[email protected]\://g | sed s/.git//g | xargs gh repo set-default"

Make pull requests. Because you are creating many issues make sure to reference a parent issue in the body so that they can be easily linked together. Pick your fork when asked where to push the code every time and examine the first couple of pull requests for correctness before proceeding with the rest.

meta exec "gh pr create --title 'Updated MAINTAINERS.md format.' --body='Coming from https://github.com/opensearch-project/.github/issues/121, updated MAINTAINERS.md to match opensearch-project recommended format.'"

Contributing

Please contribute! See CONTRIBUTING, Maintainer and Admin Responsibilities for more information.

Security

See Security

Code of Conduct

This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ, or contact [email protected] with any additional questions or comments.

License

This project is licensed under the Apache v2.0 License.

Copyright

Copyright OpenSearch Contributors. See NOTICE for details.

About

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

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Languages