Skip to content

fix(workflows): resolve yaml syntax error and python script exceptions#4938

Open
subodha-wijesekara wants to merge 1 commit intowso2:mainfrom
subodha-wijesekara:fix/github-actions-bugs
Open

fix(workflows): resolve yaml syntax error and python script exceptions#4938
subodha-wijesekara wants to merge 1 commit intowso2:mainfrom
subodha-wijesekara:fix/github-actions-bugs

Conversation

@subodha-wijesekara
Copy link
Copy Markdown

@subodha-wijesekara subodha-wijesekara commented Apr 11, 2026

This commit fixes two issues in the GitHub Actions workflows:

  • resolution_label_notifier.yml: Added missing closing single quote preventing valid YAML parsing.

  • label_checker.py: Swapped .index() to .find() to avoid ValueError on missing issue template fields and improved robust version extraction.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced robustness of issue label extraction to gracefully handle missing data without creating malformed labels
    • Improved version parsing logic for more reliable label assignment
    • Fixed a syntax error in the resolution notification workflow that was preventing it from executing correctly

This commit fixes two issues in the GitHub Actions workflows:

- resolution_label_notifier.yml: Added missing closing single quote preventing valid YAML parsing.

- label_checker.py: Swapped .index() to .find() to avoid ValueError on missing issue template fields and improved robust version extraction.
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

Walkthrough

Two GitHub Actions workflow files receive corrections to error handling and syntax. The label_checker.py script now safely extracts labels using boundary-aware string finding and conditional logic, while the notifier workflow fixes a malformed syntax error in a label check condition.

Changes

Cohort / File(s) Summary
Label Extraction Error Handling
.github/workflows/label_checker.py
Replaced unsafe index() calls with find() sentinel checks (-1). Component and version extraction now conditional on marker presence. Version parsing uses ### section boundary ranges. Affected/<component>-<version> label creation gated on component validity.
Workflow Syntax Fix
.github/workflows/resolution_label_notifier.yml
Fixed missing closing single quote in contains() condition for Resolution/Done label check, correcting malformed conditional expression.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Quotes were broken, labels lost their way,
Now find with care keeps errors at bay,
Safe boundaries drawn 'round versions true,
Workflow syntax fixed, all shiny and new!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: fixing a YAML syntax error in resolution_label_notifier.yml and Python script exceptions in label_checker.py by using safer string methods and improving robustness.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/label_checker.py:
- Around line 19-20: The extraction of component from os.environ["ISSUE_BODY"]
uses indices i and j but only checks they are not -1, allowing wrong order
(e.g., '### Version' before '### Affected Component') which yields malformed
text; change the condition to require i != -1 and j != -1 and j > i before
performing component = os.environ["ISSUE_BODY"][i+23:j].strip() so the slice
only occurs when the Affected Component header appears before the Version
header.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cd0e78cc-ee31-4bc4-b7de-c3d5dcbf0a37

📥 Commits

Reviewing files that changed from the base of the PR and between c16a70e and 63d7740.

📒 Files selected for processing (2)
  • .github/workflows/label_checker.py
  • .github/workflows/resolution_label_notifier.yml

Comment on lines +19 to +20
if i != -1 and j != -1:
component = os.environ["ISSUE_BODY"][i+23:j].strip()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add an order check before extracting component.

The current condition allows parsing even when ### Version appears before ### Affected Component, which can produce malformed component text. Require j > i before slicing.

Suggested patch
-if i != -1 and j != -1:
+if i != -1 and j != -1 and j > i:
     component = os.environ["ISSUE_BODY"][i+23:j].strip()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if i != -1 and j != -1:
component = os.environ["ISSUE_BODY"][i+23:j].strip()
if i != -1 and j != -1 and j > i:
component = os.environ["ISSUE_BODY"][i+23:j].strip()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/label_checker.py around lines 19 - 20, The extraction of
component from os.environ["ISSUE_BODY"] uses indices i and j but only checks
they are not -1, allowing wrong order (e.g., '### Version' before '### Affected
Component') which yields malformed text; change the condition to require i != -1
and j != -1 and j > i before performing component =
os.environ["ISSUE_BODY"][i+23:j].strip() so the slice only occurs when the
Affected Component header appears before the Version header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants