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

feat: Including Regular Expression filter when targeting Github Repositories #426

Merged
merged 26 commits into from
Nov 9, 2023

Conversation

josealdaco
Copy link
Contributor

@josealdaco josealdaco commented Nov 6, 2023

What does this change

Allows to filter out target repositories using a regular expression

This change introduces two new flags --repo-include and --repo-exclude which will filter out repositories mentioned in their specified regular expressions. Example:
multi-gitter run ./test.sh --repo-include "^repoprefix-" --repo-exclude "^repoprefix-ignorerepo$" --repo-search "repoprefix-" --dry-run --commit-message "chore: foo"

What issue does it fix

Notes for the reviewer

  • Previous PR discussions: here

Checklist

  • Made sure the PR follows the CONTRIBUTING.md guidelines
  • Tests if something new is added

@josealdaco josealdaco changed the title Regex target repositories feat: Including Regular Expression filter when targeting Github Repositories Nov 6, 2023
Copy link
Owner

@lindell lindell left a comment

Choose a reason for hiding this comment

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

Thanks for the PR 🙂

I've included some comments, where the biggest one is to not to the filtering within the GitHub package, but instead in the multi-gitter package. This will allow all users to use the feature, and not just GitHub users.

func filterRepositories(repos []scm.Repository, skipRepositoryNames []string) []scm.Repository {

cmd/platform.go Outdated Show resolved Hide resolved
cmd/platform.go Outdated Show resolved Hide resolved
internal/scm/github/github.go Outdated Show resolved Hide resolved
internal/scm/github/github.go Outdated Show resolved Hide resolved
internal/scm/github/github.go Outdated Show resolved Hide resolved
@josealdaco
Copy link
Contributor Author

Moved regex filtering to

func filterRepositories(repos []scm.Repository, skipRepositoryNames []string) []scm.Repository {

cmd/cmd-run.go Outdated Show resolved Hide resolved
cmd/cmd-run.go Outdated Show resolved Hide resolved
internal/multigitter/run.go Show resolved Hide resolved
tests/table_test.go Show resolved Hide resolved
Copy link
Owner

@lindell lindell left a comment

Choose a reason for hiding this comment

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

Just some minor, mostly style comments left 🙂

cmd/cmd-run.go Outdated Show resolved Hide resolved
cmd/cmd-run.go Outdated Show resolved Hide resolved
cmd/platform.go Outdated Show resolved Hide resolved
cmd/cmd-run.go Outdated Show resolved Hide resolved
internal/multigitter/run.go Outdated Show resolved Hide resolved
cmd/cmd-run.go Outdated Show resolved Hide resolved
cmd/cmd-run.go Outdated Show resolved Hide resolved
Copy link
Owner

@lindell lindell left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Thanks for the contribution 🙂

@lindell lindell merged commit faf0092 into lindell:master Nov 9, 2023
8 checks passed
@josealdaco josealdaco deleted the regex_target_repositories branch November 9, 2023 21:00
Copy link
Contributor

github-actions bot commented Nov 9, 2023

Included in release v0.49.0 🎉

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

Successfully merging this pull request may close these issues.

None yet

2 participants