Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Integration of Azure DevOps Client Adapter with BaseGithubClient #761

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ahmetkca
Copy link
Contributor

Description

This pull request introduces the AzureDevOpsAdapter, an innovative class designed to seamlessly interact with Azure DevOps repositories. By leveraging the azure-devops package, this adapter extends the functionality of the existing BaseGithubClient, enabling the same codebase to be compatible with both GitHub and Azure DevOps repositories.

Key Features:

  • Unified Interface: The adapter maintains consistency with BaseGithubClient methods, ensuring a familiar interface for users transitioning between GitHub and Azure DevOps.
  • Response Model Conversion: Azure DevOps specific response models are adeptly converted to their GitHub counterparts, ensuring data uniformity and ease of use.
  • Essential Error Handling: Comprehensive error handling is implemented, including ImportError for missing packages and ValueError for mandatory parameters like base_url, username, and password.

Motivation and Context:
The motivation behind this pull request is to enhance the versatility and scope of the llama_hub project by incorporating support for Azure DevOps repositories. This integration allows users to interact with Azure DevOps in a manner similar to GitHub, facilitating a broader range of repository management tasks within a single framework.

Dependencies:
This change introduces a dependency on the azure-devops Python package. Users will need to install this package to utilize the Azure DevOps functionalities provided by the AzureDevOpsAdapter.

Additional Changes:

  • Modifications in llama_index.readers.base and related files to accommodate the new Azure DevOps adapter.
  • Inclusion of environment variable setup for Azure DevOps credentials in the usage examples.
  • Refinement in the handling of blob data encoding, with support for both base64 and utf-8 encodings.
  • Minor adjustments in the GithubRepositoryReader to align with the new adapter's functionality.

Fixes # (issue)

Type of Change

Please delete options that are not relevant.

  • New Loader/Tool
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • I stared at the code and made sure it makes sense
  • Manually run it and made sure it works

Suggested Checklist:

  • I have added a library.json file if a new loader/tool was added
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran make format; make lint to appease the lint gods

@ahmetkca ahmetkca marked this pull request as ready for review December 12, 2023 14:47
GitTreeResponseModel,
)

from azure.devops.v7_0.git.git_client import GitClient
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please move these import inside the class to avoid any build failing scenario

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi anoop, how can these imports cause build failure. I was able to run it. Is there a way to build it locally? if so, how can I do it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi, if you check the other loaders they also follow lazy importing libraries.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants