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

feat!: Add support for creating GitHub App with organizations #3222

Merged
merged 8 commits into from
Jul 29, 2024

Conversation

wenked
Copy link
Contributor

@wenked wenked commented Jul 29, 2024

Fixes: #3210.

BREAKING CHANGE: The CreateApp function now requires two arguments: AppManifest and orgName, to support creating apps with organizations.

The issue occurred because the create app URL path was only set up for creating personal GitHub apps.

My solution was to add an additional argument to the function to provide the necessary information for creating organizational GitHub Apps. The second argument, AppConfig, now includes configuration structs with an OwnerType that can be either personal or organizational, and you can provide the organization name by passing OrgName in the AppConfig struct.

For more details, see the issue: #3210.

Copy link

google-cla bot commented Jul 29, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @wenked !
Please address the few minor comments.

@willnorris - since this involves scrape, do you have any comments or concerns regarding the breaking change in this PR?

scrape/scrape.go Outdated Show resolved Hide resolved
scrape/apps.go Outdated Show resolved Hide resolved
scrape/apps.go Outdated Show resolved Hide resolved
scrape/apps.go Outdated Show resolved Hide resolved
scrape/apps.go Outdated Show resolved Hide resolved
@gmlewis
Copy link
Collaborator

gmlewis commented Jul 29, 2024

We'll see what @willnorris says, but we could alternatively have a second ...ForOrgs method if the breaking API change is unwanted.

@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). labels Jul 29, 2024
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.94%. Comparing base (2b8c7fa) to head (d6cf6fa).
Report is 89 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3222      +/-   ##
==========================================
- Coverage   97.72%   92.94%   -4.78%     
==========================================
  Files         153      171      +18     
  Lines       13390    11633    -1757     
==========================================
- Hits        13085    10812    -2273     
- Misses        215      727     +512     
- Partials       90       94       +4     

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

Copy link
Collaborator

@willnorris willnorris left a comment

Choose a reason for hiding this comment

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

I don't have any sense on who is using this package (not many people, looking at pkg.go.dev), so I don't have strong feelings either way on the change. looks fine to me.

scrape/apps.go Outdated Show resolved Hide resolved
@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Jul 29, 2024
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @wenked !
LGTM.
Merging.

@gmlewis gmlewis merged commit f8929b8 into google:master Jul 29, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for GitHub App Manifest flow on Organization, not User
3 participants