Skip to content
Closed
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
bf195ce
Add CodeRabbit release gate workflow
MonaaEid Feb 11, 2026
f1dba68
Add release PR review comment script
MonaaEid Feb 11, 2026
b165f63
Create release-pr-prompt.md
MonaaEid Feb 11, 2026
3bc8082
Enhance error handling in release PR coderabbit gate
MonaaEid Feb 11, 2026
f9f3341
Update base reference check for release tags
MonaaEid Feb 11, 2026
16d0271
Refactor release PR script for improved clarity
MonaaEid Feb 17, 2026
6a9bd62
Update .coderabbit.yaml
MonaaEid Feb 18, 2026
1c91a34
Remove chunks parameter from TopicMessage initialization
MonaaEid Feb 18, 2026
d5bd856
Add custom rule directory to coderabbit configuration
MonaaEid Feb 18, 2026
61447c2
Remove message_data from TopicMessage constructor
MonaaEid Feb 18, 2026
65db8bc
Update .coderabbit.yaml configuration
MonaaEid Feb 18, 2026
96aa9cb
Update constructor to include message_data parameter
MonaaEid Feb 18, 2026
b1050dc
Fix indentation for knowledge_base in .coderabbit.yaml
MonaaEid Feb 18, 2026
e2aad1f
Refactor TopicMessage to use string for transaction_id
MonaaEid Feb 18, 2026
412baea
Update .coderabbit.yaml configuration
MonaaEid Feb 18, 2026
85d5006
Update web_search configuration and review link
MonaaEid Feb 18, 2026
e3f71f8
Refactor TopicMessageSubmitTransaction for new types
MonaaEid Feb 18, 2026
eea18b4
Merge branch 'main' into test-protobuf-packagTWO
MonaaEid Feb 18, 2026
8f490d3
Update topic_info.py
MonaaEid Feb 19, 2026
38e48fc
Refactor TopicMessage and TopicMessageChunk classes
MonaaEid Feb 19, 2026
aeba5ef
Refactor TopicMessage and TopicMessageChunk classes
MonaaEid Feb 22, 2026
47fd35e
Modify .coderabbit.yaml for review instructions
MonaaEid Feb 22, 2026
3073702
Remove unnecessary blank line in topic_message.py
MonaaEid Feb 23, 2026
39c8a34
Change transaction_id type from TransactionId to str
MonaaEid Feb 23, 2026
744dee6
Refactor TopicCreateTransaction class
MonaaEid Feb 23, 2026
6ad1973
Enhance Python review instructions for Protobuf alignment
MonaaEid Feb 25, 2026
2718e96
Update src/hiero_sdk_python/consensus/topic_create_transaction.py
MonaaEid Feb 25, 2026
2f0cba9
Enhance TransactionRecord with new attributes and docs
MonaaEid Feb 25, 2026
4432ab9
Add TokenAssociation class for token-account associations
MonaaEid Feb 25, 2026
a39c90d
Update .coderabbit.yaml
MonaaEid Feb 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ reviews:
in_progress_fortune: false # Do not stall time with a message (spammy)
poem: false # Do not write a literal poem (spammy)
enable_prompt_for_ai_agents: false # Disable prompts for AI agents (spammy)
knowledge_base:
web_search:
enabled: true


# TOKEN REVIEW INSTRUCTIONS
token_review_instructions: &token_review_instructions |
Expand Down Expand Up @@ -798,6 +802,12 @@ reviews:

- path: "src/hiero_sdk_python/contract/**/*_query.py"
instructions: *query_review_instructions
#############################################
- path: "src/hiero_sdk_python/consensus/**/*.py"
instructions: |
Review against protobuf schemas at:
https://github.com/hashgraph/hedera-protobufs/blob/main/mirror/consensus_service.proto
Ensure all message fields and types align with the latest definitions

chat:
art: false # Don't draw ASCII art (false)
Expand Down
1 change: 1 addition & 0 deletions .github/coderabbit/release-pr-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hiero-sdk-python/.github/coderabbit/release-pr-prompt.md
133 changes: 133 additions & 0 deletions .github/scripts/release-pr-coderabbit-gate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/**
* Posts a single "@coderabbit review" comment on release PRs, embedding the
* release review prompt. Designed to run with:
* - permissions: contents: read, pull-requests: write
*
* Safety:
* - Only runs for maintainer-authored PRs (MEMBER/OWNER)
* - Dedupe via hidden marker comment
*/

const fs = require("fs");
const path = require("path");

const MARKER = "<!-- coderabbit-release-gate: v1 -->";


function loadPrompt() {
const promptPath = path.join(
process.env.GITHUB_WORKSPACE || ".",
".github/coderabbit/release-pr-prompt.md"
);
try {
const content = fs.readFileSync(promptPath, "utf8").trim();
if (!content) {
throw new Error("Release prompt file is empty");
}
return content;
} catch (error) {
throw new Error(`Failed to load release prompt from ${promptPath}: ${error.message}`);
}
}

async function commentAlreadyExists({ github, owner, repo, issue_number }) {
try {
// Pull a bounded number of recent comments to avoid pagination complexity.
const { data } = await github.rest.issues.listComments({
owner,
repo,
issue_number,
per_page: 100,
});
return data.some((c) => typeof c.body === "string" && c.body.includes(MARKER));
}
catch (error) {
console.error(`Error checking for existing comments: ${error.message}`);
return false; // Fail open: allow posting if check fails
}
}


function buildBody({ prompt, baseRef, headRef, baseLooksLikeTag }) {
// Keep it human-friendly but compact; instructions are collapsible.
const lines = [
"@coderabbitai review",
"",
MARKER,
"",
`This is a **release-gate** review request for diff **${baseRef} → ${headRef}**.`,
"",
];
if (!baseLooksLikeTag) {
lines.push(
"⚠️ Warning: The base ref does not look like a release tag. For a full release diff, set base to the previous tag (e.g., release-v0.1.10).",
""
);
}

lines.push(
"<details>",
"<summary>CodeRabbit release review instructions</summary>",
"",
prompt,
"",
"</details>",
);
return lines.join("\n");

}

module.exports = async ({ github, context }) => {
try {
const owner = context.repo.owner;
const repo = context.repo.repo;
const pr = context.payload.pull_request;

if (!pr) {
console.log("No pull_request payload; exiting.");
return;
}

// Safety: only maintainers
const assoc = pr.author_association;
if (!(assoc === "MEMBER" || assoc === "OWNER")) {
console.log(`author_association=${assoc}; skipping.`);
return;
}

const title = pr.title || "";
if (!title.toLowerCase().startsWith("chore: release v")) {
console.log("Not a release PR title; skipping.");
return;
}

const baseRef = pr.base?.ref || "";
const headRef = pr.head?.ref || "";

// Optional sanity check: base should look like a tag. If it doesn't, still comment but warn.
const baseLooksLikeTag = baseRef.startsWith("release-v") && /\d+\.\d+\.\d+/.test(baseRef);

const issue_number = pr.number;
if (await commentAlreadyExists({ github, owner, repo, issue_number })) {
console.log("Marker comment already exists; not posting again.");
return;
}

const prompt = loadPrompt();

const body = buildBody({ prompt, baseRef, headRef, baseLooksLikeTag });

await github.rest.issues.createComment({
owner,
repo,
issue_number,
body,
});

console.log("Posted CodeRabbit release-gate comment.");
console.log(`PR #${issue_number} (${headRef} → ${baseRef})`);
} catch (error) {
console.error(`Error in release PR coderabbit gate: ${error.message}`);
console.log(`PR #${issue_number || 'unknown'} (${headRef || '?'} → ${baseRef || '?'})`);
}
};
46 changes: 46 additions & 0 deletions .github/workflows/release-pr-coderabbit-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CodeRabbit Release Gate Comment

on:
pull_request:
types: [opened, reopened, synchronize, edited]

permissions:
contents: read
pull-requests: write

concurrency:
group: coderabbit-release-gate-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
coderabbit-release-gate:
runs-on: ubuntu-latest
# Only run for release PRs /title check as initial filter
if: |
github.event.pull_request &&
(startsWith(github.event.pull_request.title, 'chore: release v') ||
startsWith(github.event.pull_request.title, 'release v') ||
startsWith(github.event.pull_request.title, 'Release v'))

steps:
- name: Harden the runner
uses: step-security/harden-runner@e3f713f2d8f53843e71c69a996d56f51aa9adfb9 # v2.14.1
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
with:
sparse-checkout: |
.github/coderabbit/release-pr-prompt.md
.github/scripts/post-coderabbit-release-gate-comment.js
sparse-checkout-cone-mode: false

- name: Post CodeRabbit release-gate prompt comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd #v8.0.0
with:
script: |
const script = require('./.github/scripts/release-pr-coderabbit-gate.js');
await script({ github, context});
Loading
Loading