From e0d5437a5b1276f42012f786385e1760b3fd380f Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 08:56:50 +0000 Subject: [PATCH 1/6] Create sweep.yaml --- sweep.yaml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sweep.yaml diff --git a/sweep.yaml b/sweep.yaml new file mode 100644 index 000000000..e964908a4 --- /dev/null +++ b/sweep.yaml @@ -0,0 +1,46 @@ +# Sweep AI turns bugs & feature requests into code changes (https://sweep.dev) +# For details on our config file, check out our docs at https://docs.sweep.dev/usage/config + +# This setting contains a list of rules that Sweep will check for. If any of these rules are broken in a new commit, Sweep will create an pull request to fix the broken rule. +rules: +- "All docstrings and comments should be up to date." +- "Do not include large chunks of commented-out code." +- "Ensure that error logs use traceback during exceptions." +- "Avoid using `import pdb; pdb.set_trace()` in production code." +- "Remove debug logs and print statements from production code." +- "Avoid manually modifying the CHANGELOG.md file." + +# This is the branch that Sweep will develop from and make pull requests to. Most people use 'main' or 'master' but some users also use 'dev' or 'staging'. +branch: 'main' + +# By default Sweep will read the logs and outputs from your existing Github Actions. To disable this, set this to false. +gha_enabled: True + +# This is the description of your project. It will be used by sweep when creating PRs. You can tell Sweep what's unique about your project, what frameworks you use, or anything else you want. +# +# Example: +# +# description: sweepai/sweep is a python project. The main api endpoints are in sweepai/api.py. Write code that adheres to PEP8. +description: '' + +# This sets whether to create pull requests as drafts. If this is set to True, then all pull requests will be created as drafts and GitHub Actions will not be triggered. +draft: False + +# This is a list of directories that Sweep will not be able to edit. +blocked_dirs: [] + +# This is a list of documentation links that Sweep will use to help it understand your code. You can add links to documentation for any packages you use here. +# +# Example: +# +# docs: +# - PyGitHub: ["https://pygithub.readthedocs.io/en/latest/", "We use pygithub to interact with the GitHub API"] +docs: [] + +# Sandbox executes commands in a sandboxed environment to validate code changes after every edit to guarantee pristine code. For more details, see the [Sandbox](./sandbox) page. +sandbox: + install: + - trunk init + check: + - trunk fmt {file_path} + - trunk check --fix --print-failures {file_path} From 225a8f28fa70ed6a6f726461159204d2dab98a1d Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 08:56:50 +0000 Subject: [PATCH 2/6] Create sweep template --- .github/ISSUE_TEMPLATE/sweep-template.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/sweep-template.yml diff --git a/.github/ISSUE_TEMPLATE/sweep-template.yml b/.github/ISSUE_TEMPLATE/sweep-template.yml new file mode 100644 index 000000000..98811de19 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/sweep-template.yml @@ -0,0 +1,14 @@ +name: Sweep Issue +title: 'Sweep: ' +description: For small bugs, features, refactors, and tests to be handled by Sweep, an AI-powered junior developer. +labels: sweep +body: + - type: textarea + id: description + attributes: + label: Details + description: Tell Sweep where and what to edit and provide enough context for a new developer to the codebase + placeholder: | + Bugs: The bug might be in ... file. Here are the logs: ... + Features: the new endpoint should use the ... class from ... file because it contains ... logic. + Refactors: We are migrating this function to ... version because ... From bd826ffb7d60a38c27488aa517eefd358c047ec3 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 09:10:23 +0000 Subject: [PATCH 3/6] feat: Updated sweep.yaml --- sweep.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/sweep.yaml b/sweep.yaml index e964908a4..cb8dbbadb 100644 --- a/sweep.yaml +++ b/sweep.yaml @@ -6,7 +6,6 @@ rules: - "All docstrings and comments should be up to date." - "Do not include large chunks of commented-out code." - "Ensure that error logs use traceback during exceptions." -- "Avoid using `import pdb; pdb.set_trace()` in production code." - "Remove debug logs and print statements from production code." - "Avoid manually modifying the CHANGELOG.md file." From 7e8c43c396d4b5a4cb2ee0a799b66b1338482628 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 09:13:02 +0000 Subject: [PATCH 4/6] feat: Updated sweep.yaml --- sweep.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sweep.yaml b/sweep.yaml index cb8dbbadb..0f4691d80 100644 --- a/sweep.yaml +++ b/sweep.yaml @@ -20,7 +20,7 @@ gha_enabled: True # Example: # # description: sweepai/sweep is a python project. The main api endpoints are in sweepai/api.py. Write code that adheres to PEP8. -description: '' +description: 'boostercloud/booster is a Typescript monorepo managed with Microsoft Rust. All the packages can be found in the packages folder. Each page has a "src" folder with the source code and a "test" folder with tests implemented with mocha' # This sets whether to create pull requests as drafts. If this is set to True, then all pull requests will be created as drafts and GitHub Actions will not be triggered. draft: False From 3a51bce3ba92f5857c0f1c627786e32bd3a1a8c3 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 09:14:14 +0000 Subject: [PATCH 5/6] feat: Updated sweep.yaml --- sweep.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sweep.yaml b/sweep.yaml index 0f4691d80..f21c3bb56 100644 --- a/sweep.yaml +++ b/sweep.yaml @@ -34,7 +34,7 @@ blocked_dirs: [] # # docs: # - PyGitHub: ["https://pygithub.readthedocs.io/en/latest/", "We use pygithub to interact with the GitHub API"] -docs: [] +docs: ["https://docs.boostercloud.com"] # Sandbox executes commands in a sandboxed environment to validate code changes after every edit to guarantee pristine code. For more details, see the [Sandbox](./sandbox) page. sandbox: From 8d8f86fcc45e2a018395514acdae1cf2c5222fb6 Mon Sep 17 00:00:00 2001 From: Javier Toledo Date: Mon, 16 Oct 2023 10:16:15 +0100 Subject: [PATCH 6/6] Apply suggestions from code review --- sweep.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sweep.yaml b/sweep.yaml index f21c3bb56..d41e672f0 100644 --- a/sweep.yaml +++ b/sweep.yaml @@ -7,7 +7,9 @@ rules: - "Do not include large chunks of commented-out code." - "Ensure that error logs use traceback during exceptions." - "Remove debug logs and print statements from production code." -- "Avoid manually modifying the CHANGELOG.md file." +- "All the business logic in the 'src' folder for each package should have the corresponding unit tests in the 'test' folder in the same package." +- "Avoid 'any' types when possible." +- "If there's a simpler way to express a type, it should be used." # This is the branch that Sweep will develop from and make pull requests to. Most people use 'main' or 'master' but some users also use 'dev' or 'staging'. branch: 'main'