Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions packages/bot/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,6 @@

### Unreleased

### 0.3.0
### 0.4.0

#### Added

- Support direct download method for code

### 0.2.3

#### Added

- Added more webhook events to `WebhookPayload` type

### 0.2.2

#### Added

- Allow `metadata` to be sent in `automa.code.propose`

### 0.2.1

* Initial release
- Initial release
8 changes: 4 additions & 4 deletions packages/bot/src/automa/bot/resources/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def download(

with self._client.stream(
"post",
"/code/download",
"/bot/code/download",
options={
**options,
"json": body,
Expand Down Expand Up @@ -202,7 +202,7 @@ def propose(self, body: CodeProposeParams, *, options: RequestOptions = {}):
diff = get_diff(path)

return self._client.post(
"/code/propose",
"/bot/code/propose",
body={
**body,
"proposal": {
Expand Down Expand Up @@ -236,7 +236,7 @@ async def download(

async with self._client.stream(
"post",
"/code/download",
"/bot/code/download",
options={
**options,
"json": body,
Expand Down Expand Up @@ -287,7 +287,7 @@ async def propose(self, body: CodeProposeParams, *, options: RequestOptions = {}
diff = await to_thread(get_diff, path)

return await self._client.post(
"/code/propose",
"/bot/code/propose",
body={
**body,
"proposal": {
Expand Down
36 changes: 18 additions & 18 deletions packages/bot/tests/resources/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_download_invalid_token(code_resource):
# Hits the API
code_resource._client._client.stream.assert_called_once_with(
"post",
"/code/download",
"/bot/code/download",
json={"task": {"id": 28, "token": "invalid"}},
headers={
"Accept": "application/json",
Expand Down Expand Up @@ -178,7 +178,7 @@ async def test_download_async_invalid_token(async_code_resource):
# Hits the API
async_code_resource._client._client.stream.assert_called_once_with(
"post",
"/code/download",
"/bot/code/download",
json={"task": {"id": 28, "token": "invalid"}},
headers={
"Accept": "application/json",
Expand Down Expand Up @@ -212,7 +212,7 @@ def test_download_missing_content_type(code_resource):
# Hits the API
code_resource._client._client.stream.assert_called_once_with(
"post",
"/code/download",
"/bot/code/download",
json={"task": {"id": 28, "token": "abcdef"}},
headers={
"Accept": "application/json",
Expand Down Expand Up @@ -250,7 +250,7 @@ async def test_download_missing_content_type_async(async_code_resource):
# Hits the API
async_code_resource._client._client.stream.assert_called_once_with(
"post",
"/code/download",
"/bot/code/download",
json={"task": {"id": 28, "token": "abcdef"}},
headers={
"Accept": "application/json",
Expand Down Expand Up @@ -287,7 +287,7 @@ def test_download_proxy(fixture_tarfile, code_resource):
# Hits the API
code_resource._client._client.stream.assert_called_once_with(
"post",
"/code/download",
"/bot/code/download",
json={"task": {"id": 28, "token": "abcdef"}},
headers={
"Accept": "application/json",
Expand Down Expand Up @@ -340,7 +340,7 @@ async def test_download_proxy_async(fixture_tarfile, async_code_resource):
# Hits the API
async_code_resource._client._client.stream.assert_called_once_with(
"post",
"/code/download",
"/bot/code/download",
json={"task": {"id": 28, "token": "abcdef"}},
headers={
"Accept": "application/json",
Expand Down Expand Up @@ -405,7 +405,7 @@ def test_propose_invalid_token(fixture_tarfile, code_resource):
# Hits the API
code_resource._client._client.request.assert_called_once_with(
"post",
"/code/propose",
"/bot/code/propose",
json={
"task": {"id": 28, "token": "abcdef"},
"proposal": {
Expand Down Expand Up @@ -441,7 +441,7 @@ async def test_propose_async_invalid_token(fixture_tarfile, async_code_resource)
# Hits the API
async_code_resource._client._client.request.assert_called_once_with(
"post",
"/code/propose",
"/bot/code/propose",
json={
"task": {"id": 28, "token": "abcdef"},
"proposal": {
Expand Down Expand Up @@ -474,7 +474,7 @@ def test_propose_proxy(fixture_tarfile, code_resource):
# Hits the API
code_resource._client._client.request.assert_called_once_with(
"post",
"/code/propose",
"/bot/code/propose",
json={
"task": {"id": 28, "token": "abcdef"},
"proposal": {
Expand Down Expand Up @@ -508,7 +508,7 @@ async def test_propose_proxy_async(fixture_tarfile, async_code_resource):
# Hits the API
async_code_resource._client._client.request.assert_called_once_with(
"post",
"/code/propose",
"/bot/code/propose",
json={
"task": {"id": 28, "token": "abcdef"},
"proposal": {
Expand Down Expand Up @@ -543,7 +543,7 @@ def test_propose_with_added_files(fixture_tarfile, code_resource):
# Hits the API
code_resource._client._client.request.assert_called_once_with(
"post",
"/code/propose",
"/bot/code/propose",
json={
"task": {"id": 28, "token": "abcdef"},
"proposal": {
Expand Down Expand Up @@ -578,7 +578,7 @@ def test_propose_with_added_files_using_add_all(fixture_tarfile, code_resource):
# Hits the API
code_resource._client._client.request.assert_called_once_with(
"post",
"/code/propose",
"/bot/code/propose",
json={
"task": {"id": 28, "token": "abcdef"},
"proposal": {
Expand Down Expand Up @@ -616,7 +616,7 @@ def test_propose_with_proposal_properties(fixture_tarfile, code_resource):
# Hits the API
code_resource._client._client.request.assert_called_once_with(
"post",
"/code/propose",
"/bot/code/propose",
json={
"task": {"id": 28, "token": "abcdef"},
"proposal": {
Expand Down Expand Up @@ -656,7 +656,7 @@ def test_propose_with_metadata(fixture_tarfile, code_resource):
# Hits the API
code_resource._client._client.request.assert_called_once_with(
"post",
"/code/propose",
"/bot/code/propose",
json={
"task": {"id": 28, "token": "abcdef"},
"proposal": {
Expand Down Expand Up @@ -698,7 +698,7 @@ def test_download_direct(fixture_git, code_resource):
# Hits the API
code_resource._client._client.stream.assert_called_once_with(
"post",
"/code/download",
"/bot/code/download",
json={"task": {"id": 28, "token": "abcdef"}},
headers={
"Accept": "application/json",
Expand Down Expand Up @@ -754,7 +754,7 @@ async def test_download_direct_async(fixture_git, async_code_resource):
# Hits the API
async_code_resource._client._client.stream.assert_called_once_with(
"post",
"/code/download",
"/bot/code/download",
json={"task": {"id": 28, "token": "abcdef"}},
headers={
"Accept": "application/json",
Expand Down Expand Up @@ -796,7 +796,7 @@ def test_propose_direct(fixture_git, code_resource):
# Hits the API
code_resource._client._client.request.assert_called_once_with(
"post",
"/code/propose",
"/bot/code/propose",
json={
"task": {"id": 28, "token": "abcdef"},
"proposal": {
Expand Down Expand Up @@ -831,7 +831,7 @@ async def test_propose_direct_async(fixture_git, async_code_resource):
# Hits the API
async_code_resource._client._client.request.assert_called_once_with(
"post",
"/code/propose",
"/bot/code/propose",
json={
"task": {"id": 28, "token": "abcdef"},
"proposal": {
Expand Down