Skip to content

PM-5996 orgs search - #333

Merged
vas3a merged 2 commits into
developfrom
PM-5996_orgs-search
Aug 28, 2026
Merged

PM-5996 orgs search#333
vas3a merged 2 commits into
developfrom
PM-5996_orgs-search

Conversation

@vas3a

@vas3a vas3a commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces a significant change to how Gitea team searches are performed and configured, shifting from a static, environment-configured list of organizations to dynamically searching only the organizations the signed-in user belongs to (including private organizations). It also introduces a new caching mechanism for these organization lookups, improves the API endpoint and documentation, and refactors related tests and configuration code.

Key changes:

Gitea Team Search Functionality

  • Added a new service (GiteaTeamSearchService) that searches Gitea teams only within the organizations the signed-in user belongs to (public and private), mapping the user to their Gitea account by handle or email, and memoizing organization lookups per user for performance. The search returns nothing if the user has no Gitea account or belongs to no organizations.
  • Updated the controller endpoint from /gitea/teams to /reviews/gitea/teams and refactored it to use the new service, passing the signed-in user context and updating documentation to reflect the new behavior. [1] [2] [3]

Configuration and Environment

  • Removed the static GITEA_ORGANIZATIONS environment variable and related code, and introduced a new GITEA_ORGANIZATIONS_CACHE_TTL_MS environment variable to control how long a user's organizations are cached (default 5 minutes). Updated documentation and .env.sample accordingly. [1] [2] [3] [4]

Testing

  • Added comprehensive tests for the new GiteaTeamSearchService, covering user mapping, caching, error handling, and edge cases.
  • Refactored existing GiteaService.searchTeams tests to decouple them from the removed static organization configuration. [1] [2] [3] [4] [5] [6]

@vas3a
vas3a merged commit f95426a into develop Aug 28, 2026
5 checks passed
@vas3a
vas3a deleted the PM-5996_orgs-search branch August 28, 2026 04:30
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