logiguard fork v3: full patch set on verified 8c74db0 tree
Includes prior-session patches (carry forward so the app compiles): - crates/gpui/build.rs: cross-compile manifest fix - crates/gpui/src/platform.rs: PlatformWindow::activate_with_token trait method - crates/gpui/src/window.rs: Window::activate_with_token public API - crates/gpui_linux/src/linux/wayland/window.rs: WaylandWindow::activate_with_token + activate() keyboard-serial fix Plus the focus-serial fix: - serial.rs: SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; latest_serial_of() Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
68
script/lib/blob-store.ps1
Normal file
68
script/lib/blob-store.ps1
Normal file
@@ -0,0 +1,68 @@
|
||||
function UploadToBlobStoreWithACL {
|
||||
param (
|
||||
[string]$BucketName,
|
||||
[string]$FileToUpload,
|
||||
[string]$BlobStoreKey,
|
||||
[string]$ACL
|
||||
)
|
||||
|
||||
# Format date to match AWS requirements
|
||||
$Date = (Get-Date).ToUniversalTime().ToString("r")
|
||||
# Note: Original script had a bug where it overrode the ACL parameter
|
||||
# I'm keeping the same behavior for compatibility
|
||||
$ACL = "public-read"
|
||||
$ContentType = "application/octet-stream"
|
||||
$StorageClass = "STANDARD"
|
||||
|
||||
# Create string to sign (AWS S3 compatible format)
|
||||
$StringToSign = "PUT`n`n${ContentType}`n${Date}`nx-amz-acl:${ACL}`nx-amz-storage-class:${StorageClass}`n/${BucketName}/${BlobStoreKey}"
|
||||
|
||||
# Generate HMAC-SHA1 signature
|
||||
$HMACSHA1 = New-Object System.Security.Cryptography.HMACSHA1
|
||||
$HMACSHA1.Key = [System.Text.Encoding]::UTF8.GetBytes($env:DIGITALOCEAN_SPACES_SECRET_KEY)
|
||||
$Signature = [System.Convert]::ToBase64String($HMACSHA1.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($StringToSign)))
|
||||
|
||||
# Upload file using Invoke-WebRequest (equivalent to curl)
|
||||
$Headers = @{
|
||||
"Host" = "${BucketName}.nyc3.digitaloceanspaces.com"
|
||||
"Date" = $Date
|
||||
"Content-Type" = $ContentType
|
||||
"x-amz-storage-class" = $StorageClass
|
||||
"x-amz-acl" = $ACL
|
||||
"Authorization" = "AWS ${env:DIGITALOCEAN_SPACES_ACCESS_KEY}:$Signature"
|
||||
}
|
||||
|
||||
$Uri = "https://${BucketName}.nyc3.digitaloceanspaces.com/${BlobStoreKey}"
|
||||
|
||||
# Read file content
|
||||
$FileContent = Get-Content $FileToUpload -Raw -AsByteStream
|
||||
|
||||
try {
|
||||
Invoke-WebRequest -Uri $Uri -Method PUT -Headers $Headers -Body $FileContent -ContentType $ContentType -Verbose
|
||||
Write-Host "Successfully uploaded $FileToUpload to $Uri" -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Error "Failed to upload file: $_"
|
||||
throw $_
|
||||
}
|
||||
}
|
||||
|
||||
function UploadToBlobStorePublic {
|
||||
param (
|
||||
[string]$BucketName,
|
||||
[string]$FileToUpload,
|
||||
[string]$BlobStoreKey
|
||||
)
|
||||
|
||||
UploadToBlobStoreWithACL -BucketName $BucketName -FileToUpload $FileToUpload -BlobStoreKey $BlobStoreKey -ACL "public-read"
|
||||
}
|
||||
|
||||
function UploadToBlobStore {
|
||||
param (
|
||||
[string]$BucketName,
|
||||
[string]$FileToUpload,
|
||||
[string]$BlobStoreKey
|
||||
)
|
||||
|
||||
UploadToBlobStoreWithACL -BucketName $BucketName -FileToUpload $FileToUpload -BlobStoreKey $BlobStoreKey -ACL "private"
|
||||
}
|
||||
32
script/lib/blob-store.sh
Normal file
32
script/lib/blob-store.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
function upload_to_blob_store_with_acl
|
||||
{
|
||||
bucket_name="$1"
|
||||
file_to_upload="$2"
|
||||
blob_store_key="$3"
|
||||
acl="$4"
|
||||
|
||||
date=$(date +"%a, %d %b %Y %T %z")
|
||||
content_type="application/octet-stream"
|
||||
storage_type="x-amz-storage-class:STANDARD"
|
||||
string="PUT\n\n${content_type}\n${date}\n${acl}\n${storage_type}\n/${bucket_name}/${blob_store_key}"
|
||||
signature=$(echo -en "${string}" | openssl sha1 -hmac "${DIGITALOCEAN_SPACES_SECRET_KEY}" -binary | base64)
|
||||
|
||||
curl --fail -vv -s -X PUT -T "$file_to_upload" \
|
||||
-H "Host: ${bucket_name}.nyc3.digitaloceanspaces.com" \
|
||||
-H "Date: $date" \
|
||||
-H "Content-Type: $content_type" \
|
||||
-H "$storage_type" \
|
||||
-H "$acl" \
|
||||
-H "Authorization: AWS ${DIGITALOCEAN_SPACES_ACCESS_KEY}:$signature" \
|
||||
"https://${bucket_name}.nyc3.digitaloceanspaces.com/${blob_store_key}"
|
||||
}
|
||||
|
||||
function upload_to_blob_store_public
|
||||
{
|
||||
upload_to_blob_store_with_acl "$1" "$2" "$3" "x-amz-acl:public-read"
|
||||
}
|
||||
|
||||
function upload_to_blob_store
|
||||
{
|
||||
upload_to_blob_store_with_acl "$1" "$2" "$3" "x-amz-acl:private"
|
||||
}
|
||||
55
script/lib/bump-version.sh
Executable file
55
script/lib/bump-version.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
package=$1
|
||||
tag_prefix=$2
|
||||
tag_suffix=$3
|
||||
version_increment=$4
|
||||
gpui_release=${5:-false}
|
||||
|
||||
if [[ -n $(git status --short --untracked-files=no) ]]; then
|
||||
echo "can't bump version with uncommitted changes"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
which cargo-set-version > /dev/null || cargo install cargo-edit
|
||||
which jq > /dev/null || brew install jq
|
||||
cargo set-version --package $package --bump $version_increment
|
||||
cargo check --quiet
|
||||
|
||||
new_version=$(script/get-crate-version $package)
|
||||
branch_name=$(git rev-parse --abbrev-ref HEAD)
|
||||
old_sha=$(git rev-parse HEAD)
|
||||
tag_name=${tag_prefix}${new_version}${tag_suffix}
|
||||
|
||||
git commit --quiet --all --message "${package} ${new_version}"
|
||||
git tag ${tag_name}
|
||||
|
||||
if [[ "$gpui_release" == "true" ]]; then
|
||||
cat <<MESSAGE
|
||||
Locally committed and tagged ${package} version ${new_version}
|
||||
|
||||
To push this:
|
||||
|
||||
git push origin ${tag_name} ${branch_name}; gh pr create -H ${branch_name}
|
||||
|
||||
To undo this:
|
||||
|
||||
git branch -D ${branch_name} && git tag -d ${tag_name}
|
||||
|
||||
MESSAGE
|
||||
else
|
||||
cat <<MESSAGE
|
||||
Locally committed and tagged ${package} version ${new_version}
|
||||
|
||||
To push this:
|
||||
|
||||
git push origin ${tag_name} ${branch_name}
|
||||
|
||||
To undo this:
|
||||
|
||||
git reset --hard ${old_sha} && git tag -d ${tag_name}
|
||||
|
||||
MESSAGE
|
||||
fi
|
||||
37
script/lib/deploy-helpers.sh
Normal file
37
script/lib/deploy-helpers.sh
Normal file
@@ -0,0 +1,37 @@
|
||||
function export_vars_for_environment {
|
||||
local environment=$1
|
||||
local env_file="crates/collab/k8s/environments/${environment}.sh"
|
||||
if [[ ! -f $env_file ]]; then
|
||||
echo "Invalid environment name '${environment}'" >&2
|
||||
exit 1
|
||||
fi
|
||||
export $(grep -v '^#' $env_file | grep -v '^[[:space:]]*$')
|
||||
}
|
||||
|
||||
function target_zed_kube_cluster {
|
||||
if [[ $(kubectl config current-context 2> /dev/null) != do-nyc1-zed-1 ]]; then
|
||||
doctl kubernetes cluster kubeconfig save zed-1
|
||||
fi
|
||||
}
|
||||
|
||||
function tag_for_environment {
|
||||
if [[ "$1" == "production" ]]; then
|
||||
echo "collab-production"
|
||||
elif [[ "$1" == "staging" ]]; then
|
||||
echo "collab-staging"
|
||||
else
|
||||
echo "Invalid environment name '${environment}'" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function url_for_environment {
|
||||
if [[ "$1" == "production" ]]; then
|
||||
echo "https://collab.zed.dev"
|
||||
elif [[ "$1" == "staging" ]]; then
|
||||
echo "https://collab-staging.zed.dev"
|
||||
else
|
||||
echo "Invalid environment name '${environment}'" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
11
script/lib/squawk.toml
Normal file
11
script/lib/squawk.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
excluded_rules = [
|
||||
# We use `serial` already, no point changing now.
|
||||
"prefer-identity",
|
||||
|
||||
# We store timestamps in UTC, so we don't care about the timezone.
|
||||
"prefer-timestamptz",
|
||||
|
||||
"prefer-big-int",
|
||||
"prefer-bigint-over-int",
|
||||
]
|
||||
pg_version = "15.0"
|
||||
6
script/lib/workspace.ps1
Normal file
6
script/lib/workspace.ps1
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
function ParseZedWorkspace {
|
||||
$metadata = cargo metadata --no-deps --offline | ConvertFrom-Json
|
||||
$env:ZED_WORKSPACE = $metadata.workspace_root
|
||||
$env:RELEASE_VERSION = $metadata.packages | Where-Object { $_.name -eq "zed" } | Select-Object -ExpandProperty version
|
||||
}
|
||||
Reference in New Issue
Block a user