-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Promote beta registry organization, module, label and commit commands (…
…#3170) This PR moves `[module, organization, label, commit]` commands out of beta. Here are pruned outputs of `--help-tree` before and after. Before ``` buf registry --help-tree registry Manage assets on the Buf Schema Registry archive Archive one or more labels for the given input commit Manage a repository's commits get Get commit details list List repository commits label Manage a repository's labels create Create a label for a specified commit get Get label details list List repository labels organization Manage organizations create Create a new BSR organization delete Delete a BSR organization get Get a BSR organization repository Manage repositories create Create a BSR repository delete Delete a BSR repository deprecate Deprecate a BSR repository get Get a BSR repository list List BSR repositories undeprecate Undeprecate a BSR repository update Update BSR repository settings unarchive Unarchive one or more labels for the given input ``` After ``` buf registry --help-tree registry Manage assets on the Buf Schema Registry commit Manage a module's commits add-label Add labels to a commit info Get commit information list List modules commits resolve Resolve commit from a reference label Manage a module's labels archive Archive a module label info Show label information list List module labels unarchive Unarchive a module label module Manage BSR modules create Create a BSR module delete Delete a BSR module deprecate Deprecate a BSR module info Get a BSR module undeprecate Undeprecate a BSR module update Update BSR module settings organization Manage organizations create Create a new BSR organization delete Delete a BSR organization info Show information about a BSR organization update Update a BSR organization ``` Fixes #1431 --------- Co-authored-by: bufdev <[email protected]>
- Loading branch information
1 parent
72d6cc3
commit 2ff1b33
Showing
62 changed files
with
1,444 additions
and
1,142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2020-2024 Buf Technologies, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package bufcli | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/spf13/pflag" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestStringPointerFlagSet(t *testing.T) { | ||
t.Parallel() | ||
expected := "foo" | ||
testParseStringPointer(t, "test-flag-name", &expected, "--test-flag-name", "foo") | ||
} | ||
|
||
func TestStringPointerFlagSetEmpty(t *testing.T) { | ||
t.Parallel() | ||
expected := "" | ||
testParseStringPointer(t, "test-flag-name", &expected, "--test-flag-name", "") | ||
} | ||
|
||
func TestStringPointerFlagNotSet(t *testing.T) { | ||
t.Parallel() | ||
testParseStringPointer(t, "test-flag-name", nil) | ||
} | ||
|
||
func testParseStringPointer(t *testing.T, flagName string, expectedResult *string, args ...string) { | ||
var stringPointer *string | ||
flagSet := pflag.NewFlagSet("test flag set", pflag.ContinueOnError) | ||
BindStringPointer(flagSet, flagName, &stringPointer, "test usage") | ||
err := flagSet.Parse(args) | ||
require.NoError(t, err) | ||
require.Equal(t, expectedResult, stringPointer) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.