Compare commits
1 Commits
main
...
v0.1.30-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b14a7d6c64 |
@@ -1,15 +1,12 @@
|
||||
# Node modules
|
||||
node_modules/
|
||||
**/node_modules
|
||||
.pnpm-store/
|
||||
.pnpm/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Build artifacts
|
||||
**/target/
|
||||
target/
|
||||
dist/
|
||||
build/
|
||||
*.tgz
|
||||
@@ -36,12 +33,6 @@ Thumbs.db
|
||||
.git/
|
||||
.gitignore
|
||||
|
||||
# Repo content not needed for Docker builds
|
||||
.github/
|
||||
docs/
|
||||
dev_assets/
|
||||
dev_assets_seed/
|
||||
|
||||
# Docker
|
||||
Dockerfile*
|
||||
.dockerignore
|
||||
@@ -68,4 +59,4 @@ coverage/
|
||||
|
||||
# Temporary folders
|
||||
tmp/
|
||||
temp/
|
||||
temp/
|
||||
@@ -1,163 +0,0 @@
|
||||
name: container
|
||||
# Build the self-hosted images from THIS repo and publish them to the Gitea
|
||||
# registry:
|
||||
#
|
||||
# git.lair.cafe/lair/vibe-kanban-remote crates/remote/Dockerfile :8081
|
||||
# git.lair.cafe/lair/vibe-kanban-relay crates/relay-tunnel/Dockerfile :8082
|
||||
#
|
||||
# This build used to live in lair/containers, which is for *third-party* images
|
||||
# built from someone else's source. We own this fork now, so the build belongs
|
||||
# next to the code it builds — a source change and its image are one commit.
|
||||
#
|
||||
# Both crates ship their own Dockerfile (context = repo root), so there is no
|
||||
# vendored Containerfile here. Nothing in this workflow reaches out to GitHub:
|
||||
# upstream is sunset and may disappear, and a build that asks github.com what to
|
||||
# build would disappear with it.
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "crates/**"
|
||||
- "packages/**"
|
||||
- "shared/**"
|
||||
- "assets/**"
|
||||
- "patches/**"
|
||||
- "Cargo.toml"
|
||||
- "Cargo.lock"
|
||||
- "package.json"
|
||||
- "pnpm-lock.yaml"
|
||||
- "pnpm-workspace.yaml"
|
||||
- "rust-toolchain.toml"
|
||||
- ".gitea/workflows/container.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
# Never let two builds race: they would fight over the :latest tags and the
|
||||
# loser's digest would win at random.
|
||||
concurrency:
|
||||
group: container
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
remote:
|
||||
runs-on:
|
||||
- metal
|
||||
- podman
|
||||
# The Rust workspace builds in release mode; from a cold cache the default
|
||||
# job timeout is not enough headroom.
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: derive image tags
|
||||
id: meta
|
||||
run: |
|
||||
set -euo pipefail
|
||||
version=$(jq -r .version package.json)
|
||||
short=$(git rev-parse --short HEAD)
|
||||
# Immutable tag first. :latest is a convenience for humans, never a
|
||||
# deployment target -- a floating tag decides which build you are
|
||||
# running based on whenever something last pulled.
|
||||
echo "immutable=${version}-g${short}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: login to registry
|
||||
run: podman login -u ${{ gitea.actor }} -p ${{ secrets.REGISTRY_TOKEN }} git.lair.cafe
|
||||
|
||||
- name: build
|
||||
env:
|
||||
IMMUTABLE: ${{ steps.meta.outputs.immutable }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
IMAGE=git.lair.cafe/lair/vibe-kanban-remote
|
||||
# FEATURES is deliberately unset: the Dockerfile strips the private
|
||||
# billing crate only when it is empty (the self-host path), and we have
|
||||
# no access to BloopAI/vibe-kanban-private.
|
||||
#
|
||||
# VITE_RELAY_API_BASE_URL is baked into the SPA at build time and is
|
||||
# ORIGIN-RELATIVE on purpose. It is not a switch that disables the
|
||||
# relay -- leaving it empty makes Bootstrap.tsx fall back to
|
||||
# window.location.origin, which aims relay calls at the remote API,
|
||||
# which does not serve them. "/relay-api" instead means the SPA calls
|
||||
# whichever host served it, so one build works unchanged behind both
|
||||
# kanban.internal and a future public name, with no CORS and no second
|
||||
# certificate. nginx strips the prefix and forwards to the relay.
|
||||
podman build --pull=newer \
|
||||
-f crates/remote/Dockerfile \
|
||||
--build-arg VITE_RELAY_API_BASE_URL=/relay-api \
|
||||
-t "${IMAGE}:${IMMUTABLE}" \
|
||||
-t "${IMAGE}:latest" \
|
||||
.
|
||||
|
||||
- name: verify the sunset really is gone
|
||||
env:
|
||||
IMMUTABLE: ${{ steps.meta.outputs.immutable }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
IMAGE=git.lair.cafe/lair/vibe-kanban-remote
|
||||
# This fork exists because upstream replaced the board with an
|
||||
# export-only page. If a merge or a bad rebase ever reinstates it, fail
|
||||
# here rather than publish an image that greets us with a dead product.
|
||||
if podman run --rm --entrypoint sh "${IMAGE}:${IMMUTABLE}" -c \
|
||||
'grep -rlq "Project functionality has been retired" /srv/static' 2>/dev/null; then
|
||||
echo "ERROR: the sunset page is present in the built bundle."
|
||||
echo "The revert of #3387 has been lost -- refusing to publish."
|
||||
exit 1
|
||||
fi
|
||||
echo "ok: no sunset page in the bundle"
|
||||
|
||||
- name: push
|
||||
env:
|
||||
IMMUTABLE: ${{ steps.meta.outputs.immutable }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
IMAGE=git.lair.cafe/lair/vibe-kanban-remote
|
||||
podman push "${IMAGE}:${IMMUTABLE}"
|
||||
podman push "${IMAGE}:latest"
|
||||
echo "published ${IMAGE}:${IMMUTABLE} (and :latest)"
|
||||
echo
|
||||
echo "pin the quadlet to the immutable tag:"
|
||||
echo " Image=${IMAGE}:${IMMUTABLE}"
|
||||
|
||||
relay:
|
||||
runs-on:
|
||||
- metal
|
||||
- podman
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: derive image tags
|
||||
id: meta
|
||||
run: |
|
||||
set -euo pipefail
|
||||
version=$(jq -r .version package.json)
|
||||
short=$(git rev-parse --short HEAD)
|
||||
echo "immutable=${version}-g${short}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: login to registry
|
||||
run: podman login -u ${{ gitea.actor }} -p ${{ secrets.REGISTRY_TOKEN }} git.lair.cafe
|
||||
|
||||
- name: build
|
||||
env:
|
||||
IMMUTABLE: ${{ steps.meta.outputs.immutable }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
IMAGE=git.lair.cafe/lair/vibe-kanban-relay
|
||||
# No build args: the relay takes all of its configuration from the
|
||||
# environment at runtime (DATABASE_URL, RELAY_LISTEN_ADDR and the JWT
|
||||
# secret it shares with the remote server). It has no notion of its own
|
||||
# public address, which is what makes mounting it under a path safe.
|
||||
podman build --pull=newer \
|
||||
-f crates/relay-tunnel/Dockerfile \
|
||||
-t "${IMAGE}:${IMMUTABLE}" \
|
||||
-t "${IMAGE}:latest" \
|
||||
.
|
||||
|
||||
- name: push
|
||||
env:
|
||||
IMMUTABLE: ${{ steps.meta.outputs.immutable }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
IMAGE=git.lair.cafe/lair/vibe-kanban-relay
|
||||
podman push "${IMAGE}:${IMMUTABLE}"
|
||||
podman push "${IMAGE}:latest"
|
||||
echo "published ${IMAGE}:${IMMUTABLE} (and :latest)"
|
||||
@@ -1,198 +0,0 @@
|
||||
name: host-release
|
||||
# Build the LOCAL vibe-kanban server and publish it as a signed RPM to
|
||||
# rpm.lair.cafe, so a host installs it with dnf instead of `npx vibe-kanban`.
|
||||
#
|
||||
# npx is not an option here: npx-cli resolves its download from R2_BASE_URL, a
|
||||
# placeholder substituted at npm-publish time to BloopAI's bucket, with no
|
||||
# runtime override (npx-cli/src/download.ts). That serves upstream's binary --
|
||||
# which still carries the product sunset -- from infrastructure that disappears
|
||||
# when they do.
|
||||
#
|
||||
# Convention mirrors lair/claude-desktop-package: package and publish on the
|
||||
# `rpm` runner, sign with RPM_SIGNING_KEY, rsync to oolon, createrepo under
|
||||
# flock. The compile happens first on a podman runner rather than on the rpm
|
||||
# runner, so this never depends on a host toolchain matching the pinned
|
||||
# nightly in rust-toolchain.toml.
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "crates/**"
|
||||
- "packages/local-web/**"
|
||||
- "packages/web-core/**"
|
||||
- "packages/ui/**"
|
||||
- "shared/**"
|
||||
- "Cargo.toml"
|
||||
- "Cargo.lock"
|
||||
- "rust-toolchain.toml"
|
||||
- "rpm/**"
|
||||
- ".gitea/workflows/host-release.yml"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: host-release
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on:
|
||||
- metal
|
||||
- podman
|
||||
timeout-minutes: 120
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: derive version
|
||||
id: meta
|
||||
run: |
|
||||
set -euo pipefail
|
||||
echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
|
||||
echo "commit=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: build the host binary
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# --target export writes the binary straight out of the scratch stage,
|
||||
# so nothing has to be extracted from an image afterwards.
|
||||
mkdir -p out
|
||||
podman build --pull=newer \
|
||||
-f rpm/Containerfile \
|
||||
--target export \
|
||||
--output type=local,dest=out \
|
||||
.
|
||||
test -s out/vibe-kanban
|
||||
chmod 0755 out/vibe-kanban
|
||||
file out/vibe-kanban || true
|
||||
|
||||
- name: sanity-check the binary
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# The whole point of building our own: upstream's carries the sunset.
|
||||
if grep -qa "Project functionality has been retired" out/vibe-kanban; then
|
||||
echo "ERROR: the sunset page is embedded in the host binary."
|
||||
echo "The revert of #3387 has been lost -- refusing to publish."
|
||||
exit 1
|
||||
fi
|
||||
if grep -qa "Cloud is shutting down" out/vibe-kanban; then
|
||||
echo "ERROR: the cloud-shutdown banner is embedded in the host binary."
|
||||
exit 1
|
||||
fi
|
||||
# And it must point at us, not at api.vibekanban.com.
|
||||
grep -qa "kanban.internal" out/vibe-kanban \
|
||||
|| { echo "ERROR: baked API base missing from the binary"; exit 1; }
|
||||
echo "ok: no sunset UI, lair endpoints baked in"
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: host-binary
|
||||
path: out/vibe-kanban
|
||||
retention-days: 7
|
||||
|
||||
outputs:
|
||||
version: ${{ steps.meta.outputs.version }}
|
||||
commit: ${{ steps.meta.outputs.commit }}
|
||||
|
||||
package:
|
||||
needs: build
|
||||
runs-on: rpm
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
fedora_version: ["43", "44"]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: host-binary
|
||||
path: bin/
|
||||
|
||||
- name: rpmbuild
|
||||
run: |
|
||||
set -euo pipefail
|
||||
find bin/ -name vibe-kanban -exec mv --target-directory=bin/ {} + 2>/dev/null || true
|
||||
mkdir -p ~/rpmbuild/SOURCES
|
||||
install -m 0755 bin/vibe-kanban ~/rpmbuild/SOURCES/vibe-kanban
|
||||
rpmbuild -bb rpm/vibe-kanban.spec \
|
||||
--define "vk_version ${{ needs.build.outputs.version }}" \
|
||||
--define "vk_commit ${{ needs.build.outputs.commit }}" \
|
||||
--define "dist .fc${{ matrix.fedora_version }}"
|
||||
ls -l ~/rpmbuild/RPMS/x86_64/
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: rpm-fc${{ matrix.fedora_version }}
|
||||
path: ~/rpmbuild/RPMS/x86_64/*.rpm
|
||||
retention-days: 7
|
||||
|
||||
publish:
|
||||
needs: package
|
||||
runs-on: rpm
|
||||
env:
|
||||
RPM_REPO_HOST: oolon.kosherinata.internal
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
fedora_version: ["43", "44"]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: rpm-fc${{ matrix.fedora_version }}
|
||||
path: rpms/
|
||||
|
||||
- name: Flatten RPM artifacts
|
||||
run: |
|
||||
find rpms/ -name '*.rpm' -exec mv --target-directory=rpms/ {} +
|
||||
find rpms/ -mindepth 1 -type d -empty -delete
|
||||
|
||||
- name: Import signing key
|
||||
run: |
|
||||
echo "${{ secrets.RPM_SIGNING_KEY }}" | gpg --batch --import
|
||||
fpr=$(gpg --batch --with-colons --list-keys "${{ secrets.RPM_SIGNING_KEY_ID }}" | awk -F: '/^fpr:/ { print $10; exit }')
|
||||
echo "${fpr}:6:" | gpg --batch --import-ownertrust
|
||||
sed "s/@GPG_NAME@/${{ secrets.RPM_SIGNING_KEY_ID }}/" rpm/rpmmacros > ~/.rpmmacros
|
||||
|
||||
- name: Sign RPMs
|
||||
run: |
|
||||
for rpm in rpms/*.rpm; do
|
||||
echo "signing ${rpm}..."
|
||||
rpm --addsign "${rpm}"
|
||||
done
|
||||
|
||||
- name: Set up SSH
|
||||
run: |
|
||||
install --directory --mode 700 ~/.ssh
|
||||
echo "${RSYNC_SSH_KEY}" | install --mode 600 /dev/stdin ~/.ssh/id_ed25519
|
||||
env:
|
||||
RSYNC_SSH_KEY: ${{ secrets.RSYNC_SSH_KEY }}
|
||||
|
||||
- name: Test SSH connectivity
|
||||
run: |
|
||||
ssh -o StrictHostKeyChecking=accept-new "gitea_ci@${RPM_REPO_HOST}" exit
|
||||
|
||||
- name: Sync RPMs to repo
|
||||
run: |
|
||||
rsync \
|
||||
--archive \
|
||||
--verbose \
|
||||
--chmod D755,F644 \
|
||||
rpms/*.rpm \
|
||||
"gitea_ci@${RPM_REPO_HOST}:/var/www/rpm/fedora/${{ matrix.fedora_version }}/x86_64/"
|
||||
|
||||
- name: Update repo metadata
|
||||
run: |
|
||||
# flock guards createrepo against concurrent publishes into the
|
||||
# shared repo tree (other package repos publish here too).
|
||||
ssh "gitea_ci@${RPM_REPO_HOST}" \
|
||||
"flock /var/www/rpm/.publish.lock -c 'cd /var/www/rpm/fedora/${{ matrix.fedora_version }}/x86_64 && createrepo_c --update .'"
|
||||
|
||||
- name: Generate packages.json
|
||||
run: |
|
||||
scp rpm/generate-packages-json.py "gitea_ci@${RPM_REPO_HOST}:/tmp/"
|
||||
ssh "gitea_ci@${RPM_REPO_HOST}" \
|
||||
"flock /var/www/rpm/.publish.lock -c 'python3 /tmp/generate-packages-json.py \
|
||||
--repodata-dir /var/www/rpm/fedora/${{ matrix.fedora_version }}/x86_64/repodata \
|
||||
--output /var/www/rpm/fedora/${{ matrix.fedora_version }}/x86_64/packages.json \
|
||||
--base-url https://rpm.lair.cafe/fedora/${{ matrix.fedora_version }}/x86_64'"
|
||||
@@ -33,19 +33,19 @@ runs:
|
||||
|
||||
- name: Install Rust toolchain
|
||||
if: ${{ inputs.components == '' }}
|
||||
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: ${{ inputs.toolchain }}
|
||||
|
||||
- name: Install Rust toolchain with components
|
||||
if: ${{ inputs.components != '' }}
|
||||
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: ${{ inputs.toolchain }}
|
||||
components: ${{ inputs.components }}
|
||||
|
||||
- name: Cache Rust dependencies
|
||||
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
|
||||
uses: Swatinem/rust-cache@v2
|
||||
env:
|
||||
RUST_CACHE_DEBUG: true
|
||||
with:
|
||||
|
||||
43
.github/actions/setup-jsign/action.yml
vendored
43
.github/actions/setup-jsign/action.yml
vendored
@@ -1,43 +0,0 @@
|
||||
name: 'Setup Jsign'
|
||||
description: 'Downloads and caches Jsign for cross-platform Windows code signing'
|
||||
|
||||
inputs:
|
||||
version:
|
||||
description: 'Jsign version'
|
||||
required: false
|
||||
default: '7.4'
|
||||
sha256:
|
||||
description: 'Expected SHA256 of the jar'
|
||||
required: false
|
||||
default: '2abf2ade9ea322acc2d60c24794eadc465ff9380938fca4c932d09e0b25f1c28'
|
||||
|
||||
outputs:
|
||||
jar-path:
|
||||
description: 'Path to the Jsign jar'
|
||||
value: ${{ steps.path.outputs.jar }}
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Set jar path
|
||||
id: path
|
||||
shell: bash
|
||||
run: echo "jar=${{ runner.temp }}/jsign-${{ inputs.version }}.jar" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache Jsign
|
||||
id: cache
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ steps.path.outputs.jar }}
|
||||
key: jsign-${{ inputs.version }}-${{ inputs.sha256 }}
|
||||
|
||||
- name: Download Jsign
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
curl -sL "https://github.com/ebourg/jsign/releases/download/${{ inputs.version }}/jsign-${{ inputs.version }}.jar" \
|
||||
-o "${{ steps.path.outputs.jar }}"
|
||||
|
||||
- name: Verify checksum
|
||||
shell: bash
|
||||
run: echo "${{ inputs.sha256 }} ${{ steps.path.outputs.jar }}" | sha256sum -c -
|
||||
2
.github/actions/setup-node/action.yml
vendored
2
.github/actions/setup-node/action.yml
vendored
@@ -11,7 +11,7 @@ runs:
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: ${{ env.PNPM_VERSION }}
|
||||
|
||||
|
||||
1029
.github/workflows/pre-release.yml
vendored
Normal file
1029
.github/workflows/pre-release.yml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
169
.github/workflows/publish.yml
vendored
Normal file
169
.github/workflows/publish.yml
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
name: Publish to npm
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag_name:
|
||||
description: "Release tag (e.g., v1.2.3)"
|
||||
required: true
|
||||
release_id:
|
||||
description: "GitHub release ID"
|
||||
required: true
|
||||
|
||||
concurrency:
|
||||
group: publish
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
id-token: write # Required for OIDC trusted publishing
|
||||
|
||||
env:
|
||||
NODE_VERSION: 22
|
||||
PNPM_VERSION: 10.13.1
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
# Only run for main app releases (not remote-v* tags) that were converted from pre-release
|
||||
if: github.event.release.prerelease == false && !startsWith(github.event.release.tag_name, 'remote-')
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.event.release.tag_name || inputs.tag_name }}
|
||||
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
- name: Upgrade npm for OIDC support
|
||||
run: npm install -g npm@latest
|
||||
|
||||
- name: Download release assets
|
||||
uses: actions/github-script@v8
|
||||
env:
|
||||
RELEASE_ID: ${{ inputs.release_id }}
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const releaseId = context.payload.release?.id || process.env.RELEASE_ID;
|
||||
console.log("releaseId:", releaseId);
|
||||
|
||||
if (!releaseId) {
|
||||
core.setFailed('No release ID found.');
|
||||
return;
|
||||
}
|
||||
|
||||
const release = await github.rest.repos.getRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
release_id: releaseId
|
||||
});
|
||||
|
||||
// Find the .tgz file
|
||||
const tgzAsset = release.data.assets.find(asset => asset.name.endsWith('.tgz'));
|
||||
|
||||
if (!tgzAsset) {
|
||||
core.setFailed('No .tgz file found in release assets');
|
||||
return;
|
||||
}
|
||||
|
||||
// Download the asset
|
||||
const response = await github.rest.repos.getReleaseAsset({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
asset_id: tgzAsset.id,
|
||||
headers: {
|
||||
Accept: 'application/octet-stream'
|
||||
}
|
||||
});
|
||||
|
||||
// Save to npx-cli directory
|
||||
const filePath = path.join('npx-cli', tgzAsset.name);
|
||||
fs.writeFileSync(filePath, Buffer.from(response.data));
|
||||
|
||||
console.log(`Downloaded ${tgzAsset.name} to ${filePath}`);
|
||||
|
||||
// Set output for next step
|
||||
core.setOutput('package-file', filePath);
|
||||
core.setOutput('package-name', tgzAsset.name);
|
||||
|
||||
- name: Verify package integrity
|
||||
id: verify
|
||||
run: |
|
||||
cd npx-cli
|
||||
|
||||
# List files to confirm download
|
||||
ls -la *.tgz
|
||||
|
||||
# Verify the package can be read
|
||||
npm pack --dry-run || echo "Note: This is expected to show differences since we're using the pre-built package"
|
||||
|
||||
# Extract package name from the downloaded file
|
||||
PACKAGE_FILE=$(ls *.tgz | head -n1)
|
||||
echo "package-file=$PACKAGE_FILE" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Publish to npm
|
||||
run: |
|
||||
cd npx-cli
|
||||
|
||||
# Publish the exact same package that was tested
|
||||
PACKAGE_FILE="${{ steps.verify.outputs.package-file }}"
|
||||
|
||||
echo "Publishing $PACKAGE_FILE to npm..."
|
||||
npm publish "$PACKAGE_FILE" --provenance --access public
|
||||
|
||||
echo "✅ Successfully published to npm!"
|
||||
|
||||
- name: Update release description
|
||||
uses: actions/github-script@v8
|
||||
env:
|
||||
RELEASE_ID: ${{ inputs.release_id }}
|
||||
with:
|
||||
script: |
|
||||
const releaseId = context.payload.release?.id || process.env.RELEASE_ID;;
|
||||
|
||||
// Fetch the release to get the current body
|
||||
const release = await github.rest.repos.getRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
release_id: releaseId
|
||||
});
|
||||
|
||||
const currentBody = release.data.body || '';
|
||||
await github.rest.repos.updateRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
release_id: releaseId,
|
||||
body: currentBody + '\n\n✅ **Published to npm registry**'
|
||||
});
|
||||
|
||||
# Promote the tag-specific Tauri update manifest to the fixed endpoint
|
||||
# so existing desktop app users receive the update notification.
|
||||
promote-tauri-update:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.release.prerelease == false && !startsWith(github.event.release.tag_name, 'remote-')
|
||||
steps:
|
||||
- name: Configure AWS CLI for R2
|
||||
run: |
|
||||
aws configure set aws_access_key_id ${{ secrets.R2_BINARIES_ACCESS_KEY_ID }}
|
||||
aws configure set aws_secret_access_key ${{ secrets.R2_BINARIES_SECRET_ACCESS_KEY }}
|
||||
aws configure set default.region auto
|
||||
|
||||
- name: Copy update manifest to live endpoint
|
||||
run: |
|
||||
TAG="${{ github.event.release.tag_name || inputs.tag_name }}"
|
||||
ENDPOINT="${{ secrets.R2_BINARIES_ENDPOINT }}"
|
||||
BUCKET="${{ secrets.R2_BINARIES_BUCKET }}"
|
||||
|
||||
echo "Promoting update manifest for $TAG to live endpoint..."
|
||||
aws s3 cp \
|
||||
"s3://$BUCKET/binaries/$TAG/tauri/latest.json" \
|
||||
"s3://$BUCKET/binaries/tauri-update/latest.json" \
|
||||
--endpoint-url "$ENDPOINT" --content-type "application/json"
|
||||
|
||||
echo "Update manifest promoted: binaries/tauri-update/latest.json"
|
||||
28
.github/workflows/relay-deploy-dev.yml
vendored
Normal file
28
.github/workflows/relay-deploy-dev.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: Relay Deploy Dev
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- crates/relay-tunnel/**
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
run-relay-deploy:
|
||||
name: Deploy Relay Dev
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Dispatch dev relay deployment workflow
|
||||
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
|
||||
with:
|
||||
token: ${{ secrets.REMOTE_DEPLOYMENT_TOKEN }}
|
||||
repository: BloopAI/vibe-kanban-remote-deployment
|
||||
event-type: vibe-kanban-relay-deploy-dev
|
||||
client-payload: |
|
||||
{
|
||||
"ref": "${{ github.ref_name }}",
|
||||
"sha": "${{ github.sha }}"
|
||||
}
|
||||
108
.github/workflows/relay-deploy-prod.yml
vendored
Normal file
108
.github/workflows/relay-deploy-prod.yml
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
name: Deploy Relay Prod
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version_type:
|
||||
description: "Version bump type"
|
||||
required: true
|
||||
default: "patch"
|
||||
type: choice
|
||||
options:
|
||||
- patch
|
||||
- minor
|
||||
- major
|
||||
|
||||
concurrency:
|
||||
group: relay-deploy-${{ github.ref_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
RUST_TOOLCHAIN: nightly-2025-12-04
|
||||
|
||||
jobs:
|
||||
release-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cache cargo-edit
|
||||
uses: actions/cache@v5
|
||||
id: cache-cargo-edit
|
||||
with:
|
||||
path: ~/.cargo/bin/cargo-set-version
|
||||
key: cargo-edit-${{ runner.os }}-${{ env.RUST_TOOLCHAIN }}
|
||||
|
||||
- name: Install cargo-edit
|
||||
if: steps.cache-cargo-edit.outputs.cache-hit != 'true'
|
||||
run: cargo install cargo-edit
|
||||
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
ssh-key: ${{ secrets.DEPLOY_KEY }}
|
||||
|
||||
- name: Determine and update version
|
||||
id: version
|
||||
run: |
|
||||
# Get current version from crates/relay-tunnel/Cargo.toml
|
||||
current_version=$(grep '^version = ' crates/relay-tunnel/Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
||||
echo "Current relay-tunnel version: $current_version"
|
||||
|
||||
# Parse version components
|
||||
IFS='.' read -r major minor patch <<< "$current_version"
|
||||
|
||||
# Bump based on type
|
||||
case "${{ github.event.inputs.version_type }}" in
|
||||
major)
|
||||
major=$((major + 1))
|
||||
minor=0
|
||||
patch=0
|
||||
;;
|
||||
minor)
|
||||
minor=$((minor + 1))
|
||||
patch=0
|
||||
;;
|
||||
patch)
|
||||
patch=$((patch + 1))
|
||||
;;
|
||||
esac
|
||||
|
||||
new_version="${major}.${minor}.${patch}"
|
||||
new_tag="relay-v${new_version}"
|
||||
|
||||
# Update version in crates/relay-tunnel/Cargo.toml
|
||||
cd crates/relay-tunnel
|
||||
cargo set-version "$new_version"
|
||||
cargo update relay-tunnel
|
||||
cd ../..
|
||||
|
||||
echo "New version: $new_version"
|
||||
echo "New tag: $new_tag"
|
||||
echo "new_version=$new_version" >> $GITHUB_OUTPUT
|
||||
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
|
||||
echo "new_ref=$new_tag" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Commit changes and create tag
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add crates/relay-tunnel/Cargo.toml crates/relay-tunnel/Cargo.lock
|
||||
git commit -m "chore: bump relay-tunnel version to ${{ steps.version.outputs.new_version }}"
|
||||
git tag -a ${{ steps.version.outputs.new_tag }} -m "Relay release ${{ steps.version.outputs.new_tag }}"
|
||||
git push
|
||||
git push --tags
|
||||
|
||||
- name: Dispatch relay deployment workflow
|
||||
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
|
||||
with:
|
||||
token: ${{ secrets.REMOTE_DEPLOYMENT_TOKEN }}
|
||||
repository: BloopAI/vibe-kanban-remote-deployment
|
||||
event-type: vibe-kanban-relay-deploy-prod
|
||||
client-payload: |
|
||||
{
|
||||
"ref": "${{ steps.version.outputs.new_ref }}",
|
||||
"sha": "${{ github.sha }}",
|
||||
"version": "${{ steps.version.outputs.new_version }}"
|
||||
}
|
||||
22
.github/workflows/relay-release.yml
vendored
Normal file
22
.github/workflows/relay-release.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Create Relay Release
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: [relay-deploy-success]
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.event.client_payload.tag }}
|
||||
name: ${{ github.event.client_payload.tag }}
|
||||
generate_release_notes: true
|
||||
body: |
|
||||
## Relay Tunnel Service Release
|
||||
|
||||
Deployed to ${{ github.event.client_payload.environment }}
|
||||
29
.github/workflows/remote-deploy-dev.yml
vendored
Normal file
29
.github/workflows/remote-deploy-dev.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Remote Deploy Dev
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- crates/remote/**
|
||||
- packages/remote-web/**
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
run-remote-deploy:
|
||||
name: Deploy Remote Dev
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Dispatch dev remote deployment workflow
|
||||
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
|
||||
with:
|
||||
token: ${{ secrets.REMOTE_DEPLOYMENT_TOKEN }}
|
||||
repository: BloopAI/vibe-kanban-remote-deployment
|
||||
event-type: vibe-kanban-remote-deploy-dev
|
||||
client-payload: |
|
||||
{
|
||||
"ref": "${{ github.ref_name }}",
|
||||
"sha": "${{ github.sha }}"
|
||||
}
|
||||
116
.github/workflows/remote-deploy-prod.yml
vendored
Normal file
116
.github/workflows/remote-deploy-prod.yml
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
name: Deploy Remote Prod
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version_type:
|
||||
description: "Version bump type"
|
||||
required: true
|
||||
default: "patch"
|
||||
type: choice
|
||||
options:
|
||||
- patch
|
||||
- minor
|
||||
- major
|
||||
|
||||
concurrency:
|
||||
group: remote-deploy-${{ github.ref_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
RUST_TOOLCHAIN: nightly-2025-12-04
|
||||
|
||||
jobs:
|
||||
release-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cache cargo-edit
|
||||
uses: actions/cache@v5
|
||||
id: cache-cargo-edit
|
||||
with:
|
||||
path: ~/.cargo/bin/cargo-set-version
|
||||
key: cargo-edit-${{ runner.os }}-${{ env.RUST_TOOLCHAIN }}
|
||||
|
||||
- name: Install cargo-edit
|
||||
if: steps.cache-cargo-edit.outputs.cache-hit != 'true'
|
||||
run: cargo install cargo-edit
|
||||
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
ssh-key: ${{ secrets.DEPLOY_KEY }}
|
||||
|
||||
- name: Setup SSH Agent for private dependencies
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.VK_PRIVATE_DEPLOY_KEY }}
|
||||
|
||||
- name: Determine and update version
|
||||
id: version
|
||||
run: |
|
||||
# Get current version from crates/remote/Cargo.toml
|
||||
current_version=$(grep '^version = ' crates/remote/Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
||||
echo "Current remote version: $current_version"
|
||||
|
||||
# Parse version components
|
||||
IFS='.' read -r major minor patch <<< "$current_version"
|
||||
|
||||
# Bump based on type
|
||||
case "${{ github.event.inputs.version_type }}" in
|
||||
major)
|
||||
major=$((major + 1))
|
||||
minor=0
|
||||
patch=0
|
||||
;;
|
||||
minor)
|
||||
minor=$((minor + 1))
|
||||
patch=0
|
||||
;;
|
||||
patch)
|
||||
patch=$((patch + 1))
|
||||
;;
|
||||
esac
|
||||
|
||||
new_version="${major}.${minor}.${patch}"
|
||||
new_tag="remote-v${new_version}"
|
||||
|
||||
# Update version in crates/remote/Cargo.toml
|
||||
cd crates/remote
|
||||
cargo set-version "$new_version"
|
||||
cargo update remote
|
||||
cd ../..
|
||||
|
||||
echo "New version: $new_version"
|
||||
echo "New tag: $new_tag"
|
||||
echo "new_version=$new_version" >> $GITHUB_OUTPUT
|
||||
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
|
||||
echo "new_ref=$new_tag" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Stop SSH agent
|
||||
run: ssh-agent -k
|
||||
|
||||
- name: Commit changes and create tag
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add crates/remote/Cargo.toml crates/remote/Cargo.lock
|
||||
git commit -m "chore: bump remote version to ${{ steps.version.outputs.new_version }}"
|
||||
git tag -a ${{ steps.version.outputs.new_tag }} -m "Remote release ${{ steps.version.outputs.new_tag }}"
|
||||
git push
|
||||
git push --tags
|
||||
|
||||
- name: Dispatch remote deployment workflow
|
||||
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
|
||||
with:
|
||||
token: ${{ secrets.REMOTE_DEPLOYMENT_TOKEN }}
|
||||
repository: BloopAI/vibe-kanban-remote-deployment
|
||||
event-type: vibe-kanban-remote-deploy-prod
|
||||
client-payload: |
|
||||
{
|
||||
"ref": "${{ steps.version.outputs.new_ref }}",
|
||||
"sha": "${{ github.sha }}",
|
||||
"version": "${{ steps.version.outputs.new_version }}"
|
||||
}
|
||||
22
.github/workflows/remote-release.yml
vendored
Normal file
22
.github/workflows/remote-release.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Create Remote Release
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: [remote-deploy-success]
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.event.client_payload.tag }}
|
||||
name: ${{ github.event.client_payload.tag }}
|
||||
generate_release_notes: true
|
||||
body: |
|
||||
## Remote Service Release
|
||||
|
||||
✅ Deployed to ${{ github.event.client_payload.environment }}
|
||||
304
.github/workflows/test.yml
vendored
Normal file
304
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,304 @@
|
||||
name: Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- .github/workflows/**
|
||||
- '!.github/workflows/test.yml'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
NODE_VERSION: 22
|
||||
PNPM_VERSION: 10.13.1
|
||||
RUST_TOOLCHAIN: nightly-2025-12-04
|
||||
RUNNER_LABEL: &runner_label blacksmith-16vcpu-ubuntu-2404
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: *runner_label
|
||||
if: github.event_name == 'pull_request'
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
outputs:
|
||||
frontend: ${{ steps.filter.outputs.frontend }}
|
||||
backend: ${{ steps.filter.outputs.backend }}
|
||||
backend-remote: ${{ steps.filter.outputs['backend-remote'] }}
|
||||
tauri: ${{ steps.filter.outputs.tauri }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
frontend:
|
||||
- 'packages/local-web/**'
|
||||
- 'packages/web-core/**'
|
||||
- 'packages/remote-web/**'
|
||||
- 'packages/ui/**'
|
||||
- 'shared/**'
|
||||
- 'scripts/check-i18n.sh'
|
||||
- 'scripts/check-unused-i18n-keys.mjs'
|
||||
- 'scripts/check-legacy-frontend-paths.sh'
|
||||
- 'scripts/legacy-frontend-paths-allowlist.txt'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'pnpm-workspace.yaml'
|
||||
- 'package.json'
|
||||
- '.npmrc'
|
||||
- '.github/workflows/test.yml'
|
||||
- '.github/actions/**'
|
||||
backend:
|
||||
- 'crates/api-types/**'
|
||||
- 'crates/db/**'
|
||||
- 'crates/deployment/**'
|
||||
- 'crates/executors/**'
|
||||
- 'crates/git/**'
|
||||
- 'crates/local-deployment/**'
|
||||
- 'crates/mcp/**'
|
||||
- 'crates/review/**'
|
||||
- 'crates/server/**'
|
||||
- 'crates/services/**'
|
||||
- 'crates/utils/**'
|
||||
- 'Cargo.toml'
|
||||
- 'Cargo.lock'
|
||||
- 'shared/**'
|
||||
- 'scripts/prepare-db.js'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'package.json'
|
||||
- 'rustfmt.toml'
|
||||
- 'rust-toolchain.toml'
|
||||
- '.cargo/**'
|
||||
- '.github/workflows/test.yml'
|
||||
- '.github/actions/**'
|
||||
backend-remote:
|
||||
- 'crates/remote/**'
|
||||
- 'crates/relay-tunnel/**'
|
||||
- 'crates/api-types/**'
|
||||
- 'crates/utils/**'
|
||||
- 'Cargo.toml'
|
||||
- 'Cargo.lock'
|
||||
- 'shared/**'
|
||||
- 'rustfmt.toml'
|
||||
- 'rust-toolchain.toml'
|
||||
- '.cargo/**'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'package.json'
|
||||
- '.github/workflows/test.yml'
|
||||
- '.github/actions/**'
|
||||
tauri:
|
||||
- 'crates/tauri-app/**'
|
||||
- 'crates/api-types/**'
|
||||
- 'crates/db/**'
|
||||
- 'crates/deployment/**'
|
||||
- 'crates/executors/**'
|
||||
- 'crates/git/**'
|
||||
- 'crates/local-deployment/**'
|
||||
- 'crates/mcp/**'
|
||||
- 'crates/review/**'
|
||||
- 'crates/server/**'
|
||||
- 'crates/services/**'
|
||||
- 'crates/utils/**'
|
||||
- 'Cargo.toml'
|
||||
- 'Cargo.lock'
|
||||
- 'rustfmt.toml'
|
||||
- 'rust-toolchain.toml'
|
||||
- '.cargo/**'
|
||||
- 'package.json'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'pnpm-workspace.yaml'
|
||||
- '.npmrc'
|
||||
- '.github/workflows/test.yml'
|
||||
- '.github/actions/**'
|
||||
|
||||
frontend-checks:
|
||||
needs: changes
|
||||
if: always() && (needs.changes.outputs.frontend == 'true' || needs.changes.result == 'skipped')
|
||||
runs-on: *runner_label
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Run frontend checks
|
||||
env:
|
||||
NODE_OPTIONS: --max-old-space-size=8192
|
||||
run: |
|
||||
npx concurrently \
|
||||
--kill-others-on-fail \
|
||||
--names "local:lint,local:fmt,local:build,remote:fmt,remote:build,ui:check,ui:lint,ui:fmt,core:check,core:fmt,i18n,i18n:unused,legacy" \
|
||||
--timings \
|
||||
"cd packages/local-web && npm run lint" \
|
||||
"cd packages/local-web && npm run format:check" \
|
||||
"cd packages/local-web && npm run build" \
|
||||
"cd packages/remote-web && npm run format:check" \
|
||||
"cd packages/remote-web && npm run build" \
|
||||
"cd packages/ui && npm run check" \
|
||||
"cd packages/ui && npm run lint" \
|
||||
"cd packages/ui && npm run format:check" \
|
||||
"cd packages/web-core && npm run check" \
|
||||
"cd packages/web-core && npm run format:check" \
|
||||
"GITHUB_BASE_REF=${{ github.base_ref || 'main' }} ./scripts/check-i18n.sh" \
|
||||
"node scripts/check-unused-i18n-keys.mjs" \
|
||||
"./scripts/check-legacy-frontend-paths.sh"
|
||||
|
||||
backend-schema-checks:
|
||||
needs: changes
|
||||
if: always() && (needs.changes.outputs.backend == 'true' || needs.changes.result == 'skipped')
|
||||
runs-on: *runner_label
|
||||
env:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Rust
|
||||
uses: ./.github/actions/cargo-checks-common-setup
|
||||
with:
|
||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||
cache-key: backend-schema-checks-${{ runner.os }}-${{ runner.arch }}-${{ env.RUNNER_LABEL }}
|
||||
setup-node: 'true'
|
||||
setup-sqlx-cli: 'true'
|
||||
|
||||
- name: Check generated types
|
||||
run: npm run generate-types:check
|
||||
|
||||
- name: Sqlx checks
|
||||
run: npm run prepare-db:check
|
||||
|
||||
backend-remote-checks:
|
||||
needs: changes
|
||||
if: >-
|
||||
always()
|
||||
&& (needs.changes.outputs['backend-remote'] == 'true' || needs.changes.result == 'skipped')
|
||||
&& (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
|
||||
runs-on: *runner_label
|
||||
env:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Rust
|
||||
uses: ./.github/actions/cargo-checks-common-setup
|
||||
with:
|
||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||
components: rustfmt, clippy
|
||||
cache-key: backend-remote-checks-${{ runner.os }}-${{ runner.arch }}-${{ env.RUNNER_LABEL }}
|
||||
setup-node: 'true'
|
||||
setup-sqlx-cli: 'true'
|
||||
|
||||
- name: Setup SSH Agent for private dependencies
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.VK_PRIVATE_DEPLOY_KEY }}
|
||||
|
||||
- name: Check remote Cargo.lock is consistent
|
||||
run: |
|
||||
cargo metadata --locked --format-version 1 --manifest-path crates/remote/Cargo.toml > /dev/null
|
||||
cargo metadata --locked --format-version 1 --manifest-path crates/relay-tunnel/Cargo.toml > /dev/null
|
||||
|
||||
- name: Check formatting
|
||||
run: |
|
||||
cargo fmt --all --manifest-path crates/remote/Cargo.toml -- --check
|
||||
cargo fmt --all --manifest-path crates/relay-tunnel/Cargo.toml -- --check
|
||||
|
||||
- name: Run Clippy
|
||||
run: |
|
||||
cargo clippy --all-targets --manifest-path crates/remote/Cargo.toml -- -D warnings
|
||||
cargo clippy --all-targets --manifest-path crates/relay-tunnel/Cargo.toml -- -D warnings
|
||||
|
||||
- name: Check generated types
|
||||
run: npm run remote:generate-types:check
|
||||
|
||||
- name: Sqlx checks
|
||||
run: npm run remote:prepare-db:check
|
||||
|
||||
backend-clippy:
|
||||
needs: changes
|
||||
if: always() && (needs.changes.outputs.backend == 'true' || needs.changes.result == 'skipped')
|
||||
runs-on: *runner_label
|
||||
env:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Rust
|
||||
uses: ./.github/actions/cargo-checks-common-setup
|
||||
with:
|
||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||
components: rustfmt, clippy
|
||||
cache-key: backend-clippy-${{ runner.os }}-${{ runner.arch }}-${{ env.RUNNER_LABEL }}
|
||||
|
||||
- name: Run Clippy and fmt checks
|
||||
run: |
|
||||
set -x
|
||||
cargo fmt --all -- --check & pid_fmt=$!
|
||||
cargo clippy --workspace --all-targets --exclude vibe-kanban-tauri -- -D warnings
|
||||
wait $pid_fmt
|
||||
|
||||
backend-test:
|
||||
needs: changes
|
||||
if: always() && (needs.changes.outputs.backend == 'true' || needs.changes.result == 'skipped')
|
||||
runs-on: *runner_label
|
||||
env:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Rust
|
||||
uses: ./.github/actions/cargo-checks-common-setup
|
||||
with:
|
||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||
cache-key: backend-test-${{ runner.os }}-${{ runner.arch }}-${{ env.RUNNER_LABEL }}
|
||||
|
||||
- name: Install cargo-nextest
|
||||
uses: taiki-e/install-action@nextest
|
||||
|
||||
- name: Run Cargo tests
|
||||
run: cargo nextest run --workspace --exclude vibe-kanban-tauri
|
||||
|
||||
tauri-checks:
|
||||
needs: changes
|
||||
if: always() && (needs.changes.outputs.tauri == 'true' || needs.changes.result == 'skipped')
|
||||
runs-on: *runner_label
|
||||
env:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Rust
|
||||
uses: ./.github/actions/cargo-checks-common-setup
|
||||
with:
|
||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||
components: rustfmt, clippy
|
||||
cache-key: tauri-checks-${{ runner.os }}-${{ runner.arch }}-${{ env.RUNNER_LABEL }}
|
||||
|
||||
- name: Install Linux dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential \
|
||||
libssl-dev libayatana-appindicator3-dev librsvg2-dev \
|
||||
libxdo-dev file pkg-config xdg-utils
|
||||
|
||||
- name: Run Tauri fmt, clippy, and compile checks
|
||||
run: |
|
||||
cargo fmt --all --manifest-path crates/tauri-app/Cargo.toml -- --check
|
||||
cargo clippy --all-targets --manifest-path crates/tauri-app/Cargo.toml -- -D warnings
|
||||
cargo check -p vibe-kanban-tauri
|
||||
@@ -55,4 +55,3 @@ Do not manually edit shared/remote-types.ts, instead edit crates/remote/src/bin/
|
||||
- Use `.env` for local overrides; never commit secrets. Key envs: `FRONTEND_PORT`, `BACKEND_PORT`, `HOST`
|
||||
- Dev ports and assets are managed by `scripts/setup-dev-environment.js`.
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
localhost:3001, relay.localhost:3001, *.relay.localhost:3001 {
|
||||
tls internal
|
||||
|
||||
@relay host relay.localhost *.relay.localhost
|
||||
handle @relay {
|
||||
reverse_proxy 127.0.0.1:8082
|
||||
}
|
||||
|
||||
@app expression `{http.request.host} == "localhost:3001" || {http.request.host} == "localhost"`
|
||||
handle @app {
|
||||
reverse_proxy 127.0.0.1:3000
|
||||
}
|
||||
|
||||
respond "not found" 404
|
||||
}
|
||||
3494
Cargo.lock
generated
3494
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
19
Cargo.toml
19
Cargo.toml
@@ -2,9 +2,7 @@
|
||||
resolver = "3"
|
||||
members = [
|
||||
"crates/api-types",
|
||||
"crates/relay-client",
|
||||
"crates/server",
|
||||
"crates/relay-types",
|
||||
"crates/trusted-key-auth",
|
||||
"crates/mcp",
|
||||
"crates/db",
|
||||
@@ -13,31 +11,21 @@ members = [
|
||||
"crates/worktree-manager",
|
||||
"crates/workspace-manager",
|
||||
"crates/relay-control",
|
||||
"crates/relay-protocol",
|
||||
"crates/relay-ws",
|
||||
"crates/ws-bridge",
|
||||
"crates/relay-hosts",
|
||||
"crates/client-info",
|
||||
"crates/remote-info",
|
||||
"crates/server-info",
|
||||
"crates/utils",
|
||||
"crates/git",
|
||||
"crates/git-host",
|
||||
"crates/local-deployment",
|
||||
"crates/deployment",
|
||||
"crates/review",
|
||||
"crates/embedded-ssh",
|
||||
"crates/desktop-bridge",
|
||||
"crates/tauri-app",
|
||||
"crates/preview-proxy",
|
||||
"crates/relay-tunnel-core",
|
||||
"crates/relay-webrtc",
|
||||
]
|
||||
exclude = ["crates/remote", "crates/relay-tunnel"]
|
||||
|
||||
[workspace.dependencies]
|
||||
tokio = { version = "1.0", features = ["full"] }
|
||||
axum = { version = "0.8.4", features = ["macros", "multipart", "ws"] }
|
||||
tower-http = { version = "0.5", features = ["cors", "request-id", "trace", "fs", "validate-request", "compression-gzip", "compression-br"] }
|
||||
tower-http = { version = "0.5", features = ["cors", "request-id", "trace", "fs", "validate-request"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = { version = "1.0", features = ["preserve_order"] }
|
||||
anyhow = "1.0"
|
||||
@@ -51,10 +39,9 @@ ts-rs = { git = "https://github.com/xazukx/ts-rs.git", branch = "use-ts-enum", f
|
||||
schemars = { version = "1.0.4", features = ["derive", "chrono04", "uuid1", "preserve_order"] }
|
||||
serde_with = "3"
|
||||
async-trait = "0.1"
|
||||
aws-lc-sys = "=0.37.0"
|
||||
aws-lc-rs = "=1.16.0"
|
||||
|
||||
[profile.release]
|
||||
debug = 1
|
||||
split-debuginfo = "packed"
|
||||
strip = true
|
||||
|
||||
|
||||
188
Dockerfile
188
Dockerfile
@@ -1,152 +1,82 @@
|
||||
# syntax=docker/dockerfile:1.6
|
||||
# Build stage
|
||||
FROM node:24-alpine AS builder
|
||||
|
||||
FROM node:24-alpine AS fe-builder
|
||||
# Install build dependencies
|
||||
RUN apk add --no-cache \
|
||||
curl \
|
||||
build-base \
|
||||
perl \
|
||||
llvm-dev \
|
||||
clang-dev
|
||||
|
||||
ARG POSTHOG_API_KEY=""
|
||||
ARG POSTHOG_API_ENDPOINT=""
|
||||
# Allow linking libclang on musl
|
||||
ENV RUSTFLAGS="-C target-feature=-crt-static"
|
||||
|
||||
# Install Rust
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||
|
||||
ARG POSTHOG_API_KEY
|
||||
ARG POSTHOG_API_ENDPOINT
|
||||
|
||||
ENV VITE_PUBLIC_POSTHOG_KEY=$POSTHOG_API_KEY
|
||||
ENV VITE_PUBLIC_POSTHOG_HOST=$POSTHOG_API_ENDPOINT
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
ENV PNPM_HOME=/pnpm
|
||||
ENV PATH=${PNPM_HOME}:${PATH}
|
||||
ENV VITE_PUBLIC_POSTHOG_KEY=${POSTHOG_API_KEY}
|
||||
ENV VITE_PUBLIC_POSTHOG_HOST=${POSTHOG_API_ENDPOINT}
|
||||
ENV NODE_OPTIONS=--max-old-space-size=4096
|
||||
# Copy package files for dependency caching
|
||||
COPY package*.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY packages/local-web/package*.json ./packages/local-web/
|
||||
COPY npx-cli/package*.json ./npx-cli/
|
||||
|
||||
RUN corepack enable
|
||||
RUN pnpm config set store-dir /pnpm/store
|
||||
# Install pnpm and dependencies
|
||||
RUN npm install -g pnpm && pnpm install
|
||||
|
||||
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./
|
||||
COPY packages/local-web/package.json packages/local-web/package.json
|
||||
COPY packages/ui/package.json packages/ui/package.json
|
||||
COPY packages/web-core/package.json packages/web-core/package.json
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||
pnpm install --frozen-lockfile
|
||||
# Build application
|
||||
RUN npm run generate-types
|
||||
RUN cd packages/local-web && pnpm run build
|
||||
RUN cargo build --release --bin server
|
||||
|
||||
COPY packages/local-web/ packages/local-web/
|
||||
COPY packages/public/ packages/public/
|
||||
COPY packages/ui/ packages/ui/
|
||||
COPY packages/web-core/ packages/web-core/
|
||||
COPY shared/ shared/
|
||||
# Runtime stage
|
||||
FROM alpine:latest AS runtime
|
||||
|
||||
RUN pnpm -C packages/local-web build
|
||||
|
||||
FROM rust:1.93-slim-bookworm AS builder
|
||||
|
||||
ARG POSTHOG_API_KEY=""
|
||||
ARG POSTHOG_API_ENDPOINT=""
|
||||
ARG SENTRY_DSN=""
|
||||
ARG VK_SHARED_API_BASE=""
|
||||
|
||||
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
||||
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
|
||||
ENV CARGO_TARGET_DIR=/app/target
|
||||
ENV POSTHOG_API_KEY=${POSTHOG_API_KEY}
|
||||
ENV POSTHOG_API_ENDPOINT=${POSTHOG_API_ENDPOINT}
|
||||
ENV SENTRY_DSN=${SENTRY_DSN}
|
||||
ENV VK_SHARED_API_BASE=${VK_SHARED_API_BASE}
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
# Install runtime dependencies
|
||||
RUN apk add --no-cache \
|
||||
ca-certificates \
|
||||
git \
|
||||
libclang-dev \
|
||||
libssl-dev \
|
||||
pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY rust-toolchain.toml ./
|
||||
RUN cargo --version >/dev/null
|
||||
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY crates/api-types/Cargo.toml crates/api-types/Cargo.toml
|
||||
COPY crates/db/Cargo.toml crates/db/Cargo.toml
|
||||
COPY crates/deployment/Cargo.toml crates/deployment/Cargo.toml
|
||||
COPY crates/executors/Cargo.toml crates/executors/Cargo.toml
|
||||
COPY crates/git/Cargo.toml crates/git/Cargo.toml
|
||||
COPY crates/git-host/Cargo.toml crates/git-host/Cargo.toml
|
||||
COPY crates/local-deployment/Cargo.toml crates/local-deployment/Cargo.toml
|
||||
COPY crates/mcp/Cargo.toml crates/mcp/Cargo.toml
|
||||
COPY crates/relay-control/Cargo.toml crates/relay-control/Cargo.toml
|
||||
COPY crates/relay-hosts/Cargo.toml crates/relay-hosts/Cargo.toml
|
||||
COPY crates/relay-protocol/Cargo.toml crates/relay-protocol/Cargo.toml
|
||||
COPY crates/relay-tunnel-core/Cargo.toml crates/relay-tunnel-core/Cargo.toml
|
||||
COPY crates/relay-webrtc/Cargo.toml crates/relay-webrtc/Cargo.toml
|
||||
COPY crates/relay-ws/Cargo.toml crates/relay-ws/Cargo.toml
|
||||
COPY crates/review/Cargo.toml crates/review/Cargo.toml
|
||||
COPY crates/server/Cargo.toml crates/server/Cargo.toml
|
||||
COPY crates/server-info/Cargo.toml crates/server-info/Cargo.toml
|
||||
COPY crates/services/Cargo.toml crates/services/Cargo.toml
|
||||
COPY crates/tauri-app/Cargo.toml crates/tauri-app/Cargo.toml
|
||||
COPY crates/trusted-key-auth/Cargo.toml crates/trusted-key-auth/Cargo.toml
|
||||
COPY crates/utils/Cargo.toml crates/utils/Cargo.toml
|
||||
COPY crates/workspace-manager/Cargo.toml crates/workspace-manager/Cargo.toml
|
||||
COPY crates/worktree-manager/Cargo.toml crates/worktree-manager/Cargo.toml
|
||||
COPY crates/ws-bridge/Cargo.toml crates/ws-bridge/Cargo.toml
|
||||
|
||||
COPY crates/api-types/ crates/api-types/
|
||||
COPY crates/db/ crates/db/
|
||||
COPY crates/deployment/ crates/deployment/
|
||||
COPY crates/executors/ crates/executors/
|
||||
COPY crates/git/ crates/git/
|
||||
COPY crates/git-host/ crates/git-host/
|
||||
COPY crates/local-deployment/ crates/local-deployment/
|
||||
COPY crates/mcp/ crates/mcp/
|
||||
COPY crates/relay-control/ crates/relay-control/
|
||||
COPY crates/relay-hosts/ crates/relay-hosts/
|
||||
COPY crates/relay-protocol/ crates/relay-protocol/
|
||||
COPY crates/relay-tunnel-core/ crates/relay-tunnel-core/
|
||||
COPY crates/relay-webrtc/ crates/relay-webrtc/
|
||||
COPY crates/relay-ws/ crates/relay-ws/
|
||||
COPY crates/review/ crates/review/
|
||||
COPY crates/server/ crates/server/
|
||||
COPY crates/server-info/ crates/server-info/
|
||||
COPY crates/services/ crates/services/
|
||||
COPY crates/trusted-key-auth/ crates/trusted-key-auth/
|
||||
COPY crates/utils/ crates/utils/
|
||||
COPY crates/workspace-manager/ crates/workspace-manager/
|
||||
COPY crates/worktree-manager/ crates/worktree-manager/
|
||||
COPY crates/ws-bridge/ crates/ws-bridge/
|
||||
COPY assets/ assets/
|
||||
COPY --from=fe-builder /app/packages/local-web/dist packages/local-web/dist
|
||||
|
||||
RUN --mount=type=cache,id=cargo-registry,target=/usr/local/cargo/registry \
|
||||
--mount=type=cache,id=cargo-git,target=/usr/local/cargo/git \
|
||||
--mount=type=cache,id=workspace-target,target=/app/target \
|
||||
cargo build --locked --release --bin server \
|
||||
&& cp /app/target/release/server /usr/local/bin/server
|
||||
|
||||
FROM debian:bookworm-slim AS runtime
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
git \
|
||||
openssh-client \
|
||||
tini \
|
||||
wget \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& useradd --system --create-home --uid 10001 appuser
|
||||
libgcc \
|
||||
wget
|
||||
|
||||
WORKDIR /repos
|
||||
# Create app user for security
|
||||
RUN addgroup -g 1001 -S appgroup && \
|
||||
adduser -u 1001 -S appuser -G appgroup
|
||||
|
||||
COPY --from=builder /usr/local/bin/server /usr/local/bin/server
|
||||
# Copy binary from builder
|
||||
COPY --from=builder /app/target/release/server /usr/local/bin/server
|
||||
|
||||
RUN mkdir -p /repos \
|
||||
&& chown -R appuser:appuser /repos
|
||||
# Create repos directory and set permissions
|
||||
RUN mkdir -p /repos && \
|
||||
chown -R appuser:appgroup /repos
|
||||
|
||||
# Switch to non-root user
|
||||
USER appuser
|
||||
|
||||
# Set runtime environment
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=3000
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD ["/bin/sh", "-c", "wget --spider -q http://127.0.0.1:${PORT:-3000}/health"]
|
||||
# Set working directory
|
||||
WORKDIR /repos
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/server"]
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget --quiet --tries=1 --spider "http://${HOST:-localhost}:${PORT:-3000}" || exit 1
|
||||
|
||||
# Run the application
|
||||
ENTRYPOINT ["/sbin/tini", "--"]
|
||||
CMD ["server"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "api-types"
|
||||
version = "0.1.44"
|
||||
version = "0.1.30"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
@@ -11,3 +11,4 @@ serde_json = { workspace = true }
|
||||
sqlx = { version = "0.8.6", default-features = false, features = ["postgres", "uuid", "chrono", "derive"] }
|
||||
ts-rs = { workspace = true }
|
||||
uuid = { version = "1.0", features = ["v4", "serde"] }
|
||||
base64 = "0.22"
|
||||
|
||||
@@ -5,6 +5,7 @@ use uuid::Uuid;
|
||||
|
||||
/// An attachment links a blob to an issue or comment.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[ts(export)]
|
||||
pub struct Attachment {
|
||||
pub id: Uuid,
|
||||
pub blob_id: Uuid,
|
||||
@@ -16,6 +17,7 @@ pub struct Attachment {
|
||||
|
||||
/// An attachment with its associated blob data (for API responses).
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[ts(export)]
|
||||
pub struct AttachmentWithBlob {
|
||||
pub id: Uuid,
|
||||
pub blob_id: Uuid,
|
||||
@@ -50,6 +52,7 @@ pub struct ListAttachmentsResponse {
|
||||
|
||||
/// Response containing a presigned URL for an attachment file or thumbnail.
|
||||
#[derive(Debug, Serialize, Deserialize, TS)]
|
||||
#[ts(export)]
|
||||
pub struct AttachmentUrlResponse {
|
||||
pub url: String,
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ pub struct AuthSession {
|
||||
pub revoked_at: Option<DateTime<Utc>>,
|
||||
pub refresh_token_id: Option<Uuid>,
|
||||
pub refresh_token_issued_at: Option<DateTime<Utc>>,
|
||||
pub previous_refresh_token_id: Option<Uuid>,
|
||||
pub previous_refresh_token_grace_expires_at: Option<DateTime<Utc>>,
|
||||
}
|
||||
|
||||
impl AuthSession {
|
||||
|
||||
@@ -4,6 +4,7 @@ use ts_rs::TS;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[ts(export)]
|
||||
pub struct Blob {
|
||||
pub id: Uuid,
|
||||
pub project_id: Uuid,
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use ts_rs::TS;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct ExportRequest {
|
||||
pub organization_id: Uuid,
|
||||
/// If empty, exports all projects in the organization.
|
||||
pub project_ids: Vec<Uuid>,
|
||||
pub include_attachments: bool,
|
||||
}
|
||||
@@ -17,7 +17,7 @@ pub enum IssuePriority {
|
||||
Low,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS, sqlx::FromRow)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct Issue {
|
||||
pub id: Uuid,
|
||||
pub project_id: Uuid,
|
||||
@@ -39,23 +39,6 @@ pub struct Issue {
|
||||
pub updated_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum IssueSortField {
|
||||
SortOrder,
|
||||
Priority,
|
||||
CreatedAt,
|
||||
UpdatedAt,
|
||||
Title,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum SortDirection {
|
||||
Asc,
|
||||
Desc,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct CreateIssueRequest {
|
||||
/// Optional client-generated ID. If not provided, server generates one.
|
||||
@@ -146,59 +129,12 @@ pub struct UpdateIssueRequest {
|
||||
pub extension_metadata: Option<Value>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct ListIssuesQuery {
|
||||
pub project_id: Uuid,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct SearchIssuesRequest {
|
||||
pub project_id: Uuid,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub status_id: Option<Uuid>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub status_ids: Option<Vec<Uuid>>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub priority: Option<IssuePriority>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub parent_issue_id: Option<Uuid>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub search: Option<String>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub simple_id: Option<String>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub assignee_user_id: Option<Uuid>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub tag_id: Option<Uuid>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub tag_ids: Option<Vec<Uuid>>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub sort_field: Option<IssueSortField>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub sort_direction: Option<SortDirection>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub limit: Option<i32>,
|
||||
#[ts(optional)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub offset: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct ListIssuesResponse {
|
||||
pub issues: Vec<Issue>,
|
||||
pub total_count: usize,
|
||||
pub limit: usize,
|
||||
pub offset: usize,
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ use serde::{Deserialize, Serialize};
|
||||
use ts_rs::TS;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::some_if_present;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct IssueAssignee {
|
||||
pub id: Uuid,
|
||||
@@ -21,6 +23,12 @@ pub struct CreateIssueAssigneeRequest {
|
||||
pub user_id: Uuid,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, TS)]
|
||||
pub struct UpdateIssueAssigneeRequest {
|
||||
#[serde(default, deserialize_with = "some_if_present")]
|
||||
pub user_id: Option<Uuid>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct ListIssueAssigneesQuery {
|
||||
pub issue_id: Uuid,
|
||||
|
||||
@@ -2,6 +2,8 @@ use serde::{Deserialize, Serialize};
|
||||
use ts_rs::TS;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::some_if_present;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct IssueFollower {
|
||||
pub id: Uuid,
|
||||
@@ -19,6 +21,12 @@ pub struct CreateIssueFollowerRequest {
|
||||
pub user_id: Uuid,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, TS)]
|
||||
pub struct UpdateIssueFollowerRequest {
|
||||
#[serde(default, deserialize_with = "some_if_present")]
|
||||
pub user_id: Option<Uuid>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct ListIssueFollowersQuery {
|
||||
pub issue_id: Uuid,
|
||||
|
||||
@@ -5,6 +5,8 @@ use sqlx::Type;
|
||||
use ts_rs::TS;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::some_if_present;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Type, TS, JsonSchema)]
|
||||
#[sqlx(type_name = "issue_relationship_type", rename_all = "snake_case")]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
@@ -34,6 +36,14 @@ pub struct CreateIssueRelationshipRequest {
|
||||
pub relationship_type: IssueRelationshipType,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, TS)]
|
||||
pub struct UpdateIssueRelationshipRequest {
|
||||
#[serde(default, deserialize_with = "some_if_present")]
|
||||
pub related_issue_id: Option<Uuid>,
|
||||
#[serde(default, deserialize_with = "some_if_present")]
|
||||
pub relationship_type: Option<IssueRelationshipType>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct ListIssueRelationshipsQuery {
|
||||
pub issue_id: Uuid,
|
||||
|
||||
@@ -2,6 +2,8 @@ use serde::{Deserialize, Serialize};
|
||||
use ts_rs::TS;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::some_if_present;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct IssueTag {
|
||||
pub id: Uuid,
|
||||
@@ -19,6 +21,12 @@ pub struct CreateIssueTagRequest {
|
||||
pub tag_id: Uuid,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, TS)]
|
||||
pub struct UpdateIssueTagRequest {
|
||||
#[serde(default, deserialize_with = "some_if_present")]
|
||||
pub tag_id: Option<Uuid>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct ListIssueTagsQuery {
|
||||
pub issue_id: Uuid,
|
||||
|
||||
@@ -10,7 +10,6 @@ use serde::{Deserialize, Deserializer};
|
||||
pub mod attachment;
|
||||
pub mod auth;
|
||||
pub mod blob;
|
||||
pub mod export;
|
||||
pub mod issue;
|
||||
pub mod issue_assignee;
|
||||
pub mod issue_comment;
|
||||
@@ -18,6 +17,7 @@ pub mod issue_comment_reaction;
|
||||
pub mod issue_follower;
|
||||
pub mod issue_relationship;
|
||||
pub mod issue_tag;
|
||||
pub mod migration;
|
||||
pub mod notification;
|
||||
pub mod oauth;
|
||||
pub mod organization_member;
|
||||
@@ -26,6 +26,7 @@ pub mod project;
|
||||
pub mod project_status;
|
||||
pub mod pull_request;
|
||||
pub mod pull_requests_local;
|
||||
pub mod relay;
|
||||
pub mod response;
|
||||
pub mod tag;
|
||||
pub mod user;
|
||||
@@ -35,7 +36,6 @@ pub mod workspaces;
|
||||
pub use attachment::*;
|
||||
pub use auth::*;
|
||||
pub use blob::*;
|
||||
pub use export::*;
|
||||
pub use issue::*;
|
||||
pub use issue_assignee::*;
|
||||
pub use issue_comment::*;
|
||||
@@ -43,6 +43,7 @@ pub use issue_comment_reaction::*;
|
||||
pub use issue_follower::*;
|
||||
pub use issue_relationship::*;
|
||||
pub use issue_tag::*;
|
||||
pub use migration::*;
|
||||
pub use notification::*;
|
||||
pub use oauth::*;
|
||||
pub use organization_member::*;
|
||||
@@ -51,6 +52,7 @@ pub use project::*;
|
||||
pub use project_status::*;
|
||||
pub use pull_request::*;
|
||||
pub use pull_requests_local::*;
|
||||
pub use relay::*;
|
||||
pub use response::*;
|
||||
pub use tag::*;
|
||||
pub use user::*;
|
||||
|
||||
50
crates/api-types/src/migration.rs
Normal file
50
crates/api-types/src/migration.rs
Normal file
@@ -0,0 +1,50 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct MigrateProjectRequest {
|
||||
pub organization_id: Uuid,
|
||||
pub name: String,
|
||||
pub color: String,
|
||||
pub created_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct MigrateIssueRequest {
|
||||
pub project_id: Uuid,
|
||||
pub status_name: String,
|
||||
pub title: String,
|
||||
pub description: Option<String>,
|
||||
pub created_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct MigratePullRequestRequest {
|
||||
pub url: String,
|
||||
pub number: i32,
|
||||
pub status: String,
|
||||
pub merged_at: Option<DateTime<Utc>>,
|
||||
pub merge_commit_sha: Option<String>,
|
||||
pub target_branch_name: String,
|
||||
pub issue_id: Uuid,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct MigrateWorkspaceRequest {
|
||||
pub project_id: Uuid,
|
||||
pub issue_id: Option<Uuid>,
|
||||
pub local_workspace_id: Uuid,
|
||||
pub archived: bool,
|
||||
pub created_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct BulkMigrateRequest<T> {
|
||||
pub items: Vec<T>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct BulkMigrateResponse {
|
||||
pub ids: Vec<Uuid>,
|
||||
}
|
||||
@@ -1,34 +1,18 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
use sqlx::Type;
|
||||
use ts_rs::TS;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::{IssuePriority, some_if_present};
|
||||
use crate::some_if_present;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Type, TS)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[sqlx(type_name = "notification_type", rename_all = "snake_case")]
|
||||
pub enum NotificationType {
|
||||
IssueCommentAdded,
|
||||
IssueStatusChanged,
|
||||
IssueAssigneeChanged,
|
||||
IssuePriorityChanged,
|
||||
IssueUnassigned,
|
||||
IssueCommentReaction,
|
||||
IssueDeleted,
|
||||
IssueTitleChanged,
|
||||
IssueDescriptionChanged,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum NotificationGroupKind {
|
||||
Single,
|
||||
IssueChanges,
|
||||
StatusChanges,
|
||||
Comments,
|
||||
Reactions,
|
||||
IssueDeleted,
|
||||
}
|
||||
|
||||
@@ -38,7 +22,7 @@ pub struct Notification {
|
||||
pub organization_id: Uuid,
|
||||
pub user_id: Uuid,
|
||||
pub notification_type: NotificationType,
|
||||
pub payload: NotificationPayload,
|
||||
pub payload: Value,
|
||||
pub issue_id: Option<Uuid>,
|
||||
pub comment_id: Option<Uuid>,
|
||||
pub seen: bool,
|
||||
@@ -46,38 +30,14 @@ pub struct Notification {
|
||||
pub created_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize, TS)]
|
||||
pub struct NotificationPayload {
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub deeplink_path: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub issue_id: Option<Uuid>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub issue_simple_id: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub issue_title: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub actor_user_id: Option<Uuid>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub comment_preview: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub old_status_id: Option<Uuid>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub new_status_id: Option<Uuid>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub old_status_name: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub new_status_name: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub new_title: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub old_priority: Option<IssuePriority>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub new_priority: Option<IssuePriority>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub assignee_user_id: Option<Uuid>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub emoji: Option<String>,
|
||||
#[derive(Debug, Clone, Deserialize, TS)]
|
||||
pub struct CreateNotificationRequest {
|
||||
/// Optional client-generated ID. If not provided, server generates one.
|
||||
/// Using client-generated IDs enables stable optimistic updates.
|
||||
#[ts(optional)]
|
||||
pub id: Option<Uuid>,
|
||||
pub organization_id: Uuid,
|
||||
pub seen: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, TS)]
|
||||
@@ -85,3 +45,13 @@ pub struct UpdateNotificationRequest {
|
||||
#[serde(default, deserialize_with = "some_if_present")]
|
||||
pub seen: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct ListNotificationsQuery {
|
||||
pub organization_id: Uuid,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, TS)]
|
||||
pub struct ListNotificationsResponse {
|
||||
pub notifications: Vec<Notification>,
|
||||
}
|
||||
|
||||
@@ -28,24 +28,6 @@ pub struct HandoffRedeemResponse {
|
||||
pub refresh_token: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, TS)]
|
||||
pub struct LocalLoginRequest {
|
||||
pub email: String,
|
||||
pub password: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, TS)]
|
||||
pub struct LocalLoginResponse {
|
||||
pub access_token: String,
|
||||
pub refresh_token: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, TS)]
|
||||
pub struct AuthMethodsResponse {
|
||||
pub local_auth_enabled: bool,
|
||||
pub oauth_providers: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, TS)]
|
||||
pub struct TokenRefreshRequest {
|
||||
pub refresh_token: String,
|
||||
@@ -78,10 +60,7 @@ pub struct ProfileResponse {
|
||||
#[serde(tag = "status", rename_all = "lowercase")]
|
||||
pub enum LoginStatus {
|
||||
LoggedOut,
|
||||
LoggedIn {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
profile: Option<ProfileResponse>,
|
||||
},
|
||||
LoggedIn { profile: ProfileResponse },
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, TS)]
|
||||
|
||||
@@ -23,21 +23,12 @@ pub struct PullRequest {
|
||||
pub merged_at: Option<DateTime<Utc>>,
|
||||
pub merge_commit_sha: Option<String>,
|
||||
pub target_branch_name: String,
|
||||
pub project_id: Uuid,
|
||||
#[deprecated(note = "use pull_request_issues join table instead")]
|
||||
pub issue_id: Uuid,
|
||||
pub workspace_id: Option<Uuid>,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct PullRequestIssue {
|
||||
pub id: Uuid,
|
||||
pub pull_request_id: Uuid,
|
||||
pub issue_id: Uuid,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct ListPullRequestsQuery {
|
||||
pub issue_id: Uuid,
|
||||
@@ -47,35 +38,3 @@ pub struct ListPullRequestsQuery {
|
||||
pub struct ListPullRequestsResponse {
|
||||
pub pull_requests: Vec<PullRequest>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct ListPullRequestIssuesResponse {
|
||||
pub pull_request_issues: Vec<PullRequestIssue>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct CreatePullRequestIssueRequest {
|
||||
/// Optional client-generated ID. If not provided, server generates one.
|
||||
/// Using client-generated IDs enables stable optimistic updates.
|
||||
#[ts(optional)]
|
||||
pub id: Option<Uuid>,
|
||||
pub issue_id: Uuid,
|
||||
pub url: String,
|
||||
pub number: i32,
|
||||
pub status: PullRequestStatus,
|
||||
pub merged_at: Option<DateTime<Utc>>,
|
||||
pub merge_commit_sha: Option<String>,
|
||||
pub target_branch_name: String,
|
||||
}
|
||||
|
||||
/// Request to update a PR status on the remote server.
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct UpdatePullRequestApiRequest {
|
||||
pub url: String,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub status: Option<PullRequestStatus>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub merged_at: Option<Option<DateTime<Utc>>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub merge_commit_sha: Option<Option<String>>,
|
||||
}
|
||||
|
||||
40
crates/api-types/src/relay.rs
Normal file
40
crates/api-types/src/relay.rs
Normal file
@@ -0,0 +1,40 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use ts_rs::TS;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, sqlx::FromRow, TS)]
|
||||
pub struct RelayHost {
|
||||
pub id: Uuid,
|
||||
pub owner_user_id: Uuid,
|
||||
pub name: String,
|
||||
pub status: String,
|
||||
pub last_seen_at: Option<DateTime<Utc>>,
|
||||
pub agent_version: Option<String>,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
pub access_role: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct ListRelayHostsResponse {
|
||||
pub hosts: Vec<RelayHost>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||
pub struct RelaySessionAuthCodeResponse {
|
||||
pub session_id: Uuid,
|
||||
pub code: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, sqlx::FromRow, TS)]
|
||||
pub struct RelaySession {
|
||||
pub id: Uuid,
|
||||
pub host_id: Uuid,
|
||||
pub request_user_id: Uuid,
|
||||
pub state: String,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub expires_at: DateTime<Utc>,
|
||||
pub claimed_at: Option<DateTime<Utc>>,
|
||||
pub ended_at: Option<DateTime<Utc>>,
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
[package]
|
||||
name = "client-info"
|
||||
version = "0.1.44"
|
||||
edition = "2024"
|
||||
@@ -1,43 +0,0 @@
|
||||
use std::{net::SocketAddr, sync::OnceLock};
|
||||
|
||||
/// Runtime information about the local server.
|
||||
#[derive(Clone)]
|
||||
pub struct ClientInfo {
|
||||
server_addr: OnceLock<SocketAddr>,
|
||||
preview_proxy_port: OnceLock<u16>,
|
||||
}
|
||||
|
||||
impl Default for ClientInfo {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl ClientInfo {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
server_addr: OnceLock::new(),
|
||||
preview_proxy_port: OnceLock::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_server_addr(&self, addr: SocketAddr) -> Result<(), String> {
|
||||
self.server_addr
|
||||
.set(addr)
|
||||
.map_err(|_| "server address already set".to_string())
|
||||
}
|
||||
|
||||
pub fn get_server_addr(&self) -> Option<SocketAddr> {
|
||||
self.server_addr.get().copied()
|
||||
}
|
||||
|
||||
pub fn set_preview_proxy_port(&self, port: u16) -> Result<(), String> {
|
||||
self.preview_proxy_port
|
||||
.set(port)
|
||||
.map_err(|_| "preview proxy port already set".to_string())
|
||||
}
|
||||
|
||||
pub fn get_preview_proxy_port(&self) -> Option<u16> {
|
||||
self.preview_proxy_port.get().copied()
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT s.id AS \"id!: Uuid\",\n s.workspace_id AS \"workspace_id!: Uuid\",\n s.name,\n s.executor,\n s.agent_working_dir,\n s.created_at AS \"created_at!: DateTime<Utc>\",\n s.updated_at AS \"updated_at!: DateTime<Utc>\"\n FROM sessions s\n LEFT JOIN (\n SELECT ep.session_id, MAX(ep.created_at) as last_used\n FROM execution_processes ep\n WHERE ep.run_reason != 'devserver' AND ep.dropped = FALSE\n GROUP BY ep.session_id\n ) latest_ep ON s.id = latest_ep.session_id\n WHERE s.workspace_id = $1\n ORDER BY COALESCE(latest_ep.last_used, s.created_at) DESC",
|
||||
"query": "SELECT s.id AS \"id!: Uuid\",\n s.workspace_id AS \"workspace_id!: Uuid\",\n s.executor,\n s.agent_working_dir,\n s.created_at AS \"created_at!: DateTime<Utc>\",\n s.updated_at AS \"updated_at!: DateTime<Utc>\"\n FROM sessions s\n LEFT JOIN (\n SELECT ep.session_id, MAX(ep.created_at) as last_used\n FROM execution_processes ep\n WHERE ep.run_reason != 'devserver' AND ep.dropped = FALSE\n GROUP BY ep.session_id\n ) latest_ep ON s.id = latest_ep.session_id\n WHERE s.workspace_id = $1\n ORDER BY COALESCE(latest_ep.last_used, s.created_at) DESC\n LIMIT 1",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -14,28 +14,23 @@
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"name": "executor",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "executor",
|
||||
"name": "agent_working_dir",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "agent_working_dir",
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 6,
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
@@ -47,10 +42,9 @@
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "4506eeeb85b49f00143a9d23636c976159e1c72c9cfce005599c5eb52dc15095"
|
||||
"hash": "04295271e91b2527849159663dec24a6f166418a5574ebae88d2e4fb49b54925"
|
||||
}
|
||||
68
crates/db/.sqlx/query-04e5a05c7cad438d39c4c8590410889ab1eefa7376d474a10c119d3f4d9143c7.json
generated
Normal file
68
crates/db/.sqlx/query-04e5a05c7cad438d39c4c8590410889ab1eefa7376d474a10c119d3f4d9143c7.json
generated
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id as \"id!: Uuid\",\n execution_process_id as \"execution_process_id!: Uuid\",\n agent_session_id,\n agent_message_id,\n prompt,\n summary,\n seen as \"seen!: bool\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM coding_agent_turns\n WHERE agent_session_id = ?\n ORDER BY updated_at DESC\n LIMIT 1",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "execution_process_id!: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "agent_session_id",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "agent_message_id",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "prompt",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "summary",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "seen!: bool",
|
||||
"ordinal": 6,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "04e5a05c7cad438d39c4c8590410889ab1eefa7376d474a10c119d3f4d9143c7"
|
||||
}
|
||||
12
crates/db/.sqlx/query-0a805c219c9028b2677bd94ccabd47916e60d26c1cede27e467f0ae91f6639ab.json
generated
Normal file
12
crates/db/.sqlx/query-0a805c219c9028b2677bd94ccabd47916e60d26c1cede27e467f0ae91f6639ab.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "UPDATE migration_state\n SET status = 'migrated',\n remote_id = $3,\n error_message = NULL,\n updated_at = datetime('now', 'subsec')\n WHERE entity_type = $1 AND local_id = $2",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "0a805c219c9028b2677bd94ccabd47916e60d26c1cede27e467f0ae91f6639ab"
|
||||
}
|
||||
12
crates/db/.sqlx/query-0ac0d0f3826330836e3fd1bf57c42777eb489ac41a650f9361e6b563fc69bf35.json
generated
Normal file
12
crates/db/.sqlx/query-0ac0d0f3826330836e3fd1bf57c42777eb489ac41a650f9361e6b563fc69bf35.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "UPDATE migration_state\n SET status = 'pending',\n error_message = NULL,\n updated_at = datetime('now', 'subsec')\n WHERE status = 'failed'",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "0ac0d0f3826330836e3fd1bf57c42777eb489ac41a650f9361e6b563fc69bf35"
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "DELETE FROM pull_requests WHERE id = ?",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "0ee24d51e7557d9d6c9418a06156c03d7dd49dfe938194cd6951942dfd8f179d"
|
||||
}
|
||||
12
crates/db/.sqlx/query-0f90844fc62261ed140e02515ae464b940743113814507313c9fdc176000d1bf.json
generated
Normal file
12
crates/db/.sqlx/query-0f90844fc62261ed140e02515ae464b940743113814507313c9fdc176000d1bf.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "UPDATE migration_state\n SET status = 'skipped',\n error_message = $3,\n updated_at = datetime('now', 'subsec')\n WHERE entity_type = $1 AND local_id = $2",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "0f90844fc62261ed140e02515ae464b940743113814507313c9fdc176000d1bf"
|
||||
}
|
||||
86
crates/db/.sqlx/query-1085d1f8107c7e16fc2058ef610918760d8d420f0fca97adecd76d698f6f3a51.json
generated
Normal file
86
crates/db/.sqlx/query-1085d1f8107c7e16fc2058ef610918760d8d420f0fca97adecd76d698f6f3a51.json
generated
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id as \"id!: Uuid\",\n workspace_id as \"workspace_id!: Uuid\",\n repo_id as \"repo_id!: Uuid\",\n merge_type as \"merge_type!: MergeType\",\n merge_commit,\n pr_number,\n pr_url,\n pr_status as \"pr_status?: MergeStatus\",\n pr_merged_at as \"pr_merged_at?: DateTime<Utc>\",\n pr_merge_commit_sha,\n target_branch_name as \"target_branch_name!: String\",\n created_at as \"created_at!: DateTime<Utc>\"\n FROM merges\n WHERE workspace_id = $1 AND repo_id = $2\n ORDER BY created_at DESC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id!: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "merge_type!: MergeType",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 5,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_status?: MergeStatus",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merged_at?: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merge_commit_sha",
|
||||
"ordinal": 9,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name!: String",
|
||||
"ordinal": 10,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 11,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "1085d1f8107c7e16fc2058ef610918760d8d420f0fca97adecd76d698f6f3a51"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT id as \"id!: Uuid\",\n file_path as \"file_path!\",\n original_name as \"original_name!\",\n mime_type,\n size_bytes as \"size_bytes!\",\n hash as \"hash!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM attachments\n WHERE id = $1",
|
||||
"query": "SELECT id as \"id!: Uuid\",\n file_path as \"file_path!\",\n original_name as \"original_name!\",\n mime_type,\n size_bytes as \"size_bytes!\",\n hash as \"hash!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM images\n WHERE id = $1",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -58,5 +58,5 @@
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "dc5d0ad507cbd962235c9e85c3e43f34c7c38eb2e08ab7899073010a6e77b37d"
|
||||
"hash": "1280290c78a1f55b3f0074ebcb61d855cab3e9be9ab0bc8c3f678adf4506b9cc"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT i.id as \"id!: Uuid\",\n i.file_path as \"file_path!\",\n i.original_name as \"original_name!\",\n i.mime_type,\n i.size_bytes as \"size_bytes!\",\n i.hash as \"hash!\",\n i.created_at as \"created_at!: DateTime<Utc>\",\n i.updated_at as \"updated_at!: DateTime<Utc>\"\n FROM attachments i\n LEFT JOIN workspace_attachments wa ON i.id = wa.attachment_id\n WHERE wa.workspace_id IS NULL",
|
||||
"query": "SELECT i.id as \"id!: Uuid\",\n i.file_path as \"file_path!\",\n i.original_name as \"original_name!\",\n i.mime_type,\n i.size_bytes as \"size_bytes!\",\n i.hash as \"hash!\",\n i.created_at as \"created_at!: DateTime<Utc>\",\n i.updated_at as \"updated_at!: DateTime<Utc>\"\n FROM images i\n LEFT JOIN workspace_images wi ON i.id = wi.image_id\n WHERE wi.workspace_id IS NULL",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -58,5 +58,5 @@
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "df2f35912a8055dff6cb24c83ea67fc49b432f457961fa584c6a13389bfdcea5"
|
||||
"hash": "144e0cfb4810f51fe65577077e2f57b08eb278f2a819420a242aad5ab5be7944"
|
||||
}
|
||||
20
crates/db/.sqlx/query-167c1d13ee37ebe62cd2316feaf6b5354eb26d0a8fc16efb22827a5cde59a60e.json
generated
Normal file
20
crates/db/.sqlx/query-167c1d13ee37ebe62cd2316feaf6b5354eb26d0a8fc16efb22827a5cde59a60e.json
generated
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT COUNT(1) as \"count!: i64\"\n FROM merges\n WHERE workspace_id = $1\n AND merge_type = 'pr'\n AND pr_status = 'open'",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "count!: i64",
|
||||
"ordinal": 0,
|
||||
"type_info": "Integer"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "167c1d13ee37ebe62cd2316feaf6b5354eb26d0a8fc16efb22827a5cde59a60e"
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id,\n workspace_id AS \"workspace_id: Uuid\",\n repo_id AS \"repo_id: Uuid\",\n pr_url,\n pr_number,\n pr_status AS \"pr_status: MergeStatus\",\n target_branch_name,\n merged_at AS \"merged_at: DateTime<Utc>\",\n merge_commit_sha,\n created_at AS \"created_at!: DateTime<Utc>\",\n updated_at AS \"updated_at!: DateTime<Utc>\",\n synced_at AS \"synced_at: DateTime<Utc>\"\n FROM pull_requests\n WHERE synced_at IS NULL OR synced_at < updated_at",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 4,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_status: MergeStatus",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merged_at: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit_sha",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 9,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 10,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "synced_at: DateTime<Utc>",
|
||||
"ordinal": 11,
|
||||
"type_info": "Datetime"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "1af7a606a64d9662d6edc4fbeaae0d53a4d657a6e29b2561e820085a2d9e3348"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT id as \"id!: Uuid\",\n file_path as \"file_path!\",\n original_name as \"original_name!\",\n mime_type,\n size_bytes as \"size_bytes!\",\n hash as \"hash!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM attachments\n WHERE hash = $1",
|
||||
"query": "SELECT id as \"id!: Uuid\",\n file_path as \"file_path!\",\n original_name as \"original_name!\",\n mime_type,\n size_bytes as \"size_bytes!\",\n hash as \"hash!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM images\n WHERE hash = $1",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -58,5 +58,5 @@
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "04f17449e3e12785affab91e4eab308103491e34c022199b7b060e04fa8aed0f"
|
||||
"hash": "2827716b6501cc3c44ec50ae1a3d90f759cc3940c8fe6ffe383d0f741e3a2a78"
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "UPDATE pull_requests SET pr_status = ?, merged_at = ?, merge_commit_sha = ?, updated_at = ?, synced_at = NULL WHERE pr_url = ?",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 5
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "2948ec0606a39ee67bdbaf4f2cf82592448a1d91a66d7d89cf7204f71f706274"
|
||||
}
|
||||
20
crates/db/.sqlx/query-29cc3aa8d0ad5deda94494402500a4125e29381d63f18ef083cc4da95e2c5db5.json
generated
Normal file
20
crates/db/.sqlx/query-29cc3aa8d0ad5deda94494402500a4125e29381d63f18ef083cc4da95e2c5db5.json
generated
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT w.id as \"workspace_id!: Uuid\"\n FROM workspaces w\n WHERE w.container_ref = ?",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "workspace_id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "29cc3aa8d0ad5deda94494402500a4125e29381d63f18ef083cc4da95e2c5db5"
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id,\n workspace_id AS \"workspace_id: Uuid\",\n repo_id AS \"repo_id: Uuid\",\n pr_url,\n pr_number,\n pr_status AS \"pr_status: MergeStatus\",\n target_branch_name,\n merged_at AS \"merged_at: DateTime<Utc>\",\n merge_commit_sha,\n created_at AS \"created_at!: DateTime<Utc>\",\n updated_at AS \"updated_at!: DateTime<Utc>\",\n synced_at AS \"synced_at: DateTime<Utc>\"\n FROM pull_requests\n WHERE workspace_id = $1 AND repo_id = $2\n ORDER BY created_at DESC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 4,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_status: MergeStatus",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merged_at: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit_sha",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 9,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 10,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "synced_at: DateTime<Utc>",
|
||||
"ordinal": 11,
|
||||
"type_info": "Datetime"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "32c74a54fdd72a6b167583228f2c30944837b7cc29c9cc4acfbb4f047cea7118"
|
||||
}
|
||||
68
crates/db/.sqlx/query-33f23656ba343bd75a88b0fadf2a4ba01eda330f9b549e625e27701e3b0b5a31.json
generated
Normal file
68
crates/db/.sqlx/query-33f23656ba343bd75a88b0fadf2a4ba01eda330f9b549e625e27701e3b0b5a31.json
generated
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id as \"id!: Uuid\",\n entity_type as \"entity_type!: EntityType\",\n local_id as \"local_id!: Uuid\",\n remote_id as \"remote_id: Uuid\",\n status as \"status!: MigrationStatus\",\n error_message,\n attempt_count as \"attempt_count!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM migration_state\n WHERE entity_type = $1 AND status = 'pending'\n ORDER BY created_at ASC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "entity_type!: EntityType",
|
||||
"ordinal": 1,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "local_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "remote_id: Uuid",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "status!: MigrationStatus",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "error_message",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "attempt_count!",
|
||||
"ordinal": 6,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "33f23656ba343bd75a88b0fadf2a4ba01eda330f9b549e625e27701e3b0b5a31"
|
||||
}
|
||||
86
crates/db/.sqlx/query-3ace1ee8dba0669400d69891912b86823e41ca643092d990b12c1a6160112427.json
generated
Normal file
86
crates/db/.sqlx/query-3ace1ee8dba0669400d69891912b86823e41ca643092d990b12c1a6160112427.json
generated
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n m.id as \"id!: Uuid\",\n m.workspace_id as \"workspace_id!: Uuid\",\n m.repo_id as \"repo_id!: Uuid\",\n m.merge_type as \"merge_type!: MergeType\",\n m.merge_commit,\n m.pr_number,\n m.pr_url,\n m.pr_status as \"pr_status?: MergeStatus\",\n m.pr_merged_at as \"pr_merged_at?: DateTime<Utc>\",\n m.pr_merge_commit_sha,\n m.target_branch_name as \"target_branch_name!: String\",\n m.created_at as \"created_at!: DateTime<Utc>\"\n FROM merges m\n INNER JOIN (\n SELECT workspace_id, MAX(created_at) as max_created_at\n FROM merges\n WHERE merge_type = 'pr'\n GROUP BY workspace_id\n ) latest ON m.workspace_id = latest.workspace_id\n AND m.created_at = latest.max_created_at\n INNER JOIN workspaces w ON m.workspace_id = w.id\n WHERE m.merge_type = 'pr' AND w.archived = $1",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id!: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "merge_type!: MergeType",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 5,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_status?: MergeStatus",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merged_at?: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merge_commit_sha",
|
||||
"ordinal": 9,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name!: String",
|
||||
"ordinal": 10,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 11,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "3ace1ee8dba0669400d69891912b86823e41ca643092d990b12c1a6160112427"
|
||||
}
|
||||
86
crates/db/.sqlx/query-3d85256618729c1c0bf2758ffab9cdb4ec2af0751e3a37db4009c02f95f6f556.json
generated
Normal file
86
crates/db/.sqlx/query-3d85256618729c1c0bf2758ffab9cdb4ec2af0751e3a37db4009c02f95f6f556.json
generated
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO merges (\n id, workspace_id, repo_id, merge_type, pr_number, pr_url, pr_status, created_at, target_branch_name\n ) VALUES ($1, $2, $3, 'pr', $4, $5, 'open', $6, $7)\n RETURNING\n id as \"id!: Uuid\",\n workspace_id as \"workspace_id!: Uuid\",\n repo_id as \"repo_id!: Uuid\",\n merge_type as \"merge_type!: MergeType\",\n merge_commit,\n pr_number,\n pr_url,\n pr_status as \"pr_status?: MergeStatus\",\n pr_merged_at as \"pr_merged_at?: DateTime<Utc>\",\n pr_merge_commit_sha,\n created_at as \"created_at!: DateTime<Utc>\",\n target_branch_name as \"target_branch_name!: String\"\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id!: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "merge_type!: MergeType",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 5,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_status?: MergeStatus",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merged_at?: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merge_commit_sha",
|
||||
"ordinal": 9,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 10,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name!: String",
|
||||
"ordinal": 11,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 7
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "3d85256618729c1c0bf2758ffab9cdb4ec2af0751e3a37db4009c02f95f6f556"
|
||||
}
|
||||
86
crates/db/.sqlx/query-4b59b958807be54c7c9949d96ced96e4ab1498f1056e7d0d7956aff46352d90f.json
generated
Normal file
86
crates/db/.sqlx/query-4b59b958807be54c7c9949d96ced96e4ab1498f1056e7d0d7956aff46352d90f.json
generated
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id as \"id!: Uuid\",\n workspace_id as \"workspace_id!: Uuid\",\n repo_id as \"repo_id!: Uuid\",\n merge_type as \"merge_type!: MergeType\",\n merge_commit,\n pr_number,\n pr_url,\n pr_status as \"pr_status?: MergeStatus\",\n pr_merged_at as \"pr_merged_at?: DateTime<Utc>\",\n pr_merge_commit_sha,\n target_branch_name as \"target_branch_name!: String\",\n created_at as \"created_at!: DateTime<Utc>\"\n FROM merges\n WHERE workspace_id = $1\n ORDER BY created_at DESC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id!: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "merge_type!: MergeType",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 5,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_status?: MergeStatus",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merged_at?: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merge_commit_sha",
|
||||
"ordinal": 9,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name!: String",
|
||||
"ordinal": 10,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 11,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "4b59b958807be54c7c9949d96ced96e4ab1498f1056e7d0d7956aff46352d90f"
|
||||
}
|
||||
12
crates/db/.sqlx/query-4d84b308a2cc7677da65111d080bf02e5e35c052048360d3dbea656bbbcd3edb.json
generated
Normal file
12
crates/db/.sqlx/query-4d84b308a2cc7677da65111d080bf02e5e35c052048360d3dbea656bbbcd3edb.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "UPDATE execution_process_repo_states\n SET merge_commit = $1, updated_at = $2\n WHERE execution_process_id = $3\n AND repo_id = $4",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "4d84b308a2cc7677da65111d080bf02e5e35c052048360d3dbea656bbbcd3edb"
|
||||
}
|
||||
68
crates/db/.sqlx/query-517fb82570b9624e166696af53963ec499966562b23b5833fc4ca4cf43bcaccc.json
generated
Normal file
68
crates/db/.sqlx/query-517fb82570b9624e166696af53963ec499966562b23b5833fc4ca4cf43bcaccc.json
generated
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id as \"id!: Uuid\",\n entity_type as \"entity_type!: EntityType\",\n local_id as \"local_id!: Uuid\",\n remote_id as \"remote_id: Uuid\",\n status as \"status!: MigrationStatus\",\n error_message,\n attempt_count as \"attempt_count!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM migration_state\n WHERE entity_type = $1\n ORDER BY created_at ASC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "entity_type!: EntityType",
|
||||
"ordinal": 1,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "local_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "remote_id: Uuid",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "status!: MigrationStatus",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "error_message",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "attempt_count!",
|
||||
"ordinal": 6,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "517fb82570b9624e166696af53963ec499966562b23b5833fc4ca4cf43bcaccc"
|
||||
}
|
||||
86
crates/db/.sqlx/query-570f62a32921c4a9a7e4e1006e9b31c4c58e69ab8681d76dfe9b184ff1e0bc65.json
generated
Normal file
86
crates/db/.sqlx/query-570f62a32921c4a9a7e4e1006e9b31c4c58e69ab8681d76dfe9b184ff1e0bc65.json
generated
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id as \"id!: Uuid\",\n workspace_id as \"workspace_id!: Uuid\",\n repo_id as \"repo_id!: Uuid\",\n merge_type as \"merge_type!: MergeType\",\n merge_commit,\n pr_number,\n pr_url,\n pr_status as \"pr_status?: MergeStatus\",\n pr_merged_at as \"pr_merged_at?: DateTime<Utc>\",\n pr_merge_commit_sha,\n created_at as \"created_at!: DateTime<Utc>\",\n target_branch_name as \"target_branch_name!: String\"\n FROM merges\n WHERE merge_type = 'pr'\n ORDER BY created_at ASC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id!: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "merge_type!: MergeType",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 5,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_status?: MergeStatus",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merged_at?: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merge_commit_sha",
|
||||
"ordinal": 9,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 10,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name!: String",
|
||||
"ordinal": 11,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "570f62a32921c4a9a7e4e1006e9b31c4c58e69ab8681d76dfe9b184ff1e0bc65"
|
||||
}
|
||||
12
crates/db/.sqlx/query-5785a10c3d51ff9b001aa455f6296a4dcba61cec700a4b72031c5c643b273938.json
generated
Normal file
12
crates/db/.sqlx/query-5785a10c3d51ff9b001aa455f6296a4dcba61cec700a4b72031c5c643b273938.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "UPDATE merges\n SET pr_status = $1,\n pr_merge_commit_sha = $2,\n pr_merged_at = $3\n WHERE id = $4",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "5785a10c3d51ff9b001aa455f6296a4dcba61cec700a4b72031c5c643b273938"
|
||||
}
|
||||
20
crates/db/.sqlx/query-606016bf31cf0abd87d7eb95ea99d7c8c014523cb02e482d608299ceefaeffc5.json
generated
Normal file
20
crates/db/.sqlx/query-606016bf31cf0abd87d7eb95ea99d7c8c014523cb02e482d608299ceefaeffc5.json
generated
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT EXISTS(\n SELECT 1 FROM coding_agent_turns cat\n JOIN execution_processes ep ON cat.execution_process_id = ep.id\n JOIN sessions s ON ep.session_id = s.id\n WHERE s.workspace_id = $1 AND cat.seen = 0\n ) as \"has_unseen!: bool\"",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "has_unseen!: bool",
|
||||
"ordinal": 0,
|
||||
"type_info": "Integer"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "606016bf31cf0abd87d7eb95ea99d7c8c014523cb02e482d608299ceefaeffc5"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT i.id as \"id!: Uuid\",\n i.file_path as \"file_path!\",\n i.original_name as \"original_name!\",\n i.mime_type,\n i.size_bytes as \"size_bytes!\",\n i.hash as \"hash!\",\n i.created_at as \"created_at!: DateTime<Utc>\",\n i.updated_at as \"updated_at!: DateTime<Utc>\"\n FROM attachments i\n JOIN workspace_attachments wa ON i.id = wa.attachment_id\n WHERE wa.workspace_id = $1\n ORDER BY wa.created_at",
|
||||
"query": "SELECT i.id as \"id!: Uuid\",\n i.file_path as \"file_path!\",\n i.original_name as \"original_name!\",\n i.mime_type,\n i.size_bytes as \"size_bytes!\",\n i.hash as \"hash!\",\n i.created_at as \"created_at!: DateTime<Utc>\",\n i.updated_at as \"updated_at!: DateTime<Utc>\"\n FROM images i\n JOIN workspace_images wi ON i.id = wi.image_id\n WHERE wi.workspace_id = $1\n ORDER BY wi.created_at",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -58,5 +58,5 @@
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "586d5ab95899967c8a8f74996c4a598a73661823bc2bcb240cebb7cd0533abb6"
|
||||
"hash": "60e47682fe6fc150ee737176c9221ab1958595e92dc0fc5928688af847ab30ce"
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n t.id,\n t.workspace_id AS \"workspace_id: Uuid\",\n t.repo_id AS \"repo_id: Uuid\",\n t.pr_url,\n t.pr_number,\n t.pr_status AS \"pr_status: MergeStatus\",\n t.target_branch_name,\n t.merged_at AS \"merged_at: DateTime<Utc>\",\n t.merge_commit_sha,\n t.created_at AS \"created_at!: DateTime<Utc>\",\n t.updated_at AS \"updated_at!: DateTime<Utc>\",\n t.synced_at AS \"synced_at: DateTime<Utc>\"\n FROM pull_requests t\n INNER JOIN (\n SELECT workspace_id, MAX(created_at) as max_created_at\n FROM pull_requests\n WHERE workspace_id IS NOT NULL\n GROUP BY workspace_id\n ) latest ON t.workspace_id = latest.workspace_id AND t.created_at = latest.max_created_at\n INNER JOIN workspaces w ON t.workspace_id = w.id\n WHERE t.workspace_id IS NOT NULL AND w.archived = $1",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 4,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_status: MergeStatus",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merged_at: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit_sha",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 9,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 10,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "synced_at: DateTime<Utc>",
|
||||
"ordinal": 11,
|
||||
"type_info": "Datetime"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "64cdb811a6d15a483fc0413dc49ba8aa093b1892831699c456afe0507ac51aa3"
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id AS \"id!: Uuid\",\n workspace_id AS \"workspace_id!: Uuid\",\n repo_id AS \"repo_id!: Uuid\",\n merge_commit,\n target_branch_name,\n created_at AS \"created_at!: DateTime<Utc>\"\n FROM merges\n WHERE workspace_id = ? AND merge_type = 'direct'\n ORDER BY created_at DESC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id!: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "67a7192158ad406cf8b97165c46a602330e807ed2757497e483295ea21952f1f"
|
||||
}
|
||||
68
crates/db/.sqlx/query-686810c5271e1d44042b6ea2c6cc434eb2e3f5d3540c97d703c34dd4e978c690.json
generated
Normal file
68
crates/db/.sqlx/query-686810c5271e1d44042b6ea2c6cc434eb2e3f5d3540c97d703c34dd4e978c690.json
generated
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id as \"id!: Uuid\",\n entity_type as \"entity_type!: EntityType\",\n local_id as \"local_id!: Uuid\",\n remote_id as \"remote_id: Uuid\",\n status as \"status!: MigrationStatus\",\n error_message,\n attempt_count as \"attempt_count!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM migration_state\n WHERE entity_type = $1 AND local_id = $2",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "entity_type!: EntityType",
|
||||
"ordinal": 1,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "local_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "remote_id: Uuid",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "status!: MigrationStatus",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "error_message",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "attempt_count!",
|
||||
"ordinal": 6,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "686810c5271e1d44042b6ea2c6cc434eb2e3f5d3540c97d703c34dd4e978c690"
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id AS \"id!: Uuid\",\n workspace_id AS \"workspace_id!: Uuid\",\n repo_id AS \"repo_id!: Uuid\",\n merge_commit,\n target_branch_name,\n created_at AS \"created_at!: DateTime<Utc>\"\n FROM merges\n WHERE workspace_id = ? AND repo_id = ? AND merge_type = 'direct'\n ORDER BY created_at DESC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id!: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "687a386ec0c65676bcd9d1ced30549e4c2a3d2bdb63a0a5623027e50aa6e4389"
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO workspace_attachments (id, workspace_id, attachment_id)\n SELECT $1, $2, $3\n WHERE NOT EXISTS (\n SELECT 1 FROM workspace_attachments WHERE workspace_id = $2 AND attachment_id = $3\n )",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "6ae5eb2719382d4d081ee17dbd5de654c156b06e2af4ddfb917d36002146be5b"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT COUNT(1) AS \"count!: i64\" FROM pull_requests WHERE workspace_id = ? AND pr_status = 'open'",
|
||||
"query": "SELECT COUNT(*) as \"count!: i64\" FROM workspaces",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -10,11 +10,11 @@
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "21c7a9f62322212a5f6b923bb410c25ac06e6a0c857d910d93fb80ab77fc9b35"
|
||||
"hash": "70b21c5c0a2ba5c21c9c1132f14a68c02a8a2cd555caea74e57a0aeb206770d3"
|
||||
}
|
||||
68
crates/db/.sqlx/query-7364150098bec681451c43762117a1f5c5b4e27f5f65186c3cc16092b3491c37.json
generated
Normal file
68
crates/db/.sqlx/query-7364150098bec681451c43762117a1f5c5b4e27f5f65186c3cc16092b3491c37.json
generated
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO migration_state (id, entity_type, local_id)\n VALUES ($1, $2, $3)\n ON CONFLICT (entity_type, local_id) DO UPDATE SET\n updated_at = datetime('now', 'subsec')\n RETURNING\n id as \"id!: Uuid\",\n entity_type as \"entity_type!: EntityType\",\n local_id as \"local_id!: Uuid\",\n remote_id as \"remote_id: Uuid\",\n status as \"status!: MigrationStatus\",\n error_message,\n attempt_count as \"attempt_count!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "entity_type!: EntityType",
|
||||
"ordinal": 1,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "local_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "remote_id: Uuid",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "status!: MigrationStatus",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "error_message",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "attempt_count!",
|
||||
"ordinal": 6,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "7364150098bec681451c43762117a1f5c5b4e27f5f65186c3cc16092b3491c37"
|
||||
}
|
||||
68
crates/db/.sqlx/query-7807cb09da72c5a1e35bf4f4da1bea1743a578588e72444ede98f5f969af08c1.json
generated
Normal file
68
crates/db/.sqlx/query-7807cb09da72c5a1e35bf4f4da1bea1743a578588e72444ede98f5f969af08c1.json
generated
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id as \"id!: Uuid\",\n entity_type as \"entity_type!: EntityType\",\n local_id as \"local_id!: Uuid\",\n remote_id as \"remote_id: Uuid\",\n status as \"status!: MigrationStatus\",\n error_message,\n attempt_count as \"attempt_count!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM migration_state\n ORDER BY created_at ASC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "entity_type!: EntityType",
|
||||
"ordinal": 1,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "local_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "remote_id: Uuid",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "status!: MigrationStatus",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "error_message",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "attempt_count!",
|
||||
"ordinal": 6,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "7807cb09da72c5a1e35bf4f4da1bea1743a578588e72444ede98f5f969af08c1"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "DELETE FROM attachments WHERE id = $1",
|
||||
"query": "DELETE FROM images WHERE id = $1",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
@@ -8,5 +8,5 @@
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "4ac35216ead7e5be9cc2de504a06b6e375e23ca2ed14493ec991f53e458a6a34"
|
||||
"hash": "79b35e39d668ad2285b3a05c15d5243cc91d35e03104d222488c7e27b8bbb569"
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "UPDATE pull_requests SET synced_at = ? WHERE id = ?",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "8076c3d62eba1cdf2a050c9d61dc20ef2fc3e24b0830d1e20099a42ae78333d0"
|
||||
}
|
||||
68
crates/db/.sqlx/query-84ee994f0aad005cf62ca318eb20ae29d218a72cdd1fadf2a5ae399b0719ca19.json
generated
Normal file
68
crates/db/.sqlx/query-84ee994f0aad005cf62ca318eb20ae29d218a72cdd1fadf2a5ae399b0719ca19.json
generated
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id as \"id!: Uuid\",\n entity_type as \"entity_type!: EntityType\",\n local_id as \"local_id!: Uuid\",\n remote_id as \"remote_id: Uuid\",\n status as \"status!: MigrationStatus\",\n error_message,\n attempt_count as \"attempt_count!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM migration_state\n WHERE status = $1\n ORDER BY created_at ASC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "entity_type!: EntityType",
|
||||
"ordinal": 1,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "local_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "remote_id: Uuid",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "status!: MigrationStatus",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "error_message",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "attempt_count!",
|
||||
"ordinal": 6,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "84ee994f0aad005cf62ca318eb20ae29d218a72cdd1fadf2a5ae399b0719ca19"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO attachments (id, file_path, original_name, mime_type, size_bytes, hash)\n VALUES ($1, $2, $3, $4, $5, $6)\n RETURNING id as \"id!: Uuid\", \n file_path as \"file_path!\", \n original_name as \"original_name!\", \n mime_type,\n size_bytes as \"size_bytes!\",\n hash as \"hash!\",\n created_at as \"created_at!: DateTime<Utc>\", \n updated_at as \"updated_at!: DateTime<Utc>\"",
|
||||
"query": "INSERT INTO images (id, file_path, original_name, mime_type, size_bytes, hash)\n VALUES ($1, $2, $3, $4, $5, $6)\n RETURNING id as \"id!: Uuid\", \n file_path as \"file_path!\", \n original_name as \"original_name!\", \n mime_type,\n size_bytes as \"size_bytes!\",\n hash as \"hash!\",\n created_at as \"created_at!: DateTime<Utc>\", \n updated_at as \"updated_at!: DateTime<Utc>\"",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -58,5 +58,5 @@
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "4b952fb779fbcf70bd402b6bcc0eec07b75879333614b8ef98e5b8073ad66ca6"
|
||||
"hash": "943c19a516ecc2060133457fc8104ad612dfb872f616cd47bb900646b7f5af37"
|
||||
}
|
||||
12
crates/db/.sqlx/query-9747ebaebd562d65f0c333b0f5efc74fa63ab9fcb35a43f75f57da3fcb9a2588.json
generated
Normal file
12
crates/db/.sqlx/query-9747ebaebd562d65f0c333b0f5efc74fa63ab9fcb35a43f75f57da3fcb9a2588.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO execution_process_logs (execution_id, logs, byte_size, inserted_at)\n VALUES ($1, $2, $3, datetime('now', 'subsec'))",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "9747ebaebd562d65f0c333b0f5efc74fa63ab9fcb35a43f75f57da3fcb9a2588"
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO merges (id, workspace_id, repo_id, merge_type, merge_commit, created_at, target_branch_name)\n VALUES (?, ?, ?, 'direct', ?, ?, ?)",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 6
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "9ab0fedd6e06a0372797e66c9353dd807e85e059520f20db4b03d9a27bb3efb7"
|
||||
}
|
||||
12
crates/db/.sqlx/query-a4a50fcfb903e6d0a315676f4f760e5bb7718e10ea550aedf990c9da84834416.json
generated
Normal file
12
crates/db/.sqlx/query-a4a50fcfb903e6d0a315676f4f760e5bb7718e10ea550aedf990c9da84834416.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "DELETE FROM migration_state",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "a4a50fcfb903e6d0a315676f4f760e5bb7718e10ea550aedf990c9da84834416"
|
||||
}
|
||||
12
crates/db/.sqlx/query-a915c22f5ed0bb86c3a242ca38cbc1bfca40ebfe9096058c27e94479b67c7c02.json
generated
Normal file
12
crates/db/.sqlx/query-a915c22f5ed0bb86c3a242ca38cbc1bfca40ebfe9096058c27e94479b67c7c02.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "UPDATE migration_state\n SET status = 'failed',\n error_message = $3,\n attempt_count = attempt_count + 1,\n updated_at = datetime('now', 'subsec')\n WHERE entity_type = $1 AND local_id = $2",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "a915c22f5ed0bb86c3a242ca38cbc1bfca40ebfe9096058c27e94479b67c7c02"
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "UPDATE sessions SET\n name = CASE WHEN $1 THEN $2 ELSE name END,\n updated_at = datetime('now', 'subsec')\n WHERE id = $3",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "abbda92ba42bea0f7d17d0945d51b011bf50e7b36ee50ed74988e053f6fb0eec"
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id,\n workspace_id AS \"workspace_id: Uuid\",\n repo_id AS \"repo_id: Uuid\",\n pr_url,\n pr_number,\n pr_status AS \"pr_status: MergeStatus\",\n target_branch_name,\n merged_at AS \"merged_at: DateTime<Utc>\",\n merge_commit_sha,\n created_at AS \"created_at!: DateTime<Utc>\",\n updated_at AS \"updated_at!: DateTime<Utc>\",\n synced_at AS \"synced_at: DateTime<Utc>\"\n FROM pull_requests\n WHERE workspace_id = $1\n ORDER BY created_at DESC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 4,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_status: MergeStatus",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merged_at: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit_sha",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 9,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 10,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "synced_at: DateTime<Utc>",
|
||||
"ordinal": 11,
|
||||
"type_info": "Datetime"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "b21ce1663242be3d16c21a076d7b4b584692eb6ae19a3a5f19caba8ad16edce6"
|
||||
}
|
||||
12
crates/db/.sqlx/query-b29a0a95dec6d6e858db41f3b51566a96802654233fd91c7a75446602afd771e.json
generated
Normal file
12
crates/db/.sqlx/query-b29a0a95dec6d6e858db41f3b51566a96802654233fd91c7a75446602afd771e.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO workspace_images (id, workspace_id, image_id)\n SELECT $1, $2, $3\n WHERE NOT EXISTS (\n SELECT 1 FROM workspace_images WHERE workspace_id = $2 AND image_id = $3\n )",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "b29a0a95dec6d6e858db41f3b51566a96802654233fd91c7a75446602afd771e"
|
||||
}
|
||||
86
crates/db/.sqlx/query-b4476bedb8e5c0f7bc21654dc62fb00fbd8a41e24efaba55be8278031d71cc59.json
generated
Normal file
86
crates/db/.sqlx/query-b4476bedb8e5c0f7bc21654dc62fb00fbd8a41e24efaba55be8278031d71cc59.json
generated
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO merges (\n id, workspace_id, repo_id, merge_type, merge_commit, created_at, target_branch_name\n ) VALUES ($1, $2, $3, 'direct', $4, $5, $6)\n RETURNING\n id as \"id!: Uuid\",\n workspace_id as \"workspace_id!: Uuid\",\n repo_id as \"repo_id!: Uuid\",\n merge_type as \"merge_type!: MergeType\",\n merge_commit,\n pr_number,\n pr_url,\n pr_status as \"pr_status?: MergeStatus\",\n pr_merged_at as \"pr_merged_at?: DateTime<Utc>\",\n pr_merge_commit_sha,\n created_at as \"created_at!: DateTime<Utc>\",\n target_branch_name as \"target_branch_name!: String\"\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id!: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "merge_type!: MergeType",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 5,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_status?: MergeStatus",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merged_at?: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merge_commit_sha",
|
||||
"ordinal": 9,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 10,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name!: String",
|
||||
"ordinal": 11,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 6
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "b4476bedb8e5c0f7bc21654dc62fb00fbd8a41e24efaba55be8278031d71cc59"
|
||||
}
|
||||
12
crates/db/.sqlx/query-c27f2fd6b3696cb5a8ec54226608440786a6cec601783f797be3a8c515080d62.json
generated
Normal file
12
crates/db/.sqlx/query-c27f2fd6b3696cb5a8ec54226608440786a6cec601783f797be3a8c515080d62.json
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "DELETE FROM repos\n WHERE id NOT IN (SELECT repo_id FROM project_repos)\n AND id NOT IN (SELECT repo_id FROM workspace_repos)",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "c27f2fd6b3696cb5a8ec54226608440786a6cec601783f797be3a8c515080d62"
|
||||
}
|
||||
20
crates/db/.sqlx/query-c793ee8493c54ea295a62a51650d00894fdad2f2cadc5665ae1e16a605626cb2.json
generated
Normal file
20
crates/db/.sqlx/query-c793ee8493c54ea295a62a51650d00894fdad2f2cadc5665ae1e16a605626cb2.json
generated
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT remote_id as \"remote_id: Uuid\"\n FROM migration_state\n WHERE entity_type = $1 AND local_id = $2 AND status = 'migrated'",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "remote_id: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 2
|
||||
},
|
||||
"nullable": [
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "c793ee8493c54ea295a62a51650d00894fdad2f2cadc5665ae1e16a605626cb2"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT s.id AS \"id!: Uuid\",\n s.workspace_id AS \"workspace_id!: Uuid\",\n s.name,\n s.executor,\n s.agent_working_dir,\n s.created_at AS \"created_at!: DateTime<Utc>\",\n s.updated_at AS \"updated_at!: DateTime<Utc>\"\n FROM sessions s\n LEFT JOIN (\n SELECT ep.session_id, MAX(ep.created_at) as last_used\n FROM execution_processes ep\n WHERE ep.run_reason != 'devserver' AND ep.dropped = FALSE\n GROUP BY ep.session_id\n ) latest_ep ON s.id = latest_ep.session_id\n WHERE s.workspace_id = $1\n ORDER BY COALESCE(latest_ep.last_used, s.created_at) DESC\n LIMIT 1",
|
||||
"query": "SELECT s.id AS \"id!: Uuid\",\n s.workspace_id AS \"workspace_id!: Uuid\",\n s.executor,\n s.agent_working_dir,\n s.created_at AS \"created_at!: DateTime<Utc>\",\n s.updated_at AS \"updated_at!: DateTime<Utc>\"\n FROM sessions s\n LEFT JOIN (\n SELECT ep.session_id, MAX(ep.created_at) as last_used\n FROM execution_processes ep\n WHERE ep.run_reason != 'devserver' AND ep.dropped = FALSE\n GROUP BY ep.session_id\n ) latest_ep ON s.id = latest_ep.session_id\n WHERE s.workspace_id = $1\n ORDER BY COALESCE(latest_ep.last_used, s.created_at) DESC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -14,28 +14,23 @@
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"name": "executor",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "executor",
|
||||
"name": "agent_working_dir",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "agent_working_dir",
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 6,
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
@@ -47,10 +42,9 @@
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "93efe07b91d232fc0c371be8ee618ba6ccfd6930454fc11845d5dfc2ba0bad62"
|
||||
"hash": "c89c89dd9f0943fd0006a232cf035991b0b60dfa9374e697d74be8cf57f6b7f8"
|
||||
}
|
||||
44
crates/db/.sqlx/query-cd6d7ca74442a100d9caf170ac43118795226f50b8392069b47abd4f7564c135.json
generated
Normal file
44
crates/db/.sqlx/query-cd6d7ca74442a100d9caf170ac43118795226f50b8392069b47abd4f7564c135.json
generated
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n COALESCE(SUM(CASE WHEN status = 'pending' THEN 1 ELSE 0 END), 0) as \"pending!: i64\",\n COALESCE(SUM(CASE WHEN status = 'migrated' THEN 1 ELSE 0 END), 0) as \"migrated!: i64\",\n COALESCE(SUM(CASE WHEN status = 'failed' THEN 1 ELSE 0 END), 0) as \"failed!: i64\",\n COALESCE(SUM(CASE WHEN status = 'skipped' THEN 1 ELSE 0 END), 0) as \"skipped!: i64\",\n COUNT(*) as \"total!: i64\"\n FROM migration_state",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "pending!: i64",
|
||||
"ordinal": 0,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "migrated!: i64",
|
||||
"ordinal": 1,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "failed!: i64",
|
||||
"ordinal": 2,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "skipped!: i64",
|
||||
"ordinal": 3,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "total!: i64",
|
||||
"ordinal": 4,
|
||||
"type_info": "Integer"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "cd6d7ca74442a100d9caf170ac43118795226f50b8392069b47abd4f7564c135"
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id,\n workspace_id AS \"workspace_id: Uuid\",\n repo_id AS \"repo_id: Uuid\",\n pr_url,\n pr_number,\n pr_status AS \"pr_status: MergeStatus\",\n target_branch_name,\n merged_at AS \"merged_at: DateTime<Utc>\",\n merge_commit_sha,\n created_at AS \"created_at!: DateTime<Utc>\",\n updated_at AS \"updated_at!: DateTime<Utc>\",\n synced_at AS \"synced_at: DateTime<Utc>\"\n FROM pull_requests\n WHERE pr_url = $1",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 4,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_status: MergeStatus",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merged_at: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit_sha",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 9,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 10,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "synced_at: DateTime<Utc>",
|
||||
"ordinal": 11,
|
||||
"type_info": "Datetime"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "cf93a57f1be9e5944ad328cddfdaf648073c9ce886079d5cc57007abb91459df"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT id AS \"id!: Uuid\",\n workspace_id AS \"workspace_id!: Uuid\",\n name,\n executor,\n agent_working_dir,\n created_at AS \"created_at!: DateTime<Utc>\",\n updated_at AS \"updated_at!: DateTime<Utc>\"\n FROM sessions\n WHERE id = $1",
|
||||
"query": "SELECT id AS \"id!: Uuid\",\n workspace_id AS \"workspace_id!: Uuid\",\n executor,\n agent_working_dir,\n created_at AS \"created_at!: DateTime<Utc>\",\n updated_at AS \"updated_at!: DateTime<Utc>\"\n FROM sessions\n WHERE id = $1",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -14,28 +14,23 @@
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"name": "executor",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "executor",
|
||||
"name": "agent_working_dir",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "agent_working_dir",
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 6,
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
@@ -47,10 +42,9 @@
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "db39f7ab7391c1289299e7f8aa7e1f642874eed0179e91a9558f9df534db797c"
|
||||
"hash": "d0454a00aae3a483df8546221b066aabdd2aa12b91d9a7f09fd9d0b1c1265462"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO sessions (id, workspace_id, name, executor, agent_working_dir)\n VALUES ($1, $2, $3, $4, $5)\n RETURNING id AS \"id!: Uuid\",\n workspace_id AS \"workspace_id!: Uuid\",\n name,\n executor,\n agent_working_dir,\n created_at AS \"created_at!: DateTime<Utc>\",\n updated_at AS \"updated_at!: DateTime<Utc>\"",
|
||||
"query": "INSERT INTO sessions (id, workspace_id, executor, agent_working_dir)\n VALUES ($1, $2, $3, $4)\n RETURNING id AS \"id!: Uuid\",\n workspace_id AS \"workspace_id!: Uuid\",\n executor,\n agent_working_dir,\n created_at AS \"created_at!: DateTime<Utc>\",\n updated_at AS \"updated_at!: DateTime<Utc>\"",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -14,43 +14,37 @@
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"name": "executor",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "executor",
|
||||
"name": "agent_working_dir",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "agent_working_dir",
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 6,
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 5
|
||||
"Right": 4
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "cac90f2884c7c0eed4d2ab621016a5bc62dfbcb65539eb4a52e3306f96c0698a"
|
||||
"hash": "df0b54499ab1f0cee214240a0202d9dddef7daba37521e64a359e587f86aad33"
|
||||
}
|
||||
68
crates/db/.sqlx/query-ee06dfd8dc7fc2ffc239db9635a3a5cac2e603992392a632bff7d450c6bca061.json
generated
Normal file
68
crates/db/.sqlx/query-ee06dfd8dc7fc2ffc239db9635a3a5cac2e603992392a632bff7d450c6bca061.json
generated
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO migration_state (id, entity_type, local_id)\n VALUES ($1, $2, $3)\n RETURNING\n id as \"id!: Uuid\",\n entity_type as \"entity_type!: EntityType\",\n local_id as \"local_id!: Uuid\",\n remote_id as \"remote_id: Uuid\",\n status as \"status!: MigrationStatus\",\n error_message,\n attempt_count as \"attempt_count!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "entity_type!: EntityType",
|
||||
"ordinal": 1,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "local_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "remote_id: Uuid",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "status!: MigrationStatus",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "error_message",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "attempt_count!",
|
||||
"ordinal": 6,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 3
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "ee06dfd8dc7fc2ffc239db9635a3a5cac2e603992392a632bff7d450c6bca061"
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id,\n workspace_id AS \"workspace_id: Uuid\",\n repo_id AS \"repo_id: Uuid\",\n pr_url,\n pr_number,\n pr_status AS \"pr_status: MergeStatus\",\n target_branch_name,\n merged_at AS \"merged_at: DateTime<Utc>\",\n merge_commit_sha,\n created_at AS \"created_at!: DateTime<Utc>\",\n updated_at AS \"updated_at!: DateTime<Utc>\",\n synced_at AS \"synced_at: DateTime<Utc>\"\n FROM pull_requests\n WHERE workspace_id IS NOT NULL\n ORDER BY created_at ASC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 4,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_status: MergeStatus",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merged_at: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit_sha",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 9,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 10,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "synced_at: DateTime<Utc>",
|
||||
"ordinal": 11,
|
||||
"type_info": "Datetime"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "ef0020050eca66193646fc9193159715625820e6fc5b314631f762ccaba6ac74"
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "INSERT INTO pull_requests (id, workspace_id, repo_id, pr_url, pr_number, pr_status, target_branch_name, created_at)\n VALUES (?, ?, ?, ?, ?, 'open', ?, ?)\n ON CONFLICT(pr_url) DO UPDATE SET\n workspace_id = COALESCE(pull_requests.workspace_id, excluded.workspace_id),\n repo_id = COALESCE(pull_requests.repo_id, excluded.repo_id),\n updated_at = CURRENT_TIMESTAMP",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 7
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "f393e611063de7c8a3f1e32f5b3cd6ca859139a79aa94ca8669470ba61e691e4"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT id as \"id!: Uuid\",\n file_path as \"file_path!\",\n original_name as \"original_name!\",\n mime_type,\n size_bytes as \"size_bytes!\",\n hash as \"hash!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM attachments\n WHERE file_path = $1",
|
||||
"query": "SELECT id as \"id!: Uuid\",\n file_path as \"file_path!\",\n original_name as \"original_name!\",\n mime_type,\n size_bytes as \"size_bytes!\",\n hash as \"hash!\",\n created_at as \"created_at!: DateTime<Utc>\",\n updated_at as \"updated_at!: DateTime<Utc>\"\n FROM images\n WHERE file_path = $1",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -58,5 +58,5 @@
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "abff188fc81caf44081e2053cb7841d1dc6c1a8965f4b862caa2f9cebcae0176"
|
||||
"hash": "f4dfe229b47380175daba08daa93a9b832e5ba96da7f68374b05d09ec93087e1"
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id,\n workspace_id AS \"workspace_id: Uuid\",\n repo_id AS \"repo_id: Uuid\",\n pr_url,\n pr_number,\n pr_status AS \"pr_status: MergeStatus\",\n target_branch_name,\n merged_at AS \"merged_at: DateTime<Utc>\",\n merge_commit_sha,\n created_at AS \"created_at!: DateTime<Utc>\",\n updated_at AS \"updated_at!: DateTime<Utc>\",\n synced_at AS \"synced_at: DateTime<Utc>\"\n FROM pull_requests\n WHERE pr_status = 'open'",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"ordinal": 0,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 4,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_status: MergeStatus",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merged_at: DateTime<Utc>",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit_sha",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 9,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 10,
|
||||
"type_info": "Datetime"
|
||||
},
|
||||
{
|
||||
"name": "synced_at: DateTime<Utc>",
|
||||
"ordinal": 11,
|
||||
"type_info": "Datetime"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": [
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "f81f1b377d63ffb204e2860289c5dc3001a68404e016c75ef6427bdd0909862e"
|
||||
}
|
||||
98
crates/db/.sqlx/query-f9e8640c28fae8aebf3d8b0d3984804fdb3f197c8cc2d5750fd267c82e3e68a1.json
generated
Normal file
98
crates/db/.sqlx/query-f9e8640c28fae8aebf3d8b0d3984804fdb3f197c8cc2d5750fd267c82e3e68a1.json
generated
Normal file
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT DISTINCT r.id as \"id!: Uuid\",\n r.path,\n r.name,\n r.display_name,\n r.setup_script,\n r.cleanup_script,\n r.archive_script,\n r.copy_files,\n r.parallel_setup_script as \"parallel_setup_script!: bool\",\n r.dev_server_script,\n r.default_target_branch,\n r.default_working_dir,\n r.created_at as \"created_at!: DateTime<Utc>\",\n r.updated_at as \"updated_at!: DateTime<Utc>\"\n FROM repos r\n JOIN workspace_repos wr ON r.id = wr.repo_id\n JOIN workspaces w ON wr.workspace_id = w.id\n WHERE w.task_id = $1\n ORDER BY r.display_name ASC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"ordinal": 1,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"ordinal": 2,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "display_name",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "setup_script",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "cleanup_script",
|
||||
"ordinal": 5,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "archive_script",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "copy_files",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "parallel_setup_script!: bool",
|
||||
"ordinal": 8,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "dev_server_script",
|
||||
"ordinal": 9,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "default_target_branch",
|
||||
"ordinal": 10,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "default_working_dir",
|
||||
"ordinal": 11,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 12,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at!: DateTime<Utc>",
|
||||
"ordinal": 13,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 1
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "f9e8640c28fae8aebf3d8b0d3984804fdb3f197c8cc2d5750fd267c82e3e68a1"
|
||||
}
|
||||
86
crates/db/.sqlx/query-faae305f6ac9dc7d04d21c76531cde3912647430195267ffa5b99bb9a7df1feb.json
generated
Normal file
86
crates/db/.sqlx/query-faae305f6ac9dc7d04d21c76531cde3912647430195267ffa5b99bb9a7df1feb.json
generated
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "SELECT\n id as \"id!: Uuid\",\n workspace_id as \"workspace_id!: Uuid\",\n repo_id as \"repo_id!: Uuid\",\n merge_type as \"merge_type!: MergeType\",\n merge_commit,\n pr_number,\n pr_url,\n pr_status as \"pr_status?: MergeStatus\",\n pr_merged_at as \"pr_merged_at?: DateTime<Utc>\",\n pr_merge_commit_sha,\n created_at as \"created_at!: DateTime<Utc>\",\n target_branch_name as \"target_branch_name!: String\"\n FROM merges\n WHERE merge_type = 'pr' AND pr_status = 'open'\n ORDER BY created_at DESC",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id!: Uuid",
|
||||
"ordinal": 0,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "workspace_id!: Uuid",
|
||||
"ordinal": 1,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "repo_id!: Uuid",
|
||||
"ordinal": 2,
|
||||
"type_info": "Blob"
|
||||
},
|
||||
{
|
||||
"name": "merge_type!: MergeType",
|
||||
"ordinal": 3,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "merge_commit",
|
||||
"ordinal": 4,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_number",
|
||||
"ordinal": 5,
|
||||
"type_info": "Integer"
|
||||
},
|
||||
{
|
||||
"name": "pr_url",
|
||||
"ordinal": 6,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_status?: MergeStatus",
|
||||
"ordinal": 7,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merged_at?: DateTime<Utc>",
|
||||
"ordinal": 8,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "pr_merge_commit_sha",
|
||||
"ordinal": 9,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at!: DateTime<Utc>",
|
||||
"ordinal": 10,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "target_branch_name!: String",
|
||||
"ordinal": 11,
|
||||
"type_info": "Text"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Right": 0
|
||||
},
|
||||
"nullable": [
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "faae305f6ac9dc7d04d21c76531cde3912647430195267ffa5b99bb9a7df1feb"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "db"
|
||||
version = "0.1.44"
|
||||
version = "0.1.30"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
@@ -19,3 +19,4 @@ serde_with = { workspace = true }
|
||||
strum = "0.27.2"
|
||||
strum_macros = "0.27.2"
|
||||
futures = "0.3.32"
|
||||
log = "0.4.29"
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
CREATE TABLE pull_requests (
|
||||
id TEXT PRIMARY KEY NOT NULL,
|
||||
workspace_id BLOB,
|
||||
repo_id BLOB,
|
||||
pr_url TEXT NOT NULL UNIQUE,
|
||||
pr_number INTEGER NOT NULL,
|
||||
pr_status TEXT NOT NULL DEFAULT 'open',
|
||||
target_branch_name TEXT NOT NULL,
|
||||
merged_at TEXT,
|
||||
merge_commit_sha TEXT,
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
synced_at DATETIME
|
||||
);
|
||||
|
||||
-- Migrate workspace PR data from merges into pull_requests
|
||||
INSERT OR IGNORE INTO pull_requests (id, workspace_id, repo_id, pr_url, pr_number, pr_status, target_branch_name, merged_at, merge_commit_sha, created_at, updated_at, synced_at)
|
||||
SELECT hex(id), workspace_id, repo_id, pr_url, pr_number, COALESCE(pr_status, 'open'), target_branch_name, pr_merged_at, pr_merge_commit_sha, created_at, created_at, created_at
|
||||
FROM merges WHERE merge_type = 'pr' AND pr_url IS NOT NULL;
|
||||
|
||||
-- Remove PR rows from merges (now in pull_requests)
|
||||
DELETE FROM merges WHERE merge_type = 'pr';
|
||||
|
||||
CREATE INDEX idx_pull_requests_status ON pull_requests(pr_status);
|
||||
CREATE INDEX idx_pull_requests_workspace_id ON pull_requests(workspace_id);
|
||||
|
||||
PRAGMA optimize;
|
||||
@@ -1,2 +0,0 @@
|
||||
-- Add name column to sessions table
|
||||
ALTER TABLE sessions ADD COLUMN name TEXT;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user