Skip to content

Commit b396f52

Browse files
committed
Merge branch 'brandon.leblanc/ffi-refactor' into brandon.leblanc/range-proofs
2 parents 4f0eb47 + 29cff9f commit b396f52

File tree

7 files changed

+241
-136
lines changed

7 files changed

+241
-136
lines changed

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.golangci.yaml
2+
.golangci.yaml.orig

.github/.golangci.yaml.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- .github/.golangci.yaml 2025-08-02 10:10:13
2-
+++ ffi/.golangci.yaml 2025-08-02 10:10:13
1+
--- .github/.golangci.yaml 2025-08-22 10:01:30
2+
+++ ffi/.golangci.yaml 2025-08-22 10:01:26
33
@@ -69,8 +69,6 @@
44
rules:
55
packages:
@@ -39,7 +39,7 @@
3939
revive:
4040
rules:
4141
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
42-
@@ -168,17 +147,6 @@
42+
@@ -171,17 +150,6 @@
4343
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
4444
- name: useless-break
4545
disabled: false
@@ -57,7 +57,7 @@
5757
tagalign:
5858
align: true
5959
sort: true
60-
@@ -186,16 +154,16 @@
60+
@@ -189,16 +157,16 @@
6161
- serialize
6262
strict: true
6363
testifylint:
@@ -84,7 +84,7 @@
8484
unused:
8585
# Mark all struct fields that have been written to as used.
8686
# Default: true
87-
@@ -224,7 +192,7 @@
87+
@@ -227,7 +195,7 @@
8888
- standard
8989
- default
9090
- blank

.github/workflows/metrics-check.yaml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66

7+
concurrency:
8+
group: metrics-check-${{ github.event.pull_request.number }}
9+
cancel-in-progress: true
10+
711
jobs:
812
check-metrics-changes:
913
runs-on: ubuntu-latest
@@ -30,7 +34,7 @@ jobs:
3034
fi
3135
3236
# Regex pattern to match metric-related code changes
33-
METRIC_REGEX_PATTERN="(counter!|gauge!|histogram!|#\\[metrics\\])"
37+
METRIC_REGEX_PATTERN="(counter!|gauge!|histogram!|#\\[metrics\\])" # ci trigger
3438
3539
# Check for metric-related changes
3640
METRIC_CHANGES=$(git diff $BASE_COMMIT..HEAD --unified=0 | grep -E "$METRIC_REGEX_PATTERN" || true)
@@ -44,43 +48,39 @@ jobs:
4448
4549
# Set output variables for the comment step
4650
echo "metric_changes_found=$([ -n "$METRIC_CHANGES" ] && echo "true" || echo "false")" >> $GITHUB_OUTPUT
47-
echo "metric_pattern=$METRIC_REGEX_PATTERN" >> $GITHUB_OUTPUT
51+
echo "metric_changes<<EOF" >> $GITHUB_OUTPUT
52+
echo "$METRIC_CHANGES" >> $GITHUB_OUTPUT
53+
echo "EOF" >> $GITHUB_OUTPUT
54+
55+
- name: Look for previous comment
56+
if: github.repository == github.event.pull_request.head.repo.full_name && steps.check-metrics.outputs.metric_changes_found == 'true'
57+
id: find-comment
58+
uses: peter-evans/find-comment@v3
59+
with:
60+
issue-number: ${{ github.event.pull_request.number }}
61+
comment-author: github-actions[bot]
62+
body-includes: "## Metrics Change Detection ⚠️"
4863

4964
- name: Comment on PR (if applicable)
5065
if: github.repository == github.event.pull_request.head.repo.full_name && steps.check-metrics.outputs.metric_changes_found == 'true'
51-
uses: actions/github-script@v7
66+
uses: peter-evans/create-or-update-comment@v4
5267
with:
53-
script: |
54-
const { execSync } = require('child_process');
55-
56-
try {
57-
// Get the base commit for comparison
58-
const baseCommit = context.payload.pull_request.base.sha;
59-
60-
// Get the metric pattern from the previous step
61-
const metricPattern = "${{ steps.check-metrics.outputs.metric_pattern }}";
62-
63-
// Check for metric changes
64-
const metricChanges = execSync(`git diff ${baseCommit}..HEAD --unified=0 | grep -E "${metricPattern}" || true`, { encoding: 'utf8' });
65-
66-
if (metricChanges.trim()) {
67-
const comment = '## Metrics Change Detection ⚠️\n\n' +
68-
'This PR contains changes related to metrics:\n\n' +
69-
'```\n' +
70-
metricChanges +
71-
'\n```\n\n' +
72-
'However, the dashboard was not modified.\n\n' +
73-
'You may need to update `benchmark/Grafana-dashboard.json` accordingly.\n\n' +
74-
'---\n' +
75-
'*This check is automated to help maintain the dashboard.*';
76-
77-
github.rest.issues.createComment({
78-
issue_number: context.issue.number,
79-
owner: context.repo.owner,
80-
repo: context.repo.repo,
81-
body: comment
82-
});
83-
}
84-
} catch (error) {
85-
console.log('No metric changes found or error occurred:', error.message);
86-
}
68+
issue-number: ${{ github.event.pull_request.number }}
69+
body: |
70+
## Metrics Change Detection ⚠️
71+
72+
This PR contains changes related to metrics:
73+
74+
```
75+
${{ steps.check-metrics.outputs.metric_changes }}
76+
```
77+
78+
However, the dashboard was not modified.
79+
80+
You may need to update `benchmark/Grafana-dashboard.json` accordingly.
81+
82+
---
83+
84+
*This check is automated to help maintain the dashboard.*
85+
edit-mode: replace
86+
comment-id: ${{ steps.find-comment.outputs.comment-id }}

ffi/.golangci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ linters:
9898
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines
9999
- name: empty-lines
100100
disabled: false
101+
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#redundant-import-alias
102+
- name: redundant-import-alias
103+
disabled: false
101104
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#string-format
102105
- name: string-format
103106
disabled: false

0 commit comments

Comments
 (0)