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

Merge v0.3.1 #528

Merged
merged 27 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e3758c9
Merge pull request #344 from PinguApps/main
pingu2k4 Oct 20, 2024
1299f73
added PR labelling action, and updated release drafter / PR template
pingu2k4 Oct 21, 2024
22a3772
added meta label and category
pingu2k4 Oct 21, 2024
10670e1
Swapped to a different format of labels, and changed running type of …
pingu2k4 Oct 21, 2024
3d83b29
Update actions/cache digest to 6849a64
renovate[bot] Oct 22, 2024
d92d013
Merge pull request #514 from PinguApps/renovate/actions-cache-digest
pingu2k4 Oct 22, 2024
e4f2f3e
reverted to using backticks
pingu2k4 Oct 22, 2024
9ada3e1
Edited action so that it has the required permissions
pingu2k4 Oct 22, 2024
182ef9d
Merge pull request #516 from PinguApps/510-add-auto-labelling-to-prs
pingu2k4 Oct 22, 2024
35c1e94
Update actions/checkout digest to 11bd719
renovate[bot] Oct 23, 2024
d901bf0
Merge pull request #517 from PinguApps/renovate/actions-checkout-digest
pingu2k4 Oct 23, 2024
f7e86e0
Update EnricoMi/publish-unit-test-result-action action to v2.18.0
renovate[bot] Oct 24, 2024
20b6ad4
Update actions/setup-dotnet digest to 3e891b0
renovate[bot] Oct 24, 2024
ae6e99a
Merge pull request #518 from PinguApps/renovate/enricomi-publish-unit…
pingu2k4 Oct 24, 2024
511895c
Merge pull request #519 from PinguApps/renovate/actions-setup-dotnet-…
pingu2k4 Oct 24, 2024
3b0aab8
added stale action, running twice a day
pingu2k4 Oct 25, 2024
67e3ac0
Merge pull request #522 from PinguApps/520-task-add-stale-action
pingu2k4 Oct 25, 2024
f45ca80
Pin actions/stale action to 28ca103
renovate[bot] Oct 25, 2024
dde9f52
Merge pull request #328 from PinguApps/renovate/pin-dependencies
pingu2k4 Oct 25, 2024
cd354e1
Added permissions for stale
pingu2k4 Oct 25, 2024
013175d
added todos to issues as part of dev pipeline
pingu2k4 Oct 25, 2024
eb56219
Merge pull request #523 from PinguApps/521-todo-to-issue-action
pingu2k4 Oct 25, 2024
007ce56
Pin alstr/todo-to-issue-action action to 53d8a86
renovate[bot] Oct 25, 2024
422d002
Merge pull request #524 from PinguApps/renovate/pin-dependencies
pingu2k4 Oct 25, 2024
8761f5e
Update refit monorepo to v8
renovate[bot] Nov 4, 2024
5c8bb01
Fixed failing tests for refit upgrade to v8
pingu2k4 Nov 6, 2024
a663492
Merge pull request #525 from PinguApps/renovate/major-refit-monorepo
pingu2k4 Nov 6, 2024
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
16 changes: 9 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
## Issue
<!-- Enter the ticket number and link to the issue you are completing, if appropriate -->

## Checklist before requesting a review
> The PR will only be considered when all items within the checklist are marked as complete. Feel free to submit an incomplete draft PR, and add additional commits until you are able to satisfy each item within the checklist.
- [ ] I have performed a self-review of my code
- [ ] I have submitted at most one additional endpoint implementation
- [ ] I have either submitted no additional endpoint implementation, or my implementation covers both client and server SDK's, unless either are marked in the [README](https://github.com/PinguApps/AppwriteSdk/blob/dev/README.md) with a ❌
- [ ] I have added applicable tests for my code
- [ ] I have updated the [README](https://github.com/PinguApps/AppwriteSdk/blob/dev/README.md) with updated status as a result of this PR
## Categorise the PR
<!-- Select at least one category from below that best describes this PR and what it does -->
- [ ] `feature`
- [ ] `bug`
- [ ] `docs`
- [ ] `meta`
- [ ] `patch`
- [ ] `minor`
- [ ] `major`
6 changes: 6 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ categories:
labels:
- "docs"
- "documentation"
- title: "🔗 Dependencies"
labels:
- "dependencies"
- title: "🌀 Meta"
labels:
- "meta"
version-resolver:
major:
labels:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
checks: write
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Nuget Cache
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
retention-days: 5

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@82082dac68ad6a19d980f8ce817e108b9f496c2a # v2.17.1
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0
if: always()
with:
trx_files: "${{ github.workspace }}/**/*.trx"
34 changes: 33 additions & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,38 @@ jobs:
issues: read
checks: write

todos:
name: Convert Todos to Issues
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push'
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: "TODO to Issue"
uses: "alstr/todo-to-issue-action@53d8a86de9f2224b24c6a9009a8a1f56d4e1324d" # v5
with:
INSERT_ISSUE_URLS: true
AUTO_ASSIGN: true
CLOSE_ISSUES: true
- name: Set Git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit and Push Changes
run: |
git add -A
if [[ `git status --porcelain` ]]; then
git commit -m "Automatically added GitHub issue links to TODOs"
git push origin main
else
echo "No changes to commit"
fi


release:
name: Push to main
runs-on: ubuntu-latest
Expand All @@ -28,7 +60,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: dev

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
pull-requests: read
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: main

Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Auto Labeller

on:
pull_request:
types:
- opened
- edited

jobs:
labelling:
name: Labelling
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: harupy/auto-labeling@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
label-pattern: '- \[(.*?)\] ?`(.+?)`' # matches '- [x] `label`'
22 changes: 22 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Stale issues & PRs'
on:
schedule:
- cron: '27 0,12 * * *'

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9
with:
days-before-stale: 7
days-before-pr-stale: 2
days-before-close: 3
stale-issue-message: 'This issue has been marked as stale, and will be automatically closed in 3 days.'
stale-pr-message: 'This PR has been marked as stale, and will be automatically closed in 3 days.'
close-issue-message: 'Closing issue as it has been marked as stale for 3 days.'
close-pr-message: 'Closing PR as it has been marked as stale for 3 days.'
exempt-all-milestones: true
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.10.0" />
<PackageReference Include="OneOf" Version="3.0.271" />
<PackageReference Include="Refit" Version="7.2.1" />
<PackageReference Include="Refit.HttpClientFactory" Version="7.2.1" />
<PackageReference Include="Refit" Version="8.0.0" />
<PackageReference Include="Refit.HttpClientFactory" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

Expand Down
34 changes: 17 additions & 17 deletions tests/PinguApps.Appwrite.Client.Tests/Utils/ResponseUtilsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ResponseUtilsTests
public void GetApiResponse_Success_ReturnsContent()
{
var mockApiResponse = new Mock<IApiResponse>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(true);

var result = mockApiResponse.Object.GetApiResponse();

Expand All @@ -30,8 +30,8 @@ public async Task GetApiResponse_Failure_ReturnsError()
var exception = await ApiException.Create(new HttpRequestMessage(), HttpMethod.Get, response, new RefitSettings());

var mockApiResponse = new Mock<IApiResponse>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns(exception);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns(exception);

var result = mockApiResponse.Object.GetApiResponse();

Expand All @@ -46,8 +46,8 @@ public async Task GetApiResponse_FailureButNullErrorContent_ThrowsException()
var exception = await ApiException.Create(new HttpRequestMessage(), HttpMethod.Get, new HttpResponseMessage(HttpStatusCode.InternalServerError), new RefitSettings());

var mockApiResponse = new Mock<IApiResponse>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns(exception);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns(exception);

Assert.Throws<Exception>(() => mockApiResponse.Object.GetApiResponse());
}
Expand All @@ -56,8 +56,8 @@ public async Task GetApiResponse_FailureButNullErrorContent_ThrowsException()
public void GetApiResponse_FailureButNullError_ThrowsException()
{
var mockApiResponse = new Mock<IApiResponse>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns((ApiException)null!);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns((ApiException)null!);

Assert.Throws<Exception>(() => mockApiResponse.Object.GetApiResponse());
}
Expand All @@ -66,8 +66,8 @@ public void GetApiResponse_FailureButNullError_ThrowsException()
public void GenericGetApiResponse_Success_ReturnsContent()
{
var mockApiResponse = new Mock<IApiResponse<string>>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
mockApiResponse.SetupGet(r => r.Content).Returns("Success");
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(true);
mockApiResponse.Setup(x => x.Content).Returns("Success");

var result = mockApiResponse.Object.GetApiResponse();

Expand All @@ -79,8 +79,8 @@ public void GenericGetApiResponse_Success_ReturnsContent()
public void GenericGetApiResponse_SuccessButNullContent_ReturnsInternalError()
{
var mockApiResponse = new Mock<IApiResponse<string>>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
mockApiResponse.SetupGet(r => r.Content).Returns((string?)null);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(true);
mockApiResponse.Setup(r => r.Content).Returns((string?)null);

var result = mockApiResponse.Object.GetApiResponse();

Expand All @@ -98,8 +98,8 @@ public async Task GenericGetApiResponse_Failure_ReturnsError()
var exception = await ApiException.Create(new HttpRequestMessage(), HttpMethod.Get, response, new RefitSettings());

var mockApiResponse = new Mock<IApiResponse<string>>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns(exception);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns(exception);

var result = mockApiResponse.Object.GetApiResponse();

Expand All @@ -114,8 +114,8 @@ public async Task GenericGetApiResponse_FailureButNullErrorContent_ThrowsExcepti
var exception = await ApiException.Create(new HttpRequestMessage(), HttpMethod.Get, new HttpResponseMessage(HttpStatusCode.InternalServerError), new RefitSettings());

var mockApiResponse = new Mock<IApiResponse<string>>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns(exception);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns(exception);

Assert.Throws<Exception>(() => mockApiResponse.Object.GetApiResponse());
}
Expand All @@ -124,8 +124,8 @@ public async Task GenericGetApiResponse_FailureButNullErrorContent_ThrowsExcepti
public void GenericGetApiResponse_FailureButNullError_ThrowsException()
{
var mockApiResponse = new Mock<IApiResponse<string>>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns((ApiException)null!);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns((ApiException)null!);

Assert.Throws<Exception>(() => mockApiResponse.Object.GetApiResponse());
}
Expand Down
34 changes: 17 additions & 17 deletions tests/PinguApps.Appwrite.Server.Tests/Utils/ResponseUtilsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ResponseUtilsTests
public void GetApiResponse_Success_ReturnsContent()
{
var mockApiResponse = new Mock<IApiResponse>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(true);

var result = mockApiResponse.Object.GetApiResponse();

Expand All @@ -30,8 +30,8 @@ public async Task GetApiResponse_Failure_ReturnsError()
var exception = await ApiException.Create(new HttpRequestMessage(), HttpMethod.Get, response, new RefitSettings());

var mockApiResponse = new Mock<IApiResponse>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns(exception);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns(exception);

var result = mockApiResponse.Object.GetApiResponse();

Expand All @@ -46,8 +46,8 @@ public async Task GetApiResponse_FailureButNullErrorContent_ThrowsException()
var exception = await ApiException.Create(new HttpRequestMessage(), HttpMethod.Get, new HttpResponseMessage(HttpStatusCode.InternalServerError), new RefitSettings());

var mockApiResponse = new Mock<IApiResponse>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns(exception);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns(exception);

Assert.Throws<Exception>(() => mockApiResponse.Object.GetApiResponse());
}
Expand All @@ -56,8 +56,8 @@ public async Task GetApiResponse_FailureButNullErrorContent_ThrowsException()
public void GetApiResponse_FailureButNullError_ThrowsException()
{
var mockApiResponse = new Mock<IApiResponse>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns((ApiException)null!);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns((ApiException)null!);

Assert.Throws<Exception>(() => mockApiResponse.Object.GetApiResponse());
}
Expand All @@ -66,8 +66,8 @@ public void GetApiResponse_FailureButNullError_ThrowsException()
public void GenericGetApiResponse_Success_ReturnsContent()
{
var mockApiResponse = new Mock<IApiResponse<string>>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
mockApiResponse.SetupGet(r => r.Content).Returns("Success");
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(true);
mockApiResponse.Setup(r => r.Content).Returns("Success");

var result = mockApiResponse.Object.GetApiResponse();

Expand All @@ -79,8 +79,8 @@ public void GenericGetApiResponse_Success_ReturnsContent()
public void GenericGetApiResponse_SuccessButNullContent_ReturnsInternalError()
{
var mockApiResponse = new Mock<IApiResponse<string>>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
mockApiResponse.SetupGet(r => r.Content).Returns((string?)null);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(true);
mockApiResponse.Setup(r => r.Content).Returns((string?)null);

var result = mockApiResponse.Object.GetApiResponse();

Expand All @@ -98,8 +98,8 @@ public async Task GenericGetApiResponse_Failure_ReturnsError()
var exception = await ApiException.Create(new HttpRequestMessage(), HttpMethod.Get, response, new RefitSettings());

var mockApiResponse = new Mock<IApiResponse<string>>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns(exception);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns(exception);

var result = mockApiResponse.Object.GetApiResponse();

Expand All @@ -114,8 +114,8 @@ public async Task GenericGetApiResponse_FailureButNullErrorContent_ThrowsExcepti
var exception = await ApiException.Create(new HttpRequestMessage(), HttpMethod.Get, new HttpResponseMessage(HttpStatusCode.InternalServerError), new RefitSettings());

var mockApiResponse = new Mock<IApiResponse<string>>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns(exception);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns(exception);

Assert.Throws<Exception>(() => mockApiResponse.Object.GetApiResponse());
}
Expand All @@ -124,8 +124,8 @@ public async Task GenericGetApiResponse_FailureButNullErrorContent_ThrowsExcepti
public void GenericGetApiResponse_FailureButNullError_ThrowsException()
{
var mockApiResponse = new Mock<IApiResponse<string>>();
mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
mockApiResponse.SetupGet(x => x.Error).Returns((ApiException)null!);
mockApiResponse.As<IApiResponse>().Setup(x => x.IsSuccessStatusCode).Returns(false);
mockApiResponse.As<IApiResponse>().Setup(x => x.Error).Returns((ApiException)null!);

Assert.Throws<Exception>(() => mockApiResponse.Object.GetApiResponse());
}
Expand Down
Loading