Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 12 additions & 9 deletions .github/scripts/coderabbit_plan_trigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ async function triggerCodeRabbitPlan(github, owner, repo, issue, marker) {
}
}

function hasIntermediateOrAdvancedLabel(issue, label) {
// Check if issue has intermediate or advanced label (case-insensitive)
const hasIntermediateLabel = issue.labels?.some(l => l?.name?.toLowerCase() === 'intermediate');
const hasAdvancedLabel = issue.labels?.some(l => l?.name?.toLowerCase() === 'advanced');

function hasBeginnerOrHigherLabel(issue, label) {
// Check if issue has beginner, intermediate or advanced label (case-insensitive)

const allowed = ['beginner', 'intermediate', "advanced"];

const hasAllowedLabel = issue.labels?.some(l => allowed.includes(l?.name?.toLowerCase()));

// Also check if newly added label is intermediate/advanced
const isNewLabelIntermediate = label?.name?.toLowerCase() === 'intermediate';
const isNewLabelAdvanced = label?.name?.toLowerCase() === 'advanced';

const isNewLabelAllowed = allowed.includes(label?.name?.toLowerCase());

return hasAllowedLabel || isNewLabelAllowed;

return hasIntermediateLabel || hasAdvancedLabel || isNewLabelIntermediate || isNewLabelAdvanced;
}

async function hasExistingCodeRabbitPlan(github, owner, repo, issueNumber) {
Expand Down Expand Up @@ -65,7 +68,7 @@ module.exports = async ({ github, context }) => {
// Validations
if (!issue?.number) return console.log('No issue in payload');

if (!hasIntermediateOrAdvancedLabel(issue, label)) {
if (!hasBeginnerOrHigherLabel(issue, label)) {
return console.log('Issue does not have intermediate or advanced label');
}

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/bot-coderabbit-plan-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ jobs:
concurrency:
group: coderabbit-plan-${{ github.event.issue.number }}
cancel-in-progress: false
# Only run for issues labeled with 'intermediate' or 'advanced' (case-insensitive)
# Only run for issues labeled with 'beginner', 'intermediate' or 'advanced' (case-insensitive)
if: >
(github.event_name == 'issues' && (
contains(github.event.issue.labels.*.name, 'intermediate') ||
contains(github.event.issue.labels.*.name, 'beginner') ||
contains(github.event.issue.labels.*.name, 'advanced') ||
contains(github.event.issue.labels.*.name, 'Intermediate') ||
contains(github.event.issue.labels.*.name, 'Beginner') ||
contains(github.event.issue.labels.*.name, 'Advanced') ||
(github.event.label && (github.event.label.name == 'intermediate' || github.event.label.name == 'advanced' || github.event.label.name == 'Intermediate' || github.event.label.name == 'Advanced'))
(github.event.label && (github.event.label.name == 'intermediate' || github.event.label.name == 'advanced' || github.event.label.name == 'Intermediate' || github.event.label.name == 'Advanced' || github.event.label.name == 'beginner'|| github.event.label.name == 'Beginner'))
))

steps:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- Add CodeRabbit documentation review prompts for docs, sdk_users, and sdk_developers with priorities, philosophy, and edge case checks. ([#1236](https://github.com/hiero-ledger/hiero-sdk-python/issues/1236))
- Enhance NodeAddress tests with additional coverage for proto conversion `tests/unit/node_address_test.py`
- Updated `pyproject.toml` to enforce stricter Ruff linting rules, including Google-style docstrings (`D`), import sorting (`I`), and modern Python syntax (`UP`).
- Modified and renamed hasIntermediateOrAdvancedLabel() to check if issue label is beginner or higher (#1385)

### Fixed
- GFI workflow casing
Expand Down