Skip to content

Commit

Permalink
Make --provider/-p consistent across the cli and docs (#1514)
Browse files Browse the repository at this point in the history
* Update register_repos.md

* Update register_repos.md

* Make --provider/-p consistent accross the cli and docs

Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>

---------

Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
  • Loading branch information
rdimitrov authored Nov 6, 2023
1 parent f558f9b commit 86ed623
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PRs to resolve existing issues are greatly appreciated and issues labeled as ["g

#### Pull Request Process
* Create an issue outlining the fix or feature.
* Fork the Minder repository to your own github account and clone it locally.
* Fork the Minder repository to your own GitHub account and clone it locally.
* Hack on your changes.
* Correctly format your commit messages, see [Commit Message Guidelines](#Commit-Message-Guidelines) below.
* Open a PR by ensuring the title and its description reflect the content of the PR.
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/app/artifact/artifact_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ var artifact_listCmd = &cobra.Command{
func init() {
ArtifactCmd.AddCommand(artifact_listCmd)
artifact_listCmd.Flags().StringP("output", "f", "", "Output format (json or yaml)")
artifact_listCmd.Flags().StringP("provider", "n", "", "Name for the provider to enroll")
artifact_listCmd.Flags().StringP("provider", "p", "", "Name for the provider to enroll")
artifact_listCmd.Flags().StringP("project-id", "g", "", "ID of the project for repo registration")

if err := artifact_listCmd.MarkFlagRequired("provider"); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/app/auth/auth_revoke_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var Auth_revokeproviderCmd = &cobra.Command{

func init() {
AuthCmd.AddCommand(Auth_revokeproviderCmd)
Auth_revokeproviderCmd.Flags().StringP("provider", "n", "", "Name for the provider to revoke tokens for")
Auth_revokeproviderCmd.Flags().StringP("provider", "p", "", "Name for the provider to revoke tokens for")
Auth_revokeproviderCmd.Flags().StringP("project-id", "g", "", "ID of the project for repo registration")
Auth_revokeproviderCmd.Flags().BoolP("all", "a", false, "Revoke all tokens")
}
2 changes: 1 addition & 1 deletion cmd/cli/app/provider/provider_enroll.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ actions such as adding repositories.`,

func init() {
ProviderCmd.AddCommand(enrollProviderCmd)
enrollProviderCmd.Flags().StringP("provider", "n", "", "Name for the provider to enroll")
enrollProviderCmd.Flags().StringP("provider", "p", "", "Name for the provider to enroll")
enrollProviderCmd.Flags().StringP("project-id", "g", "", "ID of the project for enrolling the provider")
enrollProviderCmd.Flags().StringP("token", "t", "", "Personal Access Token (PAT) to use for enrollment")
enrollProviderCmd.Flags().StringP("owner", "o", "", "Owner to filter on for provider resources")
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/app/repo/repo_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ var repo_listCmd = &cobra.Command{
func init() {
RepoCmd.AddCommand(repo_listCmd)
repo_listCmd.Flags().StringP("output", "f", "", "Output format (json or yaml)")
repo_listCmd.Flags().StringP("provider", "n", "", "Name for the provider to enroll")
repo_listCmd.Flags().StringP("provider", "p", "", "Name for the provider to enroll")
repo_listCmd.Flags().StringP("project-id", "g", "", "ID of the project for repo registration")
if err := repo_listCmd.MarkFlagRequired("provider"); err != nil {
fmt.Fprintf(os.Stderr, "Error marking flag as required: %s\n", err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/app/repo/repo_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ var repo_registerCmd = &cobra.Command{

func init() {
RepoCmd.AddCommand(repo_registerCmd)
repo_registerCmd.Flags().StringP("provider", "n", "", "Name for the provider to enroll")
repo_registerCmd.Flags().StringP("provider", "p", "", "Name for the provider to enroll")
repo_registerCmd.Flags().StringP("project-id", "g", "", "ID of the project for repo registration")
repo_registerCmd.Flags().StringVar(&cfgFlagRepos, "repo", "", "List of repositories to register, i.e owner/repo,owner/repo")
if err := repo_registerCmd.MarkFlagRequired("provider"); err != nil {
Expand Down
21 changes: 18 additions & 3 deletions docs/docs/getting_started/register_repos.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,33 @@ You can also register a repository (or set of repositories) by name:
minder repo register --provider github --repo "owner:repo1,owner:repo2"
```

A webhook will now be created in each repository, and selected repositories will be considered registered within Minder. Any events that now occur in any registered repository will be sent to Minder, and processed accordingly.
A webhook will now be created in each repository that you've selected for registering with Minder.
You should see a list of the repositories that have been registered.

After registration, Minder will go through your existing profiles and apply them against these repositories.

Any events that now occur in your registered repositories will be sent to Minder and processed accordingly.

## List and Get Repositories

You can list all repositories registered in Minder:

```bash
minder repo list -n github
minder repo list --provider github
```

You can also get a specific repository:

```bash
minder repo get -n github -r {$repo_id}
minder repo get --provider github -r {$repo_id}
```

## Deleting a registered repository

If you want to stop monitoring a repository, you can delete it from Minder by using the `repo delete` command:

```bash
minder repo delete --provider github --name "owner:repo1"
```

This will delete the repository from Minder and remove the webhook from the repository.
2 changes: 1 addition & 1 deletion tools/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ minder() {
# use root:root for credentials
minder auth login

minder provider enroll -n github
minder provider enroll -p github

echo '$ minder rule_type create -f examples/github/rule-types/'
echo '---'
Expand Down

0 comments on commit 86ed623

Please sign in to comment.