This pull request includes changes to the following files:
sweepai/api.py
sweepai/config/server.py
sweepai/utils/github_utils.py
Summary
In sweepai/api.py:
Changed the method of getting labels from the GitLab repository.
Instead of using repo.get_labels(), now using repo.labels.list().
Updated the code to create a new label if it doesn't exist using repo.labels.create().
In sweepai/config/server.py:
Updated the environment variable name for the GitLab app PEM to GITLAB_APP_PEM.
Added a placeholder value for the GitLab app PEM if not provided in the environment variables.
Updated the environment variable name for the GitLab app ID to GITLAB_APP_ID.
Added a placeholder value for the GitLab app ID if not provided in the environment variables.
Updated the environment variable name for the GitLab app secret to GITLAB_APP_SECRET.
Added a placeholder value for the GitLab app secret if not provided in the environment variables.
Updated the environment variable name for the GitLab redirect URI to GITLAB_REDIRECT_URI.
Added a placeholder value for the GitLab redirect URI if not provided in the environment variables.
In sweepai/utils/github_utils.py:
Updated the import statement for the GitLab client from gitlab.Gitlab to from gitlab import Gitlab.
Updated the return type of the get_gitlab_client function to Gitlab instead of gitlab.Gitlab.
Updated the clone_url method to use the http_url_to_repo property of the GitLab project.
Added an environment variable GIT_SSL_NO_VERIFY with a value of 'true' to the clone method to bypass SSL verification when cloning the repository.
Fixes #39.
🎉 Latest improvements to Sweep:
We just released a dashboard to track Sweep's progress on your issue in real-time, showing every stage of the process – from search to planning and coding.
Sweep uses OpenAI's latest Assistant API to plan code changes and modify code! This is 3x faster and significantly more reliable as it allows Sweep to edit code and validate the changes in tight iterations, the same way as a human would.
[ ] Apply: We should use loguru for error logging. If the log is inside an exception, use logger.exception to add tracebacks, where logger is imported from loguru. Use f-strings for string formatting in logger calls.
[ ] Apply: There should be no debug log or print statements in production code.
[ ] Apply: All functions should have parameters and output annotated with type hints. Use list, tuple and dict instead of typing.List, typing.Tuple and typing.dict.
[ ] Apply: Leftover TODOs in the code should be handled.
[ ] Apply: All new business logic should have corresponding unit tests in the same directory. For example, sweepai/api_test.py tests sweepai/api.py. Use unittest and unittest.mock as required.
[ ] Apply: Any clearly inefficient or repeated code should be optimized or refactored.
[ ] Apply: Remove any comments before code that are obvious. For example # this prints hello world; print('hello world').
PR Feedback (click)
Description
This pull request includes changes to the following files:
Summary
In
sweepai/api.py
:repo.get_labels()
, now usingrepo.labels.list()
.repo.labels.create()
.In
sweepai/config/server.py
:GITLAB_APP_PEM
.GITLAB_APP_ID
.GITLAB_APP_SECRET
.GITLAB_REDIRECT_URI
.In
sweepai/utils/github_utils.py
:gitlab.Gitlab
tofrom gitlab import Gitlab
.get_gitlab_client
function toGitlab
instead ofgitlab.Gitlab
.clone_url
method to use thehttp_url_to_repo
property of the GitLab project.GIT_SSL_NO_VERIFY
with a value of'true'
to theclone
method to bypass SSL verification when cloning the repository.Fixes #39.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: