Skip to content

Conversation

@YashodhanJoshi1
Copy link
Contributor

@YashodhanJoshi1 YashodhanJoshi1 commented Nov 28, 2025

See working run here https://github.com/openobserve/openobserve/actions/runs/19761555623/job/56624451400

Also check the timeline items that mention gh actions bot added the label and milestone to it.

This adds a CI which will automatically label every PR on approve and add it to the lowest open milestone (ignoring backlog)
So if current open milestones are backlog, v0.20.0, v0.20.1 , it will auto add this on approval to v0.20.0 and add Needs-Testing label.

Signed-off-by: Yashodhan Joshi <[email protected]>
Signed-off-by: Yashodhan Joshi <[email protected]>
@github-actions
Copy link
Contributor

Failed to generate code suggestions for PR

@github-actions github-actions bot added the Needs-Testing Needs-Testing label Nov 28, 2025
@github-actions github-actions bot added this to the v0.20.0 milestone Nov 28, 2025
Signed-off-by: Yashodhan Joshi <[email protected]>
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 28, 2025

Greptile Overview

Greptile Summary

Adds GitHub Actions workflow to automatically label approved PRs and assign them to the next milestone based on version numbers.

  • Critical: The workflow will never execute because the trigger is pull_request but the condition checks github.event.review.state, which only exists in pull_request_review events
  • Critical: The JavaScript regex doesn't properly escape dots, allowing invalid version strings to match
  • Critical: Missing null checks when parsing milestone titles will cause crashes if titles don't match expected format
  • Critical: The reduce function will crash if all milestones are filtered out (e.g., only "Backlog" exists)
  • Minor typo in comment ("bbe" instead of "be")

Confidence Score: 0/5

  • This PR has critical bugs that prevent it from working at all
  • Score reflects that the workflow will never run due to trigger/condition mismatch, and the JavaScript has multiple crash-causing bugs including unescaped regex, missing null checks, and no empty array handling
  • Both files require immediate attention - the workflow file has a critical trigger configuration issue, and the JavaScript file has multiple runtime error vulnerabilities

Important Files Changed

File Analysis

Filename Score Overview
.github/get_next_milestone.js 1/5 Adds script to find lowest version milestone - has regex bug, missing null checks, and empty array handling issue
.github/workflows/label_milestone.yml 0/5 Adds workflow to auto-label PRs - will never run due to trigger/condition mismatch

Sequence Diagram

sequenceDiagram
    participant PR as Pull Request
    participant GHA as GitHub Actions
    participant Script as get_next_milestone.js
    participant API as GitHub API
    participant GH as gh CLI

    PR->>GHA: pull_request_review event (approved)
    GHA->>GHA: Check if review.state == 'approved'
    GHA->>GH: gh pr edit --add-label "Needs-Testing"
    GH->>PR: Label added
    GHA->>Script: node get_next_milestone.js
    Script->>API: GET /repos/openobserve/openobserve/milestones
    API-->>Script: Return milestones JSON
    Script->>Script: Filter out "Backlog"
    Script->>Script: Parse version numbers from titles
    Script->>Script: Compare versions to find lowest
    Script-->>GHA: Output milestone title
    GHA->>GH: gh pr edit -m "$MILESTONE"
    GH->>PR: Milestone assigned
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 5 comments

Edit Code Review Agent Settings | Greptile

@YashodhanJoshi1 YashodhanJoshi1 changed the title ci: initial setup ci: auto label and milestone Nov 28, 2025
Signed-off-by: Yashodhan Joshi <[email protected]>
@YashodhanJoshi1 YashodhanJoshi1 removed this from the v0.20.0 milestone Nov 28, 2025
Signed-off-by: Yashodhan Joshi <[email protected]>
@YashodhanJoshi1 YashodhanJoshi1 merged commit e45b770 into main Dec 2, 2025
40 of 41 checks passed
@YashodhanJoshi1 YashodhanJoshi1 deleted the ci/auto_label_ms branch December 2, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs-Testing Needs-Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants