Skip to content

Updating from MistKit v1.0.0-alpha.5#32

Draft
leogdion wants to merge 12 commits intov1.0.0-alpha.2from
mistkit-v1.0.0.alpha.2
Draft

Updating from MistKit v1.0.0-alpha.5#32
leogdion wants to merge 12 commits intov1.0.0-alpha.2from
mistkit-v1.0.0.alpha.2

Conversation

@leogdion
Copy link
Copy Markdown
Member

No description provided.

leogdion and others added 12 commits January 8, 2026 14:16
Update Package.resolved after BushelCloud migration

Update BushelCloud workflows to use remote MistKit

- Add step to replace local MistKit path with GitHub URL (main branch)
- Add skip-package-resolved: true to swift-build actions
- Remove Package.resolved before builds for clean dependency resolution

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed all instances of CLOUDKIT_KEY_FILE to CLOUDKIT_PRIVATE_KEY_PATH
to match the actual environment variable used in CloudKitConfiguration.

Fixed 5 occurrences:
- Line 188: First sync example
- Line 278: Environment variables usage example
- Line 488: Method 2 environment variables example
- Line 671: Troubleshooting example
- Line 672: Verify file exists command

Resolves #178

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Only run the bushel-cloud-build workflow on PRs targeting main branch.
This prevents the workflow from failing on subrepo branches like 'mistkit'
where the local MistKit path dependency is not available.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add DemoInFilterCommand that creates 3 Note records, queries with IN
  filter for [10, 30], verifies 2 results, then deletes all records —
  end-to-end confirmation of the issue #192 fix
- Fix auth model in MistKitClientFactory: public database uses
  server-to-server (CLOUDKIT_KEY_ID + CLOUDKIT_PRIVATE_KEY_PATH),
  private database uses web auth (CLOUDKIT_API_TOKEN + CLOUDKIT_WEB_AUTH_TOKEN)
- Wire QueryCommand filters: pass real QueryFilter objects to queryRecords
  instead of ignoring parsed filters
- Change filter string separator to | so commas work inside IN/NOT_IN values
- Fix CLOUDKIT_ env var prefix mapping in MistDemoConfiguration
- Rename private.key.file config key to private.key.path to match
  CLOUDKIT_PRIVATE_KEY_PATH env var
- Grant _world CREATE/WRITE in schema.ckdb for public database writes
- Update CLAUDE.md and .claude/docs to document correct auth model

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces hardcoded sed/PowerShell inline steps with a reusable composite
action (.github/actions/setup-mistkit/action.yml) in each example subrepo.
The branch input defaults to empty (no swap); workflows pass branch: main
explicitly. To target a different MistKit branch, update the with: input
in the relevant workflow step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Branch is now set once in each subrepo's action.yml default rather than
repeated across every workflow file. Workflows call setup-mistkit with
no arguments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The fallback build path (when the pre-built artifact is unavailable) was
running swift build without swapping the local MistKit path dependency,
causing the build to fail in the standalone BushelCloud repo context.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The workflow_run trigger was scoped to the old 8-scheduled-job branch
and is no longer needed. Schedule and workflow_dispatch cover all cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b812b8f7-4bf5-42d3-890c-f44d94d15b2c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mistkit-v1.0.0.alpha.2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 30, 2026

Code Review

PR: Updating from MistKit v1.0.0-alpha.5
State: Draft — notes below reflect that some items may be intentionally in progress.


Overview

This PR switches the MistKit dependency from a pinned remote release (1.0.0-alpha.3) to a local path dependency (../..) for active development, adds a reusable setup-mistkit composite action to patch Package.swift in CI, cleans up workflow triggers, fixes a long-standing env-var name typo in README, and improves test idiom for UTF-8 data encoding.


✅ Good Changes

Test improvements (VirtualBuddyFetcherTests.swift)

  • Replacing .data(using: .utf8)! with Data(string.utf8) is a clear improvement. UTF-8 encoding of a String can never fail, so the force-unwrap was always unnecessary noise. The new form is idiomatic Swift and removes 8 force-unwraps.

README env-var fix

  • CLOUDKIT_KEY_FILECLOUDKIT_PRIVATE_KEY_PATH in four places is a real bug fix. The wrong name would silently produce "key file not found" errors for anyone following the README. Worth noting that CLAUDE.md already uses the correct name — README was just stale.

Workflow simplification (cloudkit-sync-dev.yml)

  • Removing the workflow_run trigger and its conditional guard simplifies the dev-sync workflow meaningfully. The trigger was only useful while the 8-scheduled-job branch was active, so removing it reduces confusion without losing anything.

PR trigger scoping (bushel-cloud-build.yml)

  • Adding branches: [main] to the pull_request trigger is the right call. Feature-to-feature PRs shouldn't burn CI minutes on the binary-build workflow.

⚠️ Concerns

1. setup-mistkit is called without a branch input in the main CI workflows

In both BushelCloud.yml and codeql.yml, the new step looks like:

- name: Setup MistKit
  uses: ./.github/actions/setup-mistkit

No with: branch: is provided. The action's if: inputs.branch != '' guard means both steps are unconditional no-ops in CI — Package.swift is left with path: "../..". That path doesn't exist in a standalone checkout of BushelCloud, so the subsequent build step would fail on package resolution unless skip-package-resolved: true somehow bypasses it. Please clarify: does swift-build@v1.4.2 with skip-package-resolved: true skip resolution entirely, or does it only skip the lockfile check?

If the path dep really does break CI, the fix is straightforward — pass the target branch:

- name: Setup MistKit
  uses: ./.github/actions/setup-mistkit
  with:
    branch: main   # or whichever branch tracks alpha.5

2. Shell injection risk in setup-mistkit/action.yml

run: |
  sed -i '' 's|...|.package(url: "...", branch: "'"${{ inputs.branch }}"'")|g' Package.swift

${{ inputs.branch }} is interpolated directly into the shell string before the shell sees it. A branch name containing |, \, ', or ; (unlikely but possible) would break the sed pattern or, in a context where the input is untrusted, could allow command injection. The fix is to use an env var:

env:
  MISTKIT_BRANCH: ${{ inputs.branch }}
run: |
  sed -i '' "s|...|.package(url: \"...\", branch: \"${MISTKIT_BRANCH}\")|g" Package.swift

This is lower priority since inputs.branch comes from the workflow (not from PR content), but it's a best practice worth following.

3. Local path dep in Package.swift should not land on main

Package.swift with path: "../.." only resolves correctly when BushelCloud is checked out inside MistKit's Examples/Bushel/ directory. Anyone who clones BushelCloud standalone and runs swift build without going through the setup-mistkit action will get an immediate resolution error. The intent seems to be that this stays as a development convenience (consistent with the "git subrepo" approach in CLAUDE.md), but it should be clearly gated — either:

  • Don't merge this to main until a stable 1.0.0-alpha.5 tag is cut and the dep reverts to a versioned URL, or
  • Add a // Dev only — CI rewrites this comment so the intent is obvious to contributors.

4. cloudkit-sync/action.ymlSetup MistKit also has no branch

Same as concern #1. The new step in the binary-build fallback path:

- name: Setup MistKit
  if: steps.download-binary.outcome != 'success'
  uses: ./.github/actions/setup-mistkit

…is also a no-op without a branch input, so the fallback build would hit the same path-dep resolution failure.


Minor Nits

  • The inputs.branch description says "leave empty to keep the local path dependency" — that phrasing implies keeping the local dep is a valid CI scenario, which it isn't for standalone checkouts. Consider "leave empty to skip (no-op)" or add a required: true if it should always be provided.
  • Package.resolved no longer pins MistKit (removed). That's correct for a path dep, but worth confirming the originHash change doesn't reflect any other unintended dependency churn.

Summary

The test and README fixes are clean and should ship. The CI setup around setup-mistkit needs a branch value wired in before the workflows will actually work, and the shell-injection nit in the sed command is a quick fix. Given the draft status, I'd expect these to be addressed before requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant