Skip to content

Commit

Permalink
add invididual user support for github issue label
Browse files Browse the repository at this point in the history
  • Loading branch information
anGie44 authored and Jeremy Udit committed Sep 4, 2020
1 parent d217f5c commit cab603f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
17 changes: 1 addition & 16 deletions github/resource_github_issue_label.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ func resourceGithubIssueLabel() *schema.Resource {
// same function for two schema funcs.

func resourceGithubIssueLabelCreateOrUpdate(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

client := meta.(*Owner).v3client
orgName := meta.(*Owner).name
repoName := d.Get("repository").(string)
Expand Down Expand Up @@ -148,11 +143,6 @@ func resourceGithubIssueLabelCreateOrUpdate(d *schema.ResourceData, meta interfa
}

func resourceGithubIssueLabelRead(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

client := meta.(*Owner).v3client
repoName, name, err := parseTwoPartID(d.Id(), "repository", "name")
if err != nil {
Expand Down Expand Up @@ -194,11 +184,6 @@ func resourceGithubIssueLabelRead(d *schema.ResourceData, meta interface{}) erro
}

func resourceGithubIssueLabelDelete(d *schema.ResourceData, meta interface{}) error {
err := checkOrganization(meta)
if err != nil {
return err
}

client := meta.(*Owner).v3client

orgName := meta.(*Owner).name
Expand All @@ -207,7 +192,7 @@ func resourceGithubIssueLabelDelete(d *schema.ResourceData, meta interface{}) er
ctx := context.WithValue(context.Background(), ctxId, d.Id())

log.Printf("[DEBUG] Deleting label: %s (%s/%s)", name, orgName, repoName)
_, err = client.Issues.DeleteLabel(ctx,
_, err := client.Issues.DeleteLabel(ctx,
orgName, repoName, name)
return err
}
12 changes: 0 additions & 12 deletions github/resource_github_issue_label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import (
)

func TestAccGithubIssueLabel_basic(t *testing.T) {
if err := testAccCheckOrganization(); err != nil {
t.Skipf("Skipping because %s.", err.Error())
}

var label, updatedLabel github.Label

rn := "github_issue_label.test"
Expand Down Expand Up @@ -52,10 +48,6 @@ func TestAccGithubIssueLabel_basic(t *testing.T) {
}

func TestAccGithubIssueLabel_existingLabel(t *testing.T) {
if err := testAccCheckOrganization(); err != nil {
t.Skipf("Skipping because %s.", err.Error())
}

var label github.Label

rn := "github_issue_label.test"
Expand Down Expand Up @@ -84,10 +76,6 @@ func TestAccGithubIssueLabel_existingLabel(t *testing.T) {
}

func TestAccGithubIssueLabel_description(t *testing.T) {
if err := testAccCheckOrganization(); err != nil {
t.Skipf("Skipping because %s.", err.Error())
}

var label github.Label

rn := "github_issue_label.test"
Expand Down

0 comments on commit cab603f

Please sign in to comment.