From 2537f39f5ceeab6b00fd9e9e2bdc3fbdefdae26b Mon Sep 17 00:00:00 2001 From: leogdion Date: Wed, 20 May 2026 08:44:32 +0100 Subject: [PATCH 1/2] Fix CloudKit Web Services documentation links in README Updated links in README to point to the correct CloudKit Web Services documentation. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index afdb88d9..8113b202 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ [![Maintainability](https://qlty.sh/badges/55637213-d307-477e-a710-f9dba332d955/maintainability.svg)](https://qlty.sh/gh/brightdigit/projects/MistKit) [![Documentation](https://img.shields.io/badge/docc-read_documentation-blue)](https://swiftpackageindex.com/brightdigit/MistKit/documentation) -A Swift Package for Server-Side and Command-Line Access to [CloudKit Web Services](https://developer.apple.com/documentation/cloudkitwebservices) +A Swift Package for Server-Side and Command-Line Access to [CloudKit Web Services](https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/CloudKitWebServicesReference/index.html) ## Table of Contents - [Overview](#overview) @@ -330,7 +330,7 @@ Check out the `Examples/` directory for complete working examples: ### Apple References -- **[CloudKit Web Services](https://developer.apple.com/documentation/cloudkitwebservices)**: Official CloudKit Web Services REST API documentation +- **[CloudKit Web Services](https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/CloudKitWebServicesReference/index.html)**: Official CloudKit Web Services REST API documentation - **[CloudKit framework](https://developer.apple.com/documentation/cloudkit)**: On-device CloudKit framework (iOS/macOS) - **[CloudKit JS](https://developer.apple.com/documentation/cloudkitjs)**: Browser-based CloudKit access used for web auth token capture - **[CKFetchWebAuthTokenOperation](https://developer.apple.com/documentation/cloudkit/ckfetchwebauthtokenoperation)**: iOS/macOS API for exchanging an iCloud session for a web auth token From 9c645350d6d8591cb1dd3b1312514b5aa33b9f7f Mon Sep 17 00:00:00 2001 From: leogdion Date: Sat, 23 May 2026 18:43:47 -0400 Subject: [PATCH 2/2] setup-mistkit: pin to resolved revision so swift-build cache invalidates swift-build@v1's SPM cache key is hashed from `swift package dump-package`'s canonical JSON. With the previous `branch: ""` pin the dependency JSON didn't change when the upstream branch advanced, so a new MistKit commit on the same branch yielded a stale cache hit and consumer code that depended on new MistKit symbols failed to compile against pre-existing cached binaries. Resolve the input branch to its current HEAD commit via `git ls-remote` and write `revision: ""` into Package.swift instead. The package hash now changes whenever the branch moves, so the cache invalidates correctly. Falls back to the original `branch:` pin if the ref can't be resolved. This is the same shape as the explicit `git ls-remote` + cache-key fix that already exists in CelestraCloud's update-feeds.yml, lifted into the shared action so every consumer gets it. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/actions/setup-mistkit/action.yml | 32 +++++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-mistkit/action.yml b/.github/actions/setup-mistkit/action.yml index 70a23028..6cfbda11 100644 --- a/.github/actions/setup-mistkit/action.yml +++ b/.github/actions/setup-mistkit/action.yml @@ -1,5 +1,5 @@ name: Setup MistKit -description: Replaces the local MistKit path dependency with a remote branch reference +description: Replaces the local MistKit path dependency with a remote reference, pinned to the branch's current commit inputs: branch: @@ -8,19 +8,43 @@ inputs: runs: using: composite steps: + # Resolve the branch to its current HEAD commit and pin the dependency by + # `revision:` rather than `branch:`. This makes the dependency content-addressed, + # so `swift package dump-package` (which swift-build@v1 hashes for its cache key) + # changes whenever the MistKit branch advances — otherwise a new MistKit commit on + # the same branch yields a stale cache hit and is never rebuilt. Falls back to a + # `branch:` pin if the ref can't be resolved (e.g. offline). - name: Update Package.swift (Unix) if: inputs.branch != '' && runner.os != 'Windows' shell: bash run: | + BRANCH='${{ inputs.branch }}' + REF=$(git ls-remote https://github.com/brightdigit/MistKit.git "$BRANCH" | head -n1 | cut -f1) + if [ -n "$REF" ]; then + REQ='revision: "'"$REF"'"' + echo "Pinning MistKit to $BRANCH @ $REF" + else + REQ='branch: "'"$BRANCH"'"' + echo "Could not resolve $BRANCH to a commit; pinning by branch" + fi if [ "$RUNNER_OS" = "macOS" ]; then - sed -i '' 's|\.package(name: "MistKit", path: "\.\./\.\.")|.package(url: "https://github.com/brightdigit/MistKit.git", branch: "'"${{ inputs.branch }}"'")|g' Package.swift + sed -i '' 's|\.package(name: "MistKit", path: "\.\./\.\.")|.package(url: "https://github.com/brightdigit/MistKit.git", '"$REQ"')|g' Package.swift else - sed -i 's|\.package(name: "MistKit", path: "\.\./\.\.")|.package(url: "https://github.com/brightdigit/MistKit.git", branch: "'"${{ inputs.branch }}"'")|g' Package.swift + sed -i 's|\.package(name: "MistKit", path: "\.\./\.\.")|.package(url: "https://github.com/brightdigit/MistKit.git", '"$REQ"')|g' Package.swift fi rm -f Package.resolved - name: Update Package.swift (Windows) if: inputs.branch != '' && runner.os == 'Windows' shell: pwsh run: | - (Get-Content Package.swift) -replace '\.package\(name: "MistKit", path: "\.\./\.\."\)', ".package(url: `"https://github.com/brightdigit/MistKit.git`", branch: `"${{ inputs.branch }}`")" | Set-Content Package.swift + $branch = '${{ inputs.branch }}' + $ref = (git ls-remote https://github.com/brightdigit/MistKit.git $branch | Select-Object -First 1) -split "`t" | Select-Object -First 1 + if ($ref) { + $req = "revision: `"$ref`"" + Write-Host "Pinning MistKit to $branch @ $ref" + } else { + $req = "branch: `"$branch`"" + Write-Host "Could not resolve $branch to a commit; pinning by branch" + } + (Get-Content Package.swift) -replace '\.package\(name: "MistKit", path: "\.\./\.\."\)', ".package(url: `"https://github.com/brightdigit/MistKit.git`", $req)" | Set-Content Package.swift Remove-Item -Path Package.resolved -Force -ErrorAction SilentlyContinue