Skip to content

Failure when updating label color #33

Description

@stkent

Initial invocation github-label -j config.json stkent/redacted worked fine.

Initial config file
[
	{
		"name": "type: bug",
		"color": "0052cc"
	},
	{
		"name": "type: clarification",
		"color": "009800"
	},
	{
		"name": "type: enhancement",
		"color": "009800"
	},
	{
		"name": "type: discussion",
		"color": "009800"
	},
	{
		"name": "status: awaiting triage",
		"color": "bfe5bf"
	},
	{
		"name": "size: small",
		"color": "bfe5bf"
	},
	{
		"name": "size: medium",
		"color": "bfe5bf"
	},
	{
		"name": "size: large",
		"color": "bfe5bf"
	},
	{
		"name": "enhancement status: accepted",
		"color": "dddddd"
	},
	{
		"name": "enhancement status: declined",
		"color": "e11d21"
	},
	{
		"name": "bug status: confirmed",
		"color": "dddddd"
	},
	{
		"name": "bug status: information needed",
		"color": "dddddd"
	},
	{
		"name": "bug status: unable to reproduce",
		"color": "dddddd"
	},
	{
		"name": "bug status: working as intended",
		"color": "dddddd"
	},
	{
		"name": "assignment status: available",
		"color": "eb6420"
	},
	{
		"name": "assignment status: reserved",
		"color": "fad8c7"
	},
	{
		"name": "development status: not started",
		"color": "dddddd"
	},
	{
		"name": "development status: in progress",
		"color": "dddddd"
	},
	{
		"name": "development status: needs review",
		"color": "dddddd"
	},
	{
		"name": "development status: in review",
		"color": "dddddd"
	},
	{
		"name": "development status: implemented",
		"color": "dddddd"
	},
	{
		"name": "development status: shipped",
		"color": "dddddd"
	},
	{
		"name": "blocked",
		"color": "fad8c7"
	},
	{
		"name": "duplicate",
		"color": "fad8c7"
	},
	{
		"name": "abandoned?",
		"color": "fad8c7"
	},
	{
		"name": "good first patch",
		"color": "fad8c7"
	}
]

I then tweaked the color of a single label (assignment status: available):

Updated config file
[
	{
		"name": "type: bug",
		"color": "0052cc"
	},
	{
		"name": "type: clarification",
		"color": "009800"
	},
	{
		"name": "type: enhancement",
		"color": "009800"
	},
	{
		"name": "type: discussion",
		"color": "009800"
	},
	{
		"name": "status: awaiting triage",
		"color": "bfe5bf"
	},
	{
		"name": "size: small",
		"color": "bfe5bf"
	},
	{
		"name": "size: medium",
		"color": "bfe5bf"
	},
	{
		"name": "size: large",
		"color": "bfe5bf"
	},
	{
		"name": "enhancement status: accepted",
		"color": "dddddd"
	},
	{
		"name": "enhancement status: declined",
		"color": "e11d21"
	},
	{
		"name": "bug status: confirmed",
		"color": "dddddd"
	},
	{
		"name": "bug status: information needed",
		"color": "dddddd"
	},
	{
		"name": "bug status: unable to reproduce",
		"color": "dddddd"
	},
	{
		"name": "bug status: working as intended",
		"color": "dddddd"
	},
	{
		"name": "assignment status: available",
		"color": "eb6440"
	},
	{
		"name": "assignment status: reserved",
		"color": "fad8c7"
	},
	{
		"name": "development status: not started",
		"color": "dddddd"
	},
	{
		"name": "development status: in progress",
		"color": "dddddd"
	},
	{
		"name": "development status: needs review",
		"color": "dddddd"
	},
	{
		"name": "development status: in review",
		"color": "dddddd"
	},
	{
		"name": "development status: implemented",
		"color": "dddddd"
	},
	{
		"name": "development status: shipped",
		"color": "dddddd"
	},
	{
		"name": "blocked",
		"color": "fad8c7"
	},
	{
		"name": "duplicate",
		"color": "fad8c7"
	},
	{
		"name": "abandoned?",
		"color": "fad8c7"
	},
	{
		"name": "good first patch",
		"color": "fad8c7"
	}
]

and invoked the same command. The tool terminated while updating that label with the following output:

[+] Updated label: "assignment status: available"
/usr/local/lib/node_modules/github-label/bin/github-label.js:124
      else if (data.color !== label.color) {
                   ^

TypeError: Cannot read property 'color' of undefined
    at /usr/local/lib/node_modules/github-label/bin/github-label.js:124:20
    at /usr/local/lib/node_modules/github-label/src/client.js:49:5
    at /usr/local/lib/node_modules/github-label/node_modules/octonode/lib/octonode/label.js:15:18
    at Request._callback (/usr/local/lib/node_modules/github-label/node_modules/octonode/lib/octonode/client.js:195:20)
    at self.callback (/usr/local/lib/node_modules/github-label/node_modules/request/request.js:373:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at Request.onRequestError (/usr/local/lib/node_modules/github-label/node_modules/request/request.js:971:8)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions