diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index f31a1c6..b03c814 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -4,10 +4,12 @@
## Issue
-## 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
+
+- [ ] `feature`
+- [ ] `bug`
+- [ ] `docs`
+- [ ] `meta`
+- [ ] `patch`
+- [ ] `minor`
+- [ ] `major`
diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml
index 5604e78..39566e7 100644
--- a/.github/release-drafter.yml
+++ b/.github/release-drafter.yml
@@ -16,6 +16,12 @@ categories:
labels:
- "docs"
- "documentation"
+ - title: "🔗 Dependencies"
+ labels:
+ - "dependencies"
+ - title: "🌀 Meta"
+ labels:
+ - "meta"
version-resolver:
major:
labels:
diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml
index ee69f03..1a64ce4 100644
--- a/.github/workflows/_test.yml
+++ b/.github/workflows/_test.yml
@@ -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') }}
@@ -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"
diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml
index 8d0fa65..271d5e6 100644
--- a/.github/workflows/dev.yml
+++ b/.github/workflows/dev.yml
@@ -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
@@ -28,7 +60,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: dev
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 4d127ba..1af8582 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -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 }}
@@ -76,7 +76,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: main
diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml
new file mode 100644
index 0000000..f60e8cc
--- /dev/null
+++ b/.github/workflows/pr-labels.yml
@@ -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`'
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
new file mode 100644
index 0000000..3b84a8f
--- /dev/null
+++ b/.github/workflows/stale.yml
@@ -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
diff --git a/src/PinguApps.Appwrite.Shared/PinguApps.Appwrite.Shared.csproj b/src/PinguApps.Appwrite.Shared/PinguApps.Appwrite.Shared.csproj
index bb170de..5700ebe 100644
--- a/src/PinguApps.Appwrite.Shared/PinguApps.Appwrite.Shared.csproj
+++ b/src/PinguApps.Appwrite.Shared/PinguApps.Appwrite.Shared.csproj
@@ -9,8 +9,8 @@
-
-
+
+
diff --git a/tests/PinguApps.Appwrite.Client.Tests/Utils/ResponseUtilsTests.cs b/tests/PinguApps.Appwrite.Client.Tests/Utils/ResponseUtilsTests.cs
index 6a1f58d..a08ee21 100644
--- a/tests/PinguApps.Appwrite.Client.Tests/Utils/ResponseUtilsTests.cs
+++ b/tests/PinguApps.Appwrite.Client.Tests/Utils/ResponseUtilsTests.cs
@@ -12,7 +12,7 @@ public class ResponseUtilsTests
public void GetApiResponse_Success_ReturnsContent()
{
var mockApiResponse = new Mock();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(true);
var result = mockApiResponse.Object.GetApiResponse();
@@ -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();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns(exception);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns(exception);
var result = mockApiResponse.Object.GetApiResponse();
@@ -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();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns(exception);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns(exception);
Assert.Throws(() => mockApiResponse.Object.GetApiResponse());
}
@@ -56,8 +56,8 @@ public async Task GetApiResponse_FailureButNullErrorContent_ThrowsException()
public void GetApiResponse_FailureButNullError_ThrowsException()
{
var mockApiResponse = new Mock();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns((ApiException)null!);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns((ApiException)null!);
Assert.Throws(() => mockApiResponse.Object.GetApiResponse());
}
@@ -66,8 +66,8 @@ public void GetApiResponse_FailureButNullError_ThrowsException()
public void GenericGetApiResponse_Success_ReturnsContent()
{
var mockApiResponse = new Mock>();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
- mockApiResponse.SetupGet(r => r.Content).Returns("Success");
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(true);
+ mockApiResponse.Setup(x => x.Content).Returns("Success");
var result = mockApiResponse.Object.GetApiResponse();
@@ -79,8 +79,8 @@ public void GenericGetApiResponse_Success_ReturnsContent()
public void GenericGetApiResponse_SuccessButNullContent_ReturnsInternalError()
{
var mockApiResponse = new Mock>();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
- mockApiResponse.SetupGet(r => r.Content).Returns((string?)null);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(true);
+ mockApiResponse.Setup(r => r.Content).Returns((string?)null);
var result = mockApiResponse.Object.GetApiResponse();
@@ -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>();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns(exception);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns(exception);
var result = mockApiResponse.Object.GetApiResponse();
@@ -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>();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns(exception);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns(exception);
Assert.Throws(() => mockApiResponse.Object.GetApiResponse());
}
@@ -124,8 +124,8 @@ public async Task GenericGetApiResponse_FailureButNullErrorContent_ThrowsExcepti
public void GenericGetApiResponse_FailureButNullError_ThrowsException()
{
var mockApiResponse = new Mock>();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns((ApiException)null!);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns((ApiException)null!);
Assert.Throws(() => mockApiResponse.Object.GetApiResponse());
}
diff --git a/tests/PinguApps.Appwrite.Server.Tests/Utils/ResponseUtilsTests.cs b/tests/PinguApps.Appwrite.Server.Tests/Utils/ResponseUtilsTests.cs
index 591cc8a..fd4ff11 100644
--- a/tests/PinguApps.Appwrite.Server.Tests/Utils/ResponseUtilsTests.cs
+++ b/tests/PinguApps.Appwrite.Server.Tests/Utils/ResponseUtilsTests.cs
@@ -12,7 +12,7 @@ public class ResponseUtilsTests
public void GetApiResponse_Success_ReturnsContent()
{
var mockApiResponse = new Mock();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(true);
var result = mockApiResponse.Object.GetApiResponse();
@@ -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();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns(exception);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns(exception);
var result = mockApiResponse.Object.GetApiResponse();
@@ -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();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns(exception);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns(exception);
Assert.Throws(() => mockApiResponse.Object.GetApiResponse());
}
@@ -56,8 +56,8 @@ public async Task GetApiResponse_FailureButNullErrorContent_ThrowsException()
public void GetApiResponse_FailureButNullError_ThrowsException()
{
var mockApiResponse = new Mock();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns((ApiException)null!);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns((ApiException)null!);
Assert.Throws(() => mockApiResponse.Object.GetApiResponse());
}
@@ -66,8 +66,8 @@ public void GetApiResponse_FailureButNullError_ThrowsException()
public void GenericGetApiResponse_Success_ReturnsContent()
{
var mockApiResponse = new Mock>();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
- mockApiResponse.SetupGet(r => r.Content).Returns("Success");
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(true);
+ mockApiResponse.Setup(r => r.Content).Returns("Success");
var result = mockApiResponse.Object.GetApiResponse();
@@ -79,8 +79,8 @@ public void GenericGetApiResponse_Success_ReturnsContent()
public void GenericGetApiResponse_SuccessButNullContent_ReturnsInternalError()
{
var mockApiResponse = new Mock>();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(true);
- mockApiResponse.SetupGet(r => r.Content).Returns((string?)null);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(true);
+ mockApiResponse.Setup(r => r.Content).Returns((string?)null);
var result = mockApiResponse.Object.GetApiResponse();
@@ -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>();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns(exception);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns(exception);
var result = mockApiResponse.Object.GetApiResponse();
@@ -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>();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns(exception);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns(exception);
Assert.Throws(() => mockApiResponse.Object.GetApiResponse());
}
@@ -124,8 +124,8 @@ public async Task GenericGetApiResponse_FailureButNullErrorContent_ThrowsExcepti
public void GenericGetApiResponse_FailureButNullError_ThrowsException()
{
var mockApiResponse = new Mock>();
- mockApiResponse.SetupGet(r => r.IsSuccessStatusCode).Returns(false);
- mockApiResponse.SetupGet(x => x.Error).Returns((ApiException)null!);
+ mockApiResponse.As().Setup(x => x.IsSuccessStatusCode).Returns(false);
+ mockApiResponse.As().Setup(x => x.Error).Returns((ApiException)null!);
Assert.Throws(() => mockApiResponse.Object.GetApiResponse());
}