Skip to content

Commit

Permalink
fix: feedback filter (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcrt authored May 3, 2024
1 parent 0afc15b commit b83c525
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-push-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,8 @@ jobs:
context: .
file: ./ops/lunary-ee.Dockerfile
push: true
tags: lunary/lunary-ee:latest
tags: |
lunary/lunary-ee:latest
lunary/lunary-ee:rev-${{ steps.date.outputs.date }}-${{ steps.commit.outputs.hash }}
${{ github.event.release.tag_name != '' && format('lunary/{0}:{1}', 'lunary-ee', steps.release_tag.outputs.tag) || '' }}
platforms: linux/amd64,linux/arm64
4 changes: 3 additions & 1 deletion packages/backend/src/checks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ export const CHECK_RUNNERS: CheckRunner[] = [
const value = parsedType[key]
if (key === "comment") {
// comment is a special case because there can be infinite values
return sql`r.feedback->${key} IS NOT NULL OR rpfc.feedback->${key} IS NOT NULL`
return sql`r.feedback->${key} is not null or rpfc.feedback->${key} is not null`
} else if (key === "thumb") {
return sql`r.feedback->>'thumbs' = ${value} or rpfc.feedback->>'thumbs' = ${value} or r.feedback->>'thumb' = ${value} or rpfc.feedback->>'thumb' = ${value}`
} else {
return sql`r.feedback->>${key} = ${value} OR rpfc.feedback->>${key} = ${value}`
}
Expand Down
2 changes: 2 additions & 0 deletions packages/db/0011.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
create index idx_run_feedback_thumb on run using gin ((feedback -> 'thumb') jsonb_path_ops);
create index idx_run_feedback_thumbs on run using gin ((feedback -> 'thumbs') jsonb_path_ops);

0 comments on commit b83c525

Please sign in to comment.