Skip to content

Combined github services

Composing together services related to github.

I.e., Combining parsing services (that interacts with github api, file parsing, and databse) with the github search services (that interacts with qdrant and the database).

2024-12-12 -- Ideally, this is where an event bus and message passing should be used instead. I.e., the individual services should be able to communicate with each other and coordinate via message passing, but for now we'll just use this to coordinate actions between the services.

Remove a github repository from the search database.

PARAMETER DESCRIPTION
github_parsing_uow

Unit of work for the database operations.

TYPE: AbstractGithubParsingUnitOfWork

github_search_uow

Unit of work for github searching (i.e. qdrant parts).

TYPE: GithubSearchUOW

repo_id

The id of the repository to be removed.

TYPE: RepoID

user_id

ID of user for this repository (or None if it's a public repo).

TYPE: UserID | Literal['public']

wait

Whether to wait for the qdrant vectorization to finish before returning.

TYPE: bool DEFAULT: False

RETURNS DESCRIPTION
tuple[list[ParsedGithubFile], UpdateResult]

The status of the deletion.

First time setup for a github repository to be searched.

I.e., loads whole repo, vectorizes all (or specific subset) of files and adds them to the database and qdrant vectorstore.

PARAMETER DESCRIPTION
github_parsing_uow

Unit of work for combined GitHub adapter/parsing/database operations.

TYPE: AbstractGithubParsingUnitOfWork

github_search_uow

Unit of work for github searching (i.e. qdrant parts).

TYPE: GithubSearchUOW

repo_id

The id of the repository to be initialized.

TYPE: RepoID

user_id

ID of user for this repository (or None if it's a public repo).

TYPE: UserID | Literal['public']

wait

Whether to wait for the qdrant vectorization to finish before returning.

TYPE: bool DEFAULT: False

as_repo_id

If provided, replace the repo_id with this value in the database.

TYPE: RepoID | None DEFAULT: None

RETURNS DESCRIPTION
tuple[UpdateStatus, list[ParsedGithubFile]]

Tuple of status and parsed github files: The files that were saved to the main database. Note: Data is further chunked before adding to qdrant.

Update an already initialized github repository for search.

I.e., find any changes from new commits, and update database and vectorstore entries accordingly.