Skip to content

feat: Add enterprise app installation lookup#4230

Open
danyalahmed1995 wants to merge 1 commit into
google:masterfrom
danyalahmed1995:add-enterprise-app-installation
Open

feat: Add enterprise app installation lookup#4230
danyalahmed1995 wants to merge 1 commit into
google:masterfrom
danyalahmed1995:add-enterprise-app-installation

Conversation

@danyalahmed1995
Copy link
Copy Markdown

@danyalahmed1995 danyalahmed1995 commented May 16, 2026

Summary

Adds support for looking up a GitHub App installation for an enterprise.

This implements the new AppsService.FindEnterpriseInstallation helper for:

GET /enterprises/{enterprise}/installation

The method follows the existing app installation lookup pattern already used for organization, repository, and user installations.

Details

  • Added FindEnterpriseInstallation(ctx, enterprise) to AppsService
  • Uses the enterprise installation endpoint:
    • GET /enterprises/{enterprise}/installation
  • Reuses the existing Installation model
  • Keeps the implementation aligned with the existing installation lookup helpers
  • Adds coverage for:
    • successful enterprise installation lookup
    • bad options handling
    • request/do failure handling

Testing

gofmt -w github/apps.go github/apps_test.go
go test ./github -run 'Apps|Installation'
go test ./...

All tests passed locally.

Fixes #4212

@gmlewis gmlewis changed the title github: add enterprise app installation lookup feat: Add enterprise app installation lookup May 16, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.45%. Comparing base (b0245f1) to head (43b1593).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4230   +/-   ##
=======================================
  Coverage   97.45%   97.45%           
=======================================
  Files         189      189           
  Lines       19152    19154    +2     
=======================================
+ Hits        18665    18667    +2     
  Misses        270      270           
  Partials      217      217           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label May 16, 2026
Comment thread github/apps.go
return s.getInstallation(ctx, fmt.Sprintf("orgs/%v/installation", org))
}

// FindEnterpriseInstallation finds the enterprise's installation information.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The GitHub API docs call this "Get an enterprise installation for the authenticated app" so instead of "FindEnterpriseInstallation", can we use "GetEnterpriseInstallation"?

Wow... I see all the other ones in this file are called "Find*"... I'm not sure how I let that one slide by in code reviews. 😞

OK, let's take this to a vote from our dedicated team of reviewers... which do you like best?

  • Option A: Just name this one endpoint "GetEnterpriseInstallation"
  • Option B: Leave this one endpoint "FindEnterpriseInstallation"
  • Option C: Rename (breaking API change) ALL methods whose documentation URL starts with "get-" to "Get*" instead of "Find*" in this file
  • Option D: Something else?

cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I vote for Option C.
Because in my opinion, method needs to be consistent with GitHub API docs.

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

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for getting a GitHub App enterprise installation

3 participants