8000 Add fields to githubAppInstallation by jpadrianoGo · Pull Request #1143 · hashicorp/go-tfe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add fields to githubAppInstallation #1143

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jpadrianoGo
Copy link
Contributor

Description

This PR adds fields of GHAInstallation. GHAInstallation now parses IconUrl, InstallationType, and InstallationURL.

The change aims to be part of automating notification configuration management for workspaces. This aligns with API's NotificationConfiguration return for List, Create, Read, Update, and Verify operations.

curl
--header "Authorization: Bearer $TOKEN"
--request GET
--data @payload.json
https://app.terraform.io/api/v2/github-app/installations

{"data":[{"id":"ghain-","type":"github-app-installations","attributes":{"name":"","installation-id":,"icon-url":"https://avatars.githubusercontent.com/u/?v=4","installation-type":"User","installation-url":"https://github.com/settings/installations/***"}}]}

Existing function TestGHAInstallationRead is updated to include new fields.

Testing plan

  1. Generate the required environment variables for go test, TFE_ADDRESS, TFE_TOKEN, and GITHUB_APP_INSTALLATION_ID

  2. Run TFE_ADDRESS="https://example" TFE_TOKEN="example" GITHUB_APP_INSTALLATION_ID="ghain-***" go test -run TestGHAInstallation -v. The new tests should pass.

  3. IconUrl, InstallationType, and InstallationURL is read for GHAInstallation.

  4. Generate the required environment variables for go test, TFE_ADDRESS, TFE_TOKEN, and GITHUB_APP_INSTALLATION_ID

  5. Run TFE_ADDRESS="https://example" TFE_TOKEN="example" GITHUB_APP_INSTALLATION_ID="ghain-***" go test -run TestGHAInstallationList -v. The new tests should pass.

  6. IconUrl, InstallationType, and InstallationURL is read for GHAInstallation.

External links

Output from tests

Including output from tests may require access to a TFE instance. Ignore this se 8000 ction if you have no environment to test against.

$ TFE_ADDRESS="https://example" TFE_TOKEN="example"  GITHUB_APP_INSTALLATION_ID="ghain-***"  go test -run TestGHAInstallationRead -v
=== RUN   TestGHAInstallationRead
=== RUN   TestGHAInstallationRead/when_installation_id_exists
--- PASS: TestGHAInstallationRead (1.54s)
    --- PASS: TestGHAInstallationRead/when_installation_id_exists (0.42s)
PASS
ok      github.com/hashicorp/go-tfe     1.613s

$ TFE_ADDRESS="https://example" TFE_TOKEN="example"  GITHUB_APP_INSTALLATION_ID="ghain-***"  go test -run TestGHAInstallationList -v
=== RUN   TestGHAInstallationList
=== RUN   TestGHAInstallationList/without_list_options
--- PASS: TestGHAInstallationList (1.70s)
    --- PASS: TestGHAInstallationList/without_list_options (0.43s)
PASS
ok      github.com/hashicorp/go-tfe     1.791s

@jpadrianoGo jpadrianoGo requested a review from a team as a code owner June 21, 2025 04:38
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.

1 participant
0