Skip to content

Conversation

@hamir-suspect
Copy link
Contributor

@hamir-suspect hamir-suspect commented Oct 9, 2025

πŸ“ Description

Allows service account to create a project with github_app type of integration and returs better errors for oauth integrations. Adressing #632

βœ… Checklist

  • I have tested this change
  • This change requires documentation update

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables service accounts to create projects with GitHub App integrations while preventing them from using OAuth integrations. The changes add proper validation to block service accounts from using OAuth tokens and provide clear error messages when this is attempted.

Key changes:

  • Added service account detection logic to prevent OAuth token usage
  • Implemented special permission handling for service accounts with GitHub App integration
  • Enhanced test coverage with mocks for user client describe functionality

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
repository_hub/lib/repository_hub/adapters/github/create_action.ex Added service account support for GitHub App integration with admin permissions
repository_hub/lib/repository_hub/adapters/github_adapter.ex Added OAuth token validation to block service accounts
repository_hub/lib/repository_hub/adapters/gitlab_adapter.ex Added OAuth token validation to block service accounts
repository_hub/lib/repository_hub/adapters/bitbucket_adapter.ex Added OAuth token validation to block service accounts
repository_hub/lib/internal_api/user.pb.ex Added SERVICE_ACCOUNT enum value for user creation source
repository_hub/test/repository_hub/adapters/github/create_action_test.exs Added tests for service account behavior with different integration types
repository_hub/test/repository_hub/adapters/github/list_accessible_repositories_action_test.exs Added describe mock for user client testing
repository_hub/test/support/factories/git_clients/gitlab_client_factory.ex Added user client mocks for testing
repository_hub/test/support/factories/git_clients/bitbucket_client_factory.ex Added user client mocks for testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

skipi
skipi previously approved these changes Oct 10, 2025
@hamir-suspect hamir-suspect enabled auto-merge (squash) October 10, 2025 12:56
@hamir-suspect hamir-suspect merged commit 3ae2a00 into main Oct 10, 2025
2 checks passed
@hamir-suspect hamir-suspect deleted the has/service-account-project-create branch October 10, 2025 12:58
hamir-suspect added a commit that referenced this pull request Oct 10, 2025
## πŸ“ Description
Allows service account to create a project with `github_app` type of
integration and returs better errors for `oauth` integrations. Adressing
#632

## βœ… Checklist
- [x] I have tested this change
- [ ] This change requires documentation update
hamir-suspect added a commit that referenced this pull request Oct 10, 2025
…#643)

## πŸ“ Description
Allows service account to create a project with `github_app` type of
integration and returs better errors for `oauth` integrations. Adressing
#632

## βœ… Checklist
- [x] I have tested this change
- [ ] This change requires documentation update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

5 participants