Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement diamond pattern for CV Strategy #460

Draft
wants to merge 539 commits into
base: diamond-others-contracts
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
539 commits
Select commit Hold shift + click to select a range
b65ef0c
refactor: streamline proposal handling and logic.
Corantin Oct 9, 2024
bc8ad6c
Fix
Corantin Oct 9, 2024
4df1735
Merge pull request #457 from 1Hive/fix-signaling-not-loading
Corantin Oct 9, 2024
d531128
Merge branch 'dev' into 399-pool-form-touchup
Corantin Oct 9, 2024
317d026
Merge remote-tracking branch 'origin/dev' into proposal-countdownnn
Corantin Oct 10, 2024
0e2a594
Merge remote-tracking branch 'origin/dev' into proposal-countdownnn
Corantin Oct 10, 2024
1a6e1c4
Merge pull request #456 from 1Hive/399-pool-form-touchup
Corantin Oct 10, 2024
50c4fca
Merge remote-tracking branch 'origin/dev' into proposal-countdownnn
Corantin Oct 10, 2024
19c02fb
Merge pull request #450 from 1Hive/proposal-countdownnn
Corantin Oct 10, 2024
d58b4fa
refactor: remove unused proposalType variable.
Corantin Oct 10, 2024
cadaf76
Merge branch 'dev' into proposal-countdownnn
Corantin Oct 10, 2024
199558e
Merge pull request #463 from 1Hive/proposal-countdownnn
Corantin Oct 10, 2024
ffed359
Merge remote-tracking branch 'origin/main' into dev
Corantin Oct 10, 2024
913120d
:recycle: Refactor GoBackButton navigation logic
Corantin Oct 10, 2024
92e0247
:art: Updated styling for MarkdownEditor
Corantin Oct 10, 2024
4d5bc3d
:recycle: Simplified import and removed unused code
Corantin Oct 10, 2024
fb8ede5
Lock file update
Corantin Oct 10, 2024
62ba2c4
Merge from dev
Corantin Oct 10, 2024
272d611
:bug: Fixed null poolTokenAddress issue
Corantin Oct 10, 2024
fc2d52e
Merge remote-tracking branch 'origin/dev' into allowlist-feature
Corantin Oct 10, 2024
de0aa83
Merge branch 'allowlist-feature' into ui-allowlist
Corantin Oct 10, 2024
9638254
Merge branch 'dev' of https://github.com/1Hive/gardens-v2 into dev
Mati0x Oct 10, 2024
e638eb6
Merge remote-tracking branch 'origin/dev' into Touchups
Mati0x Oct 10, 2024
cc7df62
Merge pull request #464 from 1Hive/enhance-back-button
Corantin Oct 10, 2024
6a966c9
Merge remote-tracking branch 'origin/dev' into ui-allowlist
Corantin Oct 10, 2024
9c2e535
Auto stash before merge of "ui-allowlist" and "origin/dev"
Corantin Oct 10, 2024
fcb89f2
upgrade proposal form collateral title and description
Mati0x Oct 10, 2024
0e4735e
feat: desc order when querying pools in community page
Mati0x Oct 10, 2024
34042b6
Merge branch 'dev' into Touchups
Mati0x Oct 10, 2024
0868c93
:recycle: Refactored form input components
Corantin Oct 10, 2024
7880a77
:recycle: Refactored form components for better reusability
Corantin Oct 10, 2024
b078436
Merge remote-tracking branch 'origin/dev' into Touchups
Corantin Oct 10, 2024
fbf40ca
Fix readme
Corantin Oct 10, 2024
26a0ba0
Merge branch 'Touchups' of https://github.com/1Hive/gardens-v2 into T…
Mati0x Oct 10, 2024
f7d053a
upgrade PoolCard + minor fix in CommunityCard
Mati0x Oct 10, 2024
3f0a90d
small fix
Mati0x Oct 10, 2024
ae99964
:sparkles: Added cron job and API key validation
Corantin Oct 11, 2024
baf8546
:truck: Moved .vercel.json to apps/web for vercel detection
Corantin Oct 11, 2024
30a8a99
:truck: Move to web folder and rename to vercel.json
Corantin Oct 11, 2024
f3b4175
:recycle: Refactored code to support multiple chains
Corantin Oct 11, 2024
c556a98
:lock: Updated API key handling
Corantin Oct 11, 2024
9670645
:alarm_clock: Updated job schedule in vercel.json
Corantin Oct 11, 2024
c1af4f8
feat: add tooltips to community form inputs + add link to "good coven…
Mati0x Oct 11, 2024
795ce5a
Merge branch 'dev' into community-form-upgrade
Mati0x Oct 11, 2024
8cd160d
:recycle: Refactored daily job route for multi-chain support
Corantin Oct 11, 2024
a77169a
Merge from dev
Corantin Oct 11, 2024
6cf6915
Merge branch 'dev' into community-form-upgrade
Corantin Oct 14, 2024
f824f4b
Merge branch 'dev' into Touchups
Corantin Oct 14, 2024
4ec4f2a
:rotating_light: Fix unresolved merge conflict
Corantin Oct 14, 2024
dc03642
:rotating_light: Fix unresolved merge conflict
Corantin Oct 14, 2024
60f33de
Merge branch 'dev' into community-form-upgrade
Corantin Oct 14, 2024
1c8f630
Merge branch 'dev' into Touchups
Corantin Oct 14, 2024
a245b8e
Merge branch 'community-form-upgrade' of https://github.com/1Hive/gar…
Mati0x Oct 14, 2024
5c13428
upgrade link and checkbox text in `CommunityForm`
Mati0x Oct 14, 2024
af52e34
Merge branch 'Touchups' of https://github.com/1Hive/gardens-v2 into T…
Mati0x Oct 14, 2024
b410bcd
upgrade descriptions for `PoolGovernance` and `IncreasePower` components
Mati0x Oct 14, 2024
6b98db6
:recycle: Refactored code for multi-chain support and improved UI
Corantin Oct 14, 2024
906f077
Build contracts
Corantin Oct 14, 2024
baea356
:recycle: Refactored code to improve passport scoring system
Corantin Oct 14, 2024
d6971e5
:rotating_light: Fix compile
Corantin Oct 14, 2024
b3e58da
:recycle: Updated PoolGovernance component
Corantin Oct 14, 2024
c707f61
:rotating_light: Fix compile
Corantin Oct 14, 2024
420f7cc
:recycle: Refactored error messages and improved code readability
Corantin Oct 15, 2024
eaea92f
:recycle: Refactored code for better readability and efficiency
Corantin Oct 15, 2024
eaf327d
Merge pull request #410 from 1Hive/ui-allowlist
Corantin Oct 15, 2024
459eec5
Merge pull request #452 from 1Hive/Touchups
Corantin Oct 15, 2024
5c72b1a
Merge branch 'dev' into community-form-upgrade
Corantin Oct 15, 2024
33271ef
Merge from dev
Corantin Oct 15, 2024
346614a
Merge pull request #465 from 1Hive/community-form-upgrade
Corantin Oct 15, 2024
73a8754
Merge remote-tracking branch 'origin/dev' into allowlist-feature
Corantin Oct 15, 2024
e88de83
Merge branch 'allowlist-feature' into HEAD
Corantin Oct 15, 2024
5024ee7
:zap: Update contract addresses and upgrade logic
Corantin Oct 15, 2024
9cd5794
Merge pull request #439 from 1Hive/allowlist-feature
Corantin Oct 15, 2024
a58c9b1
:recycle: Refactored DisputeButton and PoolForm components
Corantin Oct 15, 2024
eb9bbde
:sparkles: Enhanced Passport Check and UI improvements
Corantin Oct 15, 2024
95dc1e2
:sparkles: Updated various components and configurations
Corantin Oct 15, 2024
6ec3f89
Builds json
Corantin Oct 15, 2024
026b9d3
:art: Updated styles and labels
Corantin Oct 15, 2024
8b838f9
:recycle: Refactored GardenCard and TokenLabel components
Corantin Oct 15, 2024
7840c01
:recycle: Reordered elements in GardenCard
Corantin Oct 15, 2024
884c48a
Merge branch 'dev' of https://github.com/1Hive/gardens-v2 into dev
Mati0x Oct 15, 2024
5da7ba5
:art: Improved UI styling and code cleanup
Corantin Oct 16, 2024
340e137
:sparkles: Enhanced UI and functionality for community pools
Corantin Oct 16, 2024
530f240
:art: Improved UI and UX across multiple components
Corantin Oct 16, 2024
425c95e
Merge branch 'dev' of https://github.com/1Hive/gardens-v2 into dev
Mati0x Oct 16, 2024
4ad967c
rollback Button tooltip state to "false"
Mati0x Oct 16, 2024
321e6c0
upgrade pool form voting protection input
Mati0x Oct 16, 2024
8f1b441
:art: :recycle: Improved UI components and added new features
Corantin Oct 16, 2024
9da90cd
Merge remote-tracking branch 'origin/dev' into dev
Corantin Oct 16, 2024
b70c095
:recycle: Set default tooltip visibility to true
Corantin Oct 16, 2024
66a1e8b
:art: Improved UI components
Corantin Oct 16, 2024
83b131b
:gear: Update AI code review workflow
Corantin Oct 17, 2024
dbdfab8
Merge branch 'main' into dev
Corantin Oct 17, 2024
4c9882d
:bug: Fixed condition for thumbs down reaction
Corantin Oct 17, 2024
5417d7c
:lock: Added GitHub token to environment variables
Corantin Oct 17, 2024
5f43cae
:recycle: Reordered workflow steps
Corantin Oct 17, 2024
1c4123d
:bug: Enhanced error reporting in AI code review
Corantin Oct 17, 2024
546770c
:gear: Update AI code review workflow
Corantin Oct 17, 2024
3c87f37
:repeat: Retry logic added to GitHub workflow
Corantin Oct 17, 2024
448e00e
:recycle: Simplified error logging in AI code review
Corantin Oct 17, 2024
603f679
:bug: Updated error message and run URL in AI code review workflow
Corantin Oct 17, 2024
4d9edf1
:bug: Updated error message formatting in AI code review
Corantin Oct 17, 2024
80e39a1
:bug: Fixed incorrect runUrl in GitHub workflow
Corantin Oct 17, 2024
7ecf244
:bug: Fixed incorrect variable reference in GitHub workflow
Corantin Oct 17, 2024
92ab447
:gear: Update AI code review workflow
Corantin Oct 17, 2024
b6cf770
:recycle: Refactored job ID retrieval in workflow
Corantin Oct 17, 2024
5994790
:gear: Update GitHub Actions workflow
Corantin Oct 17, 2024
204e1e6
:recycle: Refactored job ID to URI in workflow
Corantin Oct 17, 2024
567562a
Merge branch 'main' into dev
Corantin Oct 17, 2024
c9141ea
:arrow_up: Bump production version
Corantin Oct 17, 2024
de83129
Initial commit for registry and CV logic changes
kafann Oct 17, 2024
43200e6
Fixed tests, new to add tests for setCommunityParams func
kafann Oct 17, 2024
908bea2
:recycle: Refactored subgraph URL generation
Corantin Oct 18, 2024
c825532
Merge branch 'dev' into plug-subgraph-protocol
Corantin Oct 18, 2024
ca21da0
:recycle: Lint fix: Cleaned up code
Corantin Oct 18, 2024
5880de8
:recycle: Updated subgraph URL retrieval method
Corantin Oct 18, 2024
78dad7c
Merge remote-tracking branch 'origin/plug-subgraph-protocol' into plu…
Corantin Oct 18, 2024
5f38b90
:sparkles: Fix Dispute modal doesnt show wallet balance
Corantin Oct 18, 2024
367580e
Merge pull request #223 from 1Hive/dev
Corantin Oct 18, 2024
3b3664f
:art: Refactor button and dispute components
Corantin Oct 18, 2024
8c2534b
Merge branch 'main' into dev
Corantin Oct 18, 2024
0e101cd
:recycle: Improved address display and button conditions
Corantin Oct 18, 2024
11ce525
Merge remote-tracking branch 'origin/dev' into dev
Corantin Oct 18, 2024
d54da4a
:recycle: Refactored dispute button and pool form components
Corantin Oct 18, 2024
2c2f138
:art: Adjusted CSS classes in garden pages
Corantin Oct 18, 2024
40154d5
:sparkles: Enhanced TooltipIfOverflow component
Corantin Oct 18, 2024
aa1f63d
:ambulance: Fix contract emptied the allowlist when setPoolParams cal…
Corantin Oct 19, 2024
d776819
:ambulance: Fix member stake not reset in pool when deactivating
Corantin Oct 20, 2024
fbd8775
:art: Improved UI responsiveness
Corantin Oct 20, 2024
77bb5b2
:bug: :ambulance: Remove bypass to trigger auto-repair
Corantin Oct 20, 2024
e1da13d
:art: Enhanced Ethereum address display
Corantin Oct 20, 2024
15f3145
:recycle: Removed unused imports and debug logs
Corantin Oct 20, 2024
85b45d9
Merge branch 'dev' into plug-subgraph-protocol
Corantin Oct 20, 2024
54b3ca0
Merge pull request #470 from 1Hive/plug-subgraph-protocol
Corantin Oct 20, 2024
15d5709
order garden cards by communities length from most to least
Mati0x Oct 21, 2024
81ccf81
Create LICENSE
pglavin2 Oct 22, 2024
be15239
order garden card by communities length from most to least
Mati0x Oct 22, 2024
a8cb885
fix membership stake amount decimals
Lucianosc Oct 23, 2024
edf496e
fix fund pool check balance
Lucianosc Oct 23, 2024
2b1839e
foundry minor fix
Lucianosc Oct 23, 2024
bad46fc
Merge pull request #474 from 1Hive/fix/membership-stake-amount-decimals
Corantin Oct 23, 2024
e4517eb
Merge branch 'dev' into current-fixes
Mati0x Oct 23, 2024
f14dff5
Merge pull request #473 from 1Hive/current-fixes
Mati0x Oct 23, 2024
6093679
Fix subgraphs with 0.1.4
Corantin Oct 23, 2024
8a506c4
Fix create-pool not loading
Corantin Oct 23, 2024
859a39a
Removed console.log
Corantin Oct 23, 2024
587329e
:fire: Fix Passport Scorer
Corantin Oct 23, 2024
23b63ce
Merge remote-tracking branch 'origin/dev' into fix/fund-pool-check-ba…
Lucianosc Oct 24, 2024
69c7003
fix html tags
Lucianosc Oct 24, 2024
e90154c
fix funding amount not updating
Lucianosc Oct 24, 2024
d51496b
Added test and logic for setPendingCouncilSafe
kafann Oct 25, 2024
7ee45fe
Merge branch 'dev' into fix/fund-pool-check-balance
Mati0x Oct 27, 2024
b44f0be
add sharp suggested next img optimizer
Lucianosc Oct 28, 2024
b147772
Merge pull request #476 from 1Hive/fix/fund-pool-check-balance
Mati0x Oct 28, 2024
19b7dac
add display threshold required to pass
Lucianosc Oct 30, 2024
2658458
Merge remote-tracking branch 'origin/dev' into proposalForm/display-t…
Lucianosc Oct 30, 2024
459a030
add validate input when user changes focus
Lucianosc Oct 31, 2024
a8394a1
Create funding.json
pglavin2 Nov 1, 2024
288865c
Merge pull request #488 from 1Hive/pglavin2-patch-1
pglavin2 Nov 1, 2024
edd3745
Update funding.json
pglavin2 Nov 1, 2024
0d500b9
Auto stash before merge of "dev" and "origin/dev"
Corantin Nov 1, 2024
b036e68
Merge branch 'dev' into open-creation
Corantin Nov 1, 2024
862400a
Merge branch 'dev' into open-creation
Corantin Nov 1, 2024
c69d5dd
Fix contracts with coucilsafe transfer, Adapt UI with new contract, l…
Corantin Nov 2, 2024
1923471
Add isMember check + index handleCommunityFeeUpdated
Corantin Nov 2, 2024
c6a6353
add onBlur input validation
Lucianosc Nov 4, 2024
0090bc2
fix eth addr validation
Lucianosc Nov 4, 2024
14e3159
rename allocate button into "Submit allocation"
Mati0x Nov 5, 2024
2171e2f
Fix min threshold
Corantin Nov 6, 2024
1ff03b3
Fix calculateThreshold cannot divide by zero + subgraph missing Fee…
Corantin Nov 7, 2024
b1ccbf1
Run latest
Corantin Nov 7, 2024
d2cca78
feat: Commit: rename allocation button and update proposal page chart
Mati0x Nov 7, 2024
7074e4d
fix: remove minimum conviction from pool edit settings + remove defau…
Mati0x Nov 7, 2024
f7da6ed
Adjust `PoolCard` height based on content and rename "id" into "pool …
Mati0x Nov 7, 2024
92d87bb
Covenant signature pushed to onchain events
Corantin Nov 8, 2024
2916c23
New subgraph for covenant
Corantin Nov 8, 2024
d689b9f
Cherry pick covenant sig
Corantin Nov 8, 2024
5db4ef8
Cleanup sub mapping registry
Corantin Nov 8, 2024
bbab264
Subgraph fix community covenant sig
Corantin Nov 8, 2024
1973b3c
Subgraph fix community covenant sig
Corantin Nov 8, 2024
d280313
Subgraph fix community covenant sig
Corantin Nov 8, 2024
87425a6
Subgraph fix community covenant sig
Corantin Nov 8, 2024
5da99d0
Merge remote-tracking branch 'origin/dev' into dev
Corantin Nov 8, 2024
a023d0c
Fix registry member added
Corantin Nov 8, 2024
00aa527
Fix registry member added
Corantin Nov 8, 2024
d591413
Fixed allocate points
Corantin Nov 9, 2024
d0e95d2
Make passport and arbitrator proxy upgreadable
Corantin Nov 9, 2024
fafbdf2
Merge branch 'dev' into open-creation
Corantin Nov 9, 2024
47a7deb
Fix build
Corantin Nov 9, 2024
09208bc
Merge pull request #489 from 1Hive/open-creation
Corantin Nov 9, 2024
e5c3f73
Merge branch 'main' into dev
Corantin Nov 9, 2024
456175c
Error fallback
Corantin Nov 10, 2024
16a4047
Merge remote-tracking branch 'origin/dev' into dev
Corantin Nov 10, 2024
167f76f
New deploy + subgraph 0.2.0
Corantin Nov 10, 2024
f6f0ab3
Fix register skipping token expenditure
Corantin Nov 10, 2024
75e6b30
Fix Fund pool buggy allowance
Corantin Nov 10, 2024
5b0e9ed
Fix pool metric null ref
Corantin Nov 10, 2024
36b08b6
Fix subgraph build client
Corantin Nov 11, 2024
0c23363
Merge remote-tracking branch 'origin/dev' into fixing-beta-v2
Mati0x Nov 11, 2024
dd7223c
fix: upgarde `ProposalCard` + small tweks
Mati0x Nov 11, 2024
af1d6a3
Merge remote-tracking branch 'origin/dev' into proposalForm/display-t…
Mati0x Nov 11, 2024
3a68083
upgrade description
Mati0x Nov 11, 2024
f5a7fa2
fix lint
Mati0x Nov 11, 2024
9671abc
Fix lint
Corantin Nov 11, 2024
72bf3c3
Merge remote-tracking branch 'origin/dev' into fixing-beta-v2
kafann Nov 11, 2024
52873f9
Fix build contracts
Corantin Nov 11, 2024
92d2d8d
Merge remote-tracking branch 'origin/dev' into fixing-beta-v2
kafann Nov 11, 2024
34d5c5b
Merge branch 'dev' into proposalForm/display-threshold
Mati0x Nov 12, 2024
814d4ee
Merge pull request #478 from 1Hive/proposalForm/display-threshold
Mati0x Nov 12, 2024
8d846de
minor fix for very long proposal names - `ProposalCard`
Mati0x Nov 12, 2024
6f4b40f
enhance manage support overview section
Mati0x Nov 13, 2024
68c28bd
Fixed wrong token + Access proposal support from proposal Details page
kafann Nov 14, 2024
6459232
enhance manage support button in proposalId page
Mati0x Nov 14, 2024
b0eed41
Upgrade contracts artefacts
Corantin Nov 15, 2024
4f8d959
Merge branch 'dev' into fixing-beta-v2
Corantin Nov 15, 2024
18d1de4
Finished token fix in pools, and finish adding manage support access …
kafann Nov 15, 2024
138492d
Fix linter
Corantin Nov 15, 2024
00c31d4
Merge branch 'dev' into upgrade-support-overview
Corantin Nov 15, 2024
522a606
Merge branch 'dev' into fixing-beta-v2
Corantin Nov 15, 2024
de17778
fix text
Mati0x Nov 15, 2024
164a26b
Merge pull request #493 from 1Hive/upgrade-support-overview
Corantin Nov 15, 2024
f4e2c78
Merge branch 'dev' into fixing-beta-v2
Corantin Nov 15, 2024
27cb081
Fix Allocations problems
Corantin Nov 16, 2024
1dda65a
Add support for view function CalculateProposalConviction
Corantin Nov 17, 2024
b454a1c
minor layout fix
Mati0x Nov 18, 2024
2279125
Merge branch 'dev' into fixing-beta-v2
Mati0x Nov 18, 2024
1f31225
Merge pull request #491 from 1Hive/fixing-beta-v2
Mati0x Nov 18, 2024
3f1d709
Cleanup
Corantin Nov 20, 2024
2ca52af
fix stake in community in `Pool Governance`
Mati0x Nov 21, 2024
1547ddd
feat: add Pool staked cap amount in capped pool types
Mati0x Nov 21, 2024
ac1f627
feat: add warning infoBox component in `PoolHeader` when min Threshol…
Mati0x Nov 21, 2024
cfec7a9
Last upgrade
Corantin Nov 22, 2024
5c4982d
minor `Pool Header` upgrade
Mati0x Nov 23, 2024
7394d01
New subgraph with passport fix
Corantin Nov 23, 2024
d1e4bd5
feat: disable Dispute Modal button and Manage Support Button in Propo…
Mati0x Nov 24, 2024
664f782
New deploy
Corantin Nov 24, 2024
eeb8ad2
New deploy
Corantin Nov 26, 2024
09c7c91
Subgraph 0.2.4
Corantin Nov 26, 2024
dab5216
Merge branch 'dev' into fixing-dev
Mati0x Nov 26, 2024
59100ec
Merge branch 'fixing-dev' into dev
Mati0x Nov 26, 2024
c10c742
fix label naming
Mati0x Nov 26, 2024
1735112
fix `ProposalForm`: now showing max amount requested and threshold ne…
Mati0x Nov 27, 2024
2a59f4d
Update apps/web/components/Forms/ProposalForm.tsx
Mati0x Nov 27, 2024
b88ec3a
Fix staked token undefined when no stakes
Corantin Nov 27, 2024
fbbb192
Merge remote-tracking branch 'origin/dev' into dev
Corantin Nov 27, 2024
2aad96b
Merge pull request #498 from 1Hive/fixing-dev-2
Corantin Nov 27, 2024
1ea0888
Fix stkedToken of undefined
Corantin Nov 27, 2024
382e5a6
Merge remote-tracking branch 'origin/dev' into dev
Corantin Nov 27, 2024
4764c01
New deploy with fix for arbitrum
Corantin Nov 27, 2024
7331856
Merge branch 'dev' into diamond-cv-strategy
Corantin Dec 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
131 changes: 104 additions & 27 deletions .github/workflows/ai-code-review.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,126 @@
name: "Code Review by Gemini AI"
on:
pull_request:
paths:
- "**/*.ts"
- "**/*.tsx"
- "**/*.sol"
issue_comment:
types:
- created
- updated

jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: read
steps:
- uses: actions/checkout@v3
- name: "Get filtered diff of the pull request"
id: get_diff
shell: bash

- name: Only PR comments
if: ${{ !github.event.issue.pull_request || !contains(github.event.comment.body,'!ai') }}
run: exit 1

- name: Put a reaction to the comment
run: gh api graphql --silent --raw-field query="mutation AddReaction {addReaction(input:{subjectId:\"$NODE_ID\",content:EYES}){reaction{content}subject{id}}}"
env:
PULL_REQUEST_HEAD_REF: "${{ github.event.pull_request.head.ref }}"
PULL_REQUEST_BASE_REF: "${{ github.event.pull_request.base.ref }}"
run: |-
git fetch origin "${{ env.PULL_REQUEST_HEAD_REF }}" # fetch the branch with changes
git fetch origin "${{ env.PULL_REQUEST_BASE_REF }}" # fetch the target branch
git checkout "${{ env.PULL_REQUEST_HEAD_REF }}" # switch to the branch with changes
git diff -- '*.ts' '*.tsx' '*.sol' "origin/${{ env.PULL_REQUEST_BASE_REF }}" > "filtered_diff.txt" # generate a filtered diff
{
echo "pull_request_diff<<EOF";
cat "filtered_diff.txt";
echo 'EOF';
} >> $GITHUB_OUTPUT # save the filtered diff to an output variable
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_ID: ${{ github.event.comment.node_id }}

- name: Fetch filtered PR diff (only .ts, .tsx, .sol files)
id: pr-diff
uses: actions/github-script@v6
with:
script: |
const pr_number = context.payload.issue.number;
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr_number
});
const { data: diff } = await github.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
headers: {
accept: 'application/vnd.github.v3.diff'
},
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr_number
});

// Initialize variables to store filtered diff and a flag for capturing lines
let filteredDiff = '';
let capture = false;

// Iterate over each line in the diff
diff.split('\n').forEach(line => {
// Check if the line is a diff line for the relevant file types
if (line.startsWith('diff --git')) {
capture = line.endsWith('.ts') || line.endsWith('.tsx') || line.endsWith('.sol');
}
// If capturing, append the current line to the filtered diff
if (capture) {
filteredDiff += line + '\n';
}
});

// Get the head commit SHA
const headSha = pr.data.head.sha;

// Set outputs for the filtered diff and head SHA
core.setOutput("diff", filteredDiff);
core.setOutput("headSha", headSha);

- name: Log filtered diff to file
id: log-diff
continue-on-error: true
run: |
echo "${{ steps.pr-diff.outputs.diff }}"

- uses: rubensflinco/[email protected]
name: "Code Review by Gemini AI"
continue-on-error: true
id: review
continue-on-error: true
with:
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repository: ${{ github.repository }}
github_pull_request_number: ${{ github.event.pull_request.number }}
git_commit_hash: ${{ github.event.pull_request.head.sha }}
github_pull_request_number: ${{ github.event.issue.number }}
git_commit_hash: ${{ steps.pr-diff.outputs.headSha }}
model: "gemini-1.5-pro-latest"
pull_request_diff: |-
${{ steps.get_diff.outputs.pull_request_diff }}
pull_request_chunk_size: "5000" # chunk size is important to avoid exceeding the API limits
${{ steps.pr-diff.outputs.diff }}
pull_request_chunk_size: "5000"
extra_prompt: |-
Only focus on logic and security-sensitive sections of the code.
Skip reviewing helper functions, comments, or tests.
Make a pull request review in regards of the added and removed code.
Start with a summary of the changes and then list detail the review and suggestions.
Focus on code quality, security, performance, best practices and potential mistakes.
Never ask to provide more code and only review the code you received even if its partial.
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: 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 }}

- 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: 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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ cache/
pkg/subgraph/generated
pkg/**/data
cookies.json
.graphclientrc.yml

lcov.info
# some abi should be ignored
Expand Down
Loading
Loading