Merge pull request #9356 from cli/9278-gh-release-view-with-json-parser-outputs-node_id-instead-of-id
Expose json databaseId field for release commands
This commit is contained in:
commit
78c33617cf
2 changed files with 37 additions and 13 deletions
|
|
@ -21,22 +21,23 @@ import (
|
|||
)
|
||||
|
||||
var ReleaseFields = []string{
|
||||
"url",
|
||||
"apiUrl",
|
||||
"uploadUrl",
|
||||
"tarballUrl",
|
||||
"zipballUrl",
|
||||
"id",
|
||||
"tagName",
|
||||
"name",
|
||||
"body",
|
||||
"isDraft",
|
||||
"isPrerelease",
|
||||
"createdAt",
|
||||
"publishedAt",
|
||||
"targetCommitish",
|
||||
"author",
|
||||
"assets",
|
||||
"body",
|
||||
"createdAt",
|
||||
"databaseId",
|
||||
"id",
|
||||
"isDraft",
|
||||
"isPrerelease",
|
||||
"name",
|
||||
"publishedAt",
|
||||
"tagName",
|
||||
"tarballUrl",
|
||||
"targetCommitish",
|
||||
"uploadUrl",
|
||||
"url",
|
||||
"zipballUrl",
|
||||
}
|
||||
|
||||
type Release struct {
|
||||
|
|
|
|||
|
|
@ -14,11 +14,34 @@ import (
|
|||
"github.com/cli/cli/v2/pkg/cmdutil"
|
||||
"github.com/cli/cli/v2/pkg/httpmock"
|
||||
"github.com/cli/cli/v2/pkg/iostreams"
|
||||
"github.com/cli/cli/v2/pkg/jsonfieldstest"
|
||||
"github.com/google/shlex"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestJSONFields(t *testing.T) {
|
||||
jsonfieldstest.ExpectCommandToSupportJSONFields(t, NewCmdView, []string{
|
||||
"apiUrl",
|
||||
"author",
|
||||
"assets",
|
||||
"body",
|
||||
"createdAt",
|
||||
"databaseId",
|
||||
"id",
|
||||
"isDraft",
|
||||
"isPrerelease",
|
||||
"name",
|
||||
"publishedAt",
|
||||
"tagName",
|
||||
"tarballUrl",
|
||||
"targetCommitish",
|
||||
"uploadUrl",
|
||||
"url",
|
||||
"zipballUrl",
|
||||
})
|
||||
}
|
||||
|
||||
func Test_NewCmdView(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue