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

Initial implementation of CodeCommit (second attempt) #235

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

pzarfos
Copy link
Contributor

@pzarfos pzarfos commented Aug 22, 2023

Description

This PR adds an initial implementation of AWS CodeCommit. (see issue #138)

This will run the pr-agent CLI in "review" mode, and it posts the AI generated comment to your CodeCommit PR. (see the setup instructions at the bottom of INSTALL.md file)

This implementation adds PR review capabilities as a first step... more features can be added based on usage and demand.

Notes

  • This is the second attempt at this PR. The first PR was Initial implementation of CodeCommit #232, but PR 232 failed unit tests. Thank goodness for the unit tests... the get_pr_description_full method was added to git_provider class in a PR that was merged just before PR 232. I changed my CodeCommitProvider class to implement the new get_pr_description_full method and unit tests are passing now.
  • I tested the new code on one of my CodeCommit repos and it does successfully post a PR review.

Changes

  • added boto3 to the requirements.txt and pyproject.toml files
  • added CodeCommitProvider to the pr_agent/git_providers/__init__.py file
  • 2 files added in pr_agent/git_providers
    • codecommit_provider.py
      • class derived from GitProvider interface, which implements the bulk of the provider functionality for CodeCommit
      • I based this on parts of the git_provider.py, bitbucket_provider.py, and local_git_provider.py, with customizations specific for CodeCommit
      • CodeCommit does not have as many features as GitHub... for example the percentages of languages used, so I had to calculate the languages manually... and there are some static methods at the bottom of the file to do that, which we could move into common util methods
    • codecommit_client.py
      • This class is a wrapper around the AWS boto3 SDK, to keep the codecommit_provider.py cleaner
      • Technically this is not a provider class, but I left it in with the git_providers so as not start building out new directory structures to hold one extra file... this can be moved later
  • 2 files added in tests/unittest, for testing the above classes
    • test_codecommit_client.py
    • test_codecommit_provider.py
  • added a "CodeCommit" column to the functionality table in README.md
  • added a "AWS CodeCommit Setup" section to INSTALL.md

@okotek okotek merged commit f2ab623 into Codium-ai:main Aug 22, 2023
2 checks passed
@pzarfos pzarfos deleted the issue_138_codecommit_pr_2 branch August 22, 2023 22:07
yochail pushed a commit to yochail/pr-agent that referenced this pull request Feb 11, 2024
Initial implementation of CodeCommit (second attempt)
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.

None yet

2 participants