tirbofish/kitgit · commit
d03e8ac0517202e8b5ca61459a25474466c4ddb3
Improve repo UX with PR reviews, invite signup, and cleaner chrome.
Add pull reviews and full-diff expand, let invite codes bypass locked signups, and rework the branch toolbar / latest-commit bar plus related settings UI polish.
Type: SSH
SSH Key Fingerprint:
Verified
SgQHY4vUORbJC3ZtdixCl62ek/4QGh/iG2FRSyjfGPc
@@ -0,0 +1,9 @@ +CREATE TABLE IF NOT EXISTS pull_reviews ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + pull_id UUID NOT NULL REFERENCES pull_requests(id) ON DELETE CASCADE, + reviewer_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, + state TEXT NOT NULL CHECK (state IN ('approved','changes_requested','commented')), + body TEXT NOT NULL DEFAULT '', + created_at TIMESTAMPTZ NOT NULL DEFAULT now() +); +CREATE INDEX IF NOT EXISTS pull_reviews_pull_id_idx ON pull_reviews(pull_id); @@ -288,6 +288,16 @@ pub struct Comment { } #[derive(Debug, Clone, FromRow)] +pub struct PullReview { + pub id: Uuid, + pub pull_id: Uuid, + pub reviewer_id: Uuid, + pub state: String, + pub body: String, + pub created_at: DateTime<Utc>, +} + +#[derive(Debug, Clone, FromRow)] pub struct Release { pub id: Uuid, pub repo_id: Uuid, @@ -1326,6 +1326,29 @@ pub async fn user_owns_email(pool: &PgPool, user_id: Uuid, email: &str) -> Resul Ok(row.is_some()) } +/// Resolve a kitgit username from a commit author email (primary or secondary). +pub async fn username_by_email(pool: &PgPool, email: &str) -> Result<Option<String>> { + let email = email.trim().to_ascii_lowercase(); + if email.is_empty() { + return Ok(None); + }
Large diffs are not rendered by default. Showing the first 50 of 2161 lines. Show full diff