Skip to content

Commit 4591c8b

Browse files
committed
Renamed code review feature to pull request assistant.
1 parent 9740dfa commit 4591c8b

File tree

7 files changed

+23
-19
lines changed

7 files changed

+23
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ DAIV's agent has access to a set of capabilities that make this possible:
151151
- [x] Add support to Agent Skills.
152152
- [ ] Add support to custom MCP servers.
153153
- [x] Add an evaluation system to measure the quality of DAIV's agents.
154-
- [ ] Add support to automated code review.
154+
- [ ] Add support to automated pull request review.
155155
- [ ] Create a frontend to DAIV initial setup and configuration, dashboard with some metrics, a chat interface to interact with DAIV...
156156
- [ ] Automate the onboarding of new projects into DAIV, by adding a `.daiv.yml` file to the repository.
157157

daiv/codebase/clients/github/api/callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def _is_merge_request_review(self) -> bool:
128128
Accept the webhook if the note is a merge request comment that mentions DAIV.
129129
"""
130130
return bool(
131-
self._repo_config.code_review.enabled
131+
self._repo_config.pull_request_assistant.enabled
132132
and self.issue.is_pull_request()
133133
and self.issue.state == "open"
134134
# and not self.issue.draft

daiv/codebase/clients/gitlab/api/callbacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def _is_merge_request_comment(self) -> bool:
145145
Accept the webhook if the note is a merge request comment that mentions DAIV.
146146
"""
147147
return bool(
148-
self._repo_config.code_review.enabled
148+
self._repo_config.pull_request_assistant.enabled
149149
and self.object_attributes.type is None # This is a comment note.
150150
and self.object_attributes.noteable_type == NoteableType.MERGE_REQUEST
151151
and self.object_attributes.action in [NoteAction.CREATE, NoteAction.UPDATE]

daiv/codebase/repo_config.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ class IssueAddressing(BaseModel):
3535
enabled: bool = Field(default=True, description="Enable issue addressing features.")
3636

3737

38-
class CodeReview(BaseModel):
38+
class PullRequestAssistant(BaseModel):
3939
"""
40-
Code review configuration.
40+
Pull request assistant configuration.
4141
"""
4242

43-
enabled: bool = Field(default=True, description="Enable code review features.")
43+
enabled: bool = Field(default=True, description="Enable pull request assistant features.")
4444

4545

4646
class SlashCommands(BaseModel):
@@ -210,7 +210,11 @@ class RepositoryConfig(BaseModel):
210210
slash_commands: SlashCommands = Field(
211211
default_factory=SlashCommands, description="Configure slash command features."
212212
)
213-
code_review: CodeReview = Field(default_factory=CodeReview, description="Configure code review features.")
213+
pull_request_assistant: PullRequestAssistant = Field(
214+
default_factory=PullRequestAssistant,
215+
validation_alias=AliasChoices("pull_request_assistant", "code_review"),
216+
description="Configure pull request assistant features.",
217+
)
214218
issue_addressing: IssueAddressing = Field(
215219
default_factory=IssueAddressing, description="Configure issue addressing features."
216220
)

docs/customization/repository-config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ omit_content_patterns:
1919
issue_addressing:
2020
enabled: true
2121

22-
code_review:
22+
pull_request_assistant:
2323
enabled: true
2424

2525
slash_commands:
@@ -75,7 +75,7 @@ All features are enabled by default. Disable any you don't need:
7575
issue_addressing:
7676
enabled: false
7777
78-
code_review:
78+
pull_request_assistant:
7979
enabled: false
8080
8181
slash_commands:
@@ -85,7 +85,7 @@ slash_commands:
8585
| Section | Option | Default | Description |
8686
|---------|--------|---------|-------------|
8787
| `issue_addressing` | `enabled` | `true` | [Issue Addressing](../features/issue-addressing.md) |
88-
| `code_review` | `enabled` | `true` | [Pull Request Assistant](../features/pull-request-assistant.md) |
88+
| `pull_request_assistant` | `enabled` | `true` | [Pull Request Assistant](../features/pull-request-assistant.md) |
8989
| `slash_commands` | `enabled` | `true` | [Slash Commands & Skills](../features/slash-commands.md) |
9090

9191
## Sandbox

docs/features/pull-request-assistant.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ DAIV maintains context across multiple interactions on the same pull request. Yo
7575

7676
## Configuration
7777

78-
Code review is enabled by default. To disable it, add the following to your `.daiv.yml`:
78+
The pull request assistant is enabled by default. To disable it, add the following to your `.daiv.yml`:
7979

8080
```yaml
81-
code_review:
81+
pull_request_assistant:
8282
enabled: false
8383
```

tests/unit_tests/codebase/test_config.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_get_config_from_cache(self, mock_cache):
1414
repo_id = "test_repo"
1515
cached_config = {
1616
"default_branch": "main",
17-
"code_review": {"enabled": True},
17+
"pull_request_assistant": {"enabled": True},
1818
"issue_addressing": {"enabled": True},
1919
"slash_commands": {"enabled": True},
2020
}
@@ -23,7 +23,7 @@ def test_get_config_from_cache(self, mock_cache):
2323
config = RepositoryConfig.get_config(repo_id)
2424

2525
assert config.default_branch == "main"
26-
assert config.code_review.enabled is True
26+
assert config.pull_request_assistant.enabled is True
2727
assert config.issue_addressing.enabled is True
2828
assert config.slash_commands.enabled is True
2929
mock_cache.get.assert_called_once_with(f"{CONFIGURATION_CACHE_KEY_PREFIX}{repo_id}")
@@ -35,7 +35,7 @@ def test_get_config_from_repo(self, mock_cache, mock_repo_client):
3535
mock_repo_client.get_repository.return_value.default_branch = "main"
3636
mock_repo_client.get_repository_file.return_value = """
3737
default_branch: main
38-
code_review:
38+
pull_request_assistant:
3939
enabled: true
4040
issue_addressing:
4141
enabled: true
@@ -46,7 +46,7 @@ def test_get_config_from_repo(self, mock_cache, mock_repo_client):
4646
config = RepositoryConfig.get_config(repo_id)
4747

4848
assert config.default_branch == "main"
49-
assert config.code_review.enabled is True
49+
assert config.pull_request_assistant.enabled is True
5050
assert config.issue_addressing.enabled is True
5151
assert config.slash_commands.enabled is True
5252
mock_cache.set.assert_called_once_with(
@@ -63,7 +63,7 @@ def test_get_config_with_default_values(self, mock_cache, mock_repo_client):
6363
config = RepositoryConfig.get_config(repo_id)
6464

6565
assert config.default_branch == "main"
66-
assert config.code_review.enabled is True
66+
assert config.pull_request_assistant.enabled is True
6767
assert config.issue_addressing.enabled is True
6868
assert config.slash_commands.enabled is True
6969
mock_cache.set.assert_called_once_with(
@@ -86,7 +86,7 @@ def test_get_config_with_invalid_yaml(self, mock_cache, mock_repo_client):
8686
config = RepositoryConfig.get_config(repo_id)
8787

8888
assert config.default_branch == "main"
89-
assert config.code_review.enabled is True
89+
assert config.pull_request_assistant.enabled is True
9090
assert config.issue_addressing.enabled is True
9191
assert config.slash_commands.enabled is True
9292
mock_cache.set.assert_called_once_with(
@@ -105,7 +105,7 @@ def test_get_config_with_partial_yaml(self, mock_cache, mock_repo_client):
105105
config = RepositoryConfig.get_config(repo_id)
106106

107107
assert config.default_branch == "main"
108-
assert config.code_review.enabled is True
108+
assert config.pull_request_assistant.enabled is True
109109
assert config.issue_addressing.enabled is True
110110
assert config.slash_commands.enabled is True
111111
mock_cache.set.assert_called_once_with(

0 commit comments

Comments
 (0)