diff --git a/.github/workflows/ai-code-review.yml b/.github/workflows/ai-code-review.yml index 51e343891..bfd7c4882 100644 --- a/.github/workflows/ai-code-review.yml +++ b/.github/workflows/ai-code-review.yml @@ -77,6 +77,7 @@ jobs: - uses: rubensflinco/gemini-code-review-action@1.0.5 name: "Code Review by Gemini AI" id: review + continue-on-error: true with: gemini_api_key: ${{ secrets.GEMINI_API_KEY }} github_token: ${{ secrets.GITHUB_TOKEN }} @@ -95,29 +96,31 @@ jobs: When a line start with a minus (`-`) it means that the line was removed, when it starts with plus (`+`) it means that the line was added. log_level: "DEBUG" - - name: Add thumbs down reaction if something went wrong - if: steps.review.outcome == 'failure' - run: gh api graphql --silent --raw-field query="mutation AddReaction {addReaction(input:{subjectId:\"$NODE_ID\",content:THUMBS_DOWN}){reaction{content}subject{id}}}" + - name: Get current job ID + id: get-job-id + run: | + job_uri=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name == "${{ github.job }}") | .url') + echo "job_uri=$job_uri" >> $GITHUB_OUTPUT env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_ID: ${{ github.event.comment.node_id }} - - - name: Get Gemini step log - if: steps.review.outcome == 'failure' - id: get-gemini-log - run: | - echo "gemini_log<> $GITHUB_OUTPUT - gh run view ${{ steps.review.outputs.run_id }} --log >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - name: Add comment with log if: steps.review.outcome == 'failure' uses: actions/github-script@v6 with: script: | + const runUrl = `${{ steps.get-job-id.outputs.job_uri }}#step:8:1`; + const commentBody = `Gemini Code Review encountered an error. [View the run here](${runUrl}).\n\nSee **Code Review by Gemini AI** step as it may still contains some review before failing.`; github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: 'Gemini Code Review encountered an error. Here is the step log:\n\n```\n${{ steps.get-gemini-log.outputs.gemini_log }}\n```' + body: commentBody }); + + - name: Add thumbs down reaction if something went wrong + if: failure() + run: gh api graphql --silent --raw-field query="mutation AddReaction {addReaction(input:{subjectId:\"$NODE_ID\",content:THUMBS_DOWN}){reaction{content}subject{id}}}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_ID: ${{ github.event.comment.node_id }} diff --git a/apps/web/components/ActivatePoints.tsx b/apps/web/components/ActivatePoints.tsx index e002e8e41..28b36f394 100644 --- a/apps/web/components/ActivatePoints.tsx +++ b/apps/web/components/ActivatePoints.tsx @@ -25,7 +25,6 @@ type ActiveMemberProps = { export function ActivatePoints({ strategy, - communityAddress, isMember, isMemberActivated, }: ActiveMemberProps) { diff --git a/apps/web/components/CheckPassport.tsx b/apps/web/components/CheckPassport.tsx index 9c285eaf4..c21a1d2ca 100644 --- a/apps/web/components/CheckPassport.tsx +++ b/apps/web/components/CheckPassport.tsx @@ -14,10 +14,10 @@ import { Button } from "./Button"; import { Skeleton } from "./Skeleton"; import { Modal } from "@/components"; import { isProd } from "@/configs/isProd"; +import { usePubSubContext } from "@/contexts/pubsub.context"; import { useChainIdFromPath } from "@/hooks/useChainIdFromPath"; import { useSubgraphQuery } from "@/hooks/useSubgraphQuery"; import { CV_PASSPORT_THRESHOLD_SCALE } from "@/utils/numbers"; -import { usePubSubContext } from "@/contexts/pubsub.context"; type SubmitPassportResponse = { data: any; diff --git a/apps/web/components/DisputeButton.tsx b/apps/web/components/DisputeButton.tsx index 0d6c14fe8..3773197ea 100644 --- a/apps/web/components/DisputeButton.tsx +++ b/apps/web/components/DisputeButton.tsx @@ -79,6 +79,7 @@ export const DisputeButton: FC = ({ proposalData }) => { const [isDisputeCreateLoading, setIsDisputeCreateLoading] = useState(false); const chainId = useChainIdFromPath(); const [rulingLoading, setisRulingLoading] = useState(false); + const [error, setError] = useState(""); const arbitrationConfig = proposalData.arbitrableConfig; @@ -113,7 +114,7 @@ export const DisputeButton: FC = ({ proposalData }) => { }); const totalStake = - arbitrationCost && arbitrationConfig ? + arbitrationCost != null && arbitrationConfig ? arbitrationCost + BigInt(arbitrationConfig.challengerCollateralAmount) : undefined; const lastDispute = @@ -175,14 +176,18 @@ export const DisputeButton: FC = ({ proposalData }) => { }); async function handleSubmit() { - setIsDisputeCreateLoading(true); - const reasonHash = await ipfsJsonUpload({ reason }, "disputeReason"); - if (!reasonHash) { - return; + if (!reason) { + setError("The dispute reason is required."); + } else { + setIsDisputeCreateLoading(true); + const reasonHash = await ipfsJsonUpload({ reason }, "disputeReason"); + if (!reasonHash) { + return; + } + await writeDisputeProposalAsync({ + args: [BigInt(proposalData.proposalNumber), reasonHash, "0x0"], + }); } - await writeDisputeProposalAsync({ - args: [BigInt(proposalData.proposalNumber), reasonHash, "0x0"], - }); } const { write: writeSubmitRuling } = useContractWriteWithConfirmations({ @@ -275,14 +280,18 @@ export const DisputeButton: FC = ({ proposalData }) => { ))} :
-