Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Project Card Support #460

Merged
merged 1 commit into from
Nov 23, 2020
Merged

Add Project Card Support #460

merged 1 commit into from
Nov 23, 2020

Conversation

jcudit
Copy link
Contributor

@jcudit jcudit commented May 15, 2020

@ghost ghost added size/XL Type: Documentation Improvements or additions to documentation labels May 15, 2020
@jcudit jcudit requested a review from anGie44 May 15, 2020 03:37
@jcudit jcudit marked this pull request as ready for review May 15, 2020 03:37
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! just a couple comments for review

website/github.erb Outdated Show resolved Hide resolved
github/resource_github_project_column.go Outdated Show resolved Hide resolved
website/docs/r/project_card.html.markdown Outdated Show resolved Hide resolved
Update: resourceGithubProjectCardUpdate,
Delete: resourceGithubProjectCardDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll need a custom import fn to set the card_id

Note: updatedNote,
}),
),
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll need an ImportStep here to verify but I believe the resource's Importer func will need an update as well

@jcudit
Copy link
Contributor Author

jcudit commented May 16, 2020

The following acceptance test failure was introduced:

--- FAIL: TestAccGithubProjectCard_basic (13.38s)
    testing.go:654: Step 2 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) {
        }
        
        
        (map[string]string) (len=1) {
         (string) (len=9) "column_id": (string) (len=7) "9220014"
        }
        
FAIL
FAIL	github.com/terraform-providers/terraform-provider-github/github	13.397s
FAIL

Not sure if this is a good candidate for ImportStateVerifyIgnore or if I have done something wrong with the import configuration.

@jcudit
Copy link
Contributor Author

jcudit commented May 16, 2020

@anGie44 this is ready for review again after addressing your feedback. I ended up using ImportStateVerifyIgnore to work around this error. Let me know if you have any other ideas.

@jcudit jcudit requested a review from anGie44 May 16, 2020 15:29
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @jcudit! just added some comments addressing the import behavior. lmk what you think as well

}

d.Set("note", card.GetNote())
d.Set("column_id", columnID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this assignment is where the import step is failing b/c here columnID is an int64 while the schema is expecting a String so the field doesn't get populated.if you pass the string from L96, it should work as expected

github/resource_github_project_card.go Show resolved Hide resolved
@jcudit jcudit requested a review from anGie44 May 30, 2020 21:52
@jcudit jcudit added this to the v2.9.0 milestone May 30, 2020
Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

Output of acceptance test:

--- PASS: TestAccGithubProjectCard_basic (15.18s)

@jcudit jcudit modified the milestones: v2.9.0, v2.10.0 Jun 3, 2020
@jcudit jcudit modified the milestones: v2.10.0, v3.1.0 Jul 10, 2020
@anGie44 anGie44 modified the milestones: v3.1.0, v3.0.0, v3.2.0 Jul 31, 2020
@jcudit jcudit force-pushed the github_repository_project_card branch from f0bf351 to 7586306 Compare November 23, 2020 17:03
@ghost ghost added size/L and removed size/XL labels Nov 23, 2020
@jcudit
Copy link
Contributor Author

jcudit commented Nov 23, 2020

Rebased this and added passing tests.

@jcudit jcudit merged commit e9dc4e7 into master Nov 23, 2020
@jcudit jcudit deleted the github_repository_project_card branch November 23, 2020 17:09
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New resource size/L Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add Support for Repository Project Cards
2 participants