Skip to content

Commit 04f8de0

Browse files
committed
refactor(supabase): remove unused health_timeout config
The health_timeout setting is no longer used in the local database startup process, so it can be safely removed from the config file.
1 parent b3a7d6c commit 04f8de0

3 files changed

Lines changed: 25 additions & 16 deletions

File tree

.github/workflows/supabase-migrations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ jobs:
4040
4141
- name: Apply migrations
4242
if: steps.check-migrations.outputs.migrations_changed == 'true'
43-
run: npx --yes supabase@latest migration up --db-url "${{ secrets.SUPABASE_DB_URL }}" --include-all
43+
run: npx --yes supabase@2.72.8 migration up --db-url "${{ secrets.SUPABASE_DB_URL }}" --include-all

apps/web/src/inngest/functions/analyze-repo.ts

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,10 @@ export const analyzeRepo = inngest.createFunction(
749749
});
750750

751751
if (prs.length === 0) {
752+
await supabase
753+
.from("repos")
754+
.update({ last_pr_sync_at: new Date().toISOString() })
755+
.eq("id", repoId);
752756
return {
753757
total: 0,
754758
merged: 0,
@@ -818,9 +822,15 @@ export const analyzeRepo = inngest.createFunction(
818822
if (pr.merged && pr.merge_commit_sha) {
819823
const commit = mergeCommitDetails.get(pr.merge_commit_sha);
820824
const parentCount = commit?.parents?.length ?? 0;
821-
if (parentCount >= 2) mergeMethod = "merge";
822-
else if (pr.merge_commit_sha === pr.head.sha) mergeMethod = "rebase";
823-
else mergeMethod = "squash";
825+
if (!commit) {
826+
mergeMethod = "unknown";
827+
} else if (parentCount >= 2) {
828+
mergeMethod = "merge";
829+
} else if (pr.merge_commit_sha === pr.head.sha) {
830+
mergeMethod = "rebase";
831+
} else {
832+
mergeMethod = "squash";
833+
}
824834
}
825835

826836
if (mergeMethod === "merge") mergeMethodCounts.merge += 1;
@@ -834,7 +844,6 @@ export const analyzeRepo = inngest.createFunction(
834844
repo_id: repoId,
835845
github_pr_number: pr.number,
836846
title: pr.title,
837-
body: pr.body,
838847
state: pr.state,
839848
merged: pr.merged,
840849
merged_at: pr.merged_at,
@@ -864,20 +873,20 @@ export const analyzeRepo = inngest.createFunction(
864873
.upsert(rows, { onConflict: "repo_id,github_pr_number" });
865874
if (prUpsertError) {
866875
console.warn("Failed to upsert pull requests:", prUpsertError.message);
876+
} else {
877+
await supabase
878+
.from("repos")
879+
.update({ last_pr_sync_at: new Date().toISOString() })
880+
.eq("id", repoId);
867881
}
868882

869-
await supabase
870-
.from("repos")
871-
.update({ last_pr_sync_at: new Date().toISOString() })
872-
.eq("id", repoId);
873-
874-
const mergedCount = detailed.filter((pr) => pr.merged).length;
875-
const checklistCount = detailed.filter((pr) => hasChecklist(pr.body)).length;
876-
const templateCount = detailed.filter((pr) => hasTemplateMarkers(pr.body)).length;
877-
const linkedIssueCount = detailed.filter((pr) => extractLinkedIssueNumbers(pr.body).length > 0)
883+
const mergedCount = prs.filter((pr) => Boolean(pr.merged_at)).length;
884+
const checklistCount = prs.filter((pr) => hasChecklist(pr.body)).length;
885+
const templateCount = prs.filter((pr) => hasTemplateMarkers(pr.body)).length;
886+
const linkedIssueCount = prs.filter((pr) => extractLinkedIssueNumbers(pr.body).length > 0)
878887
.length;
879888

880-
const denom = detailed.length;
889+
const denom = prs.length;
881890

882891
return {
883892
total: denom,

supabase/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ port = 54422
3030
# Port used by db diff command to initialize the shadow database.
3131
shadow_port = 54420
3232
# Maximum amount of time to wait for health check when starting the local database.
33-
health_timeout = "2m"
33+
# health_timeout = "2m"
3434
# The database major version to use. This has to be the same as your remote database's. Run `SHOW
3535
# server_version;` on the remote database to check.
3636
major_version = 17

0 commit comments

Comments
 (0)