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 comments object #355

Merged
merged 4 commits into from Mar 22, 2022
Merged

Add comments object #355

merged 4 commits into from Mar 22, 2022

Conversation

alex-ikse
Copy link
Contributor

@alex-ikse alex-ikse commented Mar 9, 2022

Description

Adding "comments" object/endpoint to create, list and read run comments

Testing plan

// Create a context
ctx := context.Background()

run, err := client.Runs.Read(ctx, "run-xxxxxxxxxxxx")
if err != nil {
	log.Fatal(err)
}

commentCreateOptions := tfe.CommentCreateOptions{
	Body: tfe.String("Test from fork of go-tfe v3"),
}
comm, err := client.Comments.Create(ctx, run.ID, commentCreateOptions)
if err != nil {
	log.Fatal(err)
}

fmt.Printf("Comm ID created: %s\n", comm.ID)

commRead, err := client.Comments.Read(ctx, comm.ID)
if err != nil {
	log.Fatal(err)
}
fmt.Printf("Body: %s\n", commRead.Body)

External links

Documentation about Comment doesn't exist right now

Output from tests (HashiCorp employees only)

$ TFE_ADDRESS="https://example" TFE_TOKEN="example" TF_ACC="1" go test ./... -v -tags=integration -run TestFunctionsAffectedByChange

...

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@sebasslash sebasslash left a comment

Overall, looks great 👍 There's a few things needing to be changed due to some patterns we've established for the upcoming 1.0 release.

comment.go Outdated Show resolved Hide resolved
comment.go Outdated Show resolved Hide resolved
comment.go Outdated Show resolved Hide resolved
@alex-ikse alex-ikse requested a review from sebasslash Mar 16, 2022
sebasslash
sebasslash previously approved these changes Mar 17, 2022
Copy link
Contributor

@sebasslash sebasslash left a comment

The Force is ssstrong with this one 🔥

@sebasslash sebasslash changed the base branch from releases-1.0.x to main Mar 21, 2022
@sebasslash sebasslash dismissed their stale review Mar 21, 2022

The base branch was changed.

@alex-ikse alex-ikse requested a review from sebasslash Mar 22, 2022
Copy link
Contributor

@sebasslash sebasslash left a comment

Only the Sith deal in branch protections!

@sebasslash sebasslash merged commit 6504557 into hashicorp:main Mar 22, 2022
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants