Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Oct 7, 2025

Resolves #9417

Summary by CodeRabbit

  • New Features

    • Added a “Search Incidents” action with filters for teams, services, repositories, dates, statuses, and result limits.
    • Exposed dynamic selectable inputs for Teams and Services for easier selection.
  • Refactor

    • Updated Create Incident to use the shared dynamic Teams and Services selectors and bumped its action version.
  • Chores

    • Bumped LinearB package to v0.2.0 and updated platform dependency to ^3.1.0.
    • Incremented source/action versions for related components.

…vices, add search incidents action, and update version to 0.2.0. Bump create incident action version to 0.0.3 and update dependencies.
@luancazarine luancazarine linked an issue Oct 7, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Oct 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Oct 9, 2025 4:36pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 9, 2025 4:36pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 7, 2025

Walkthrough

Adds a new "Search Incidents" action, adds propDefinitions and API helpers (getTeams, getServices, getIncidents) to the LinearB app, refactors Create Incident props to use app propDefinitions and bumps action/package/source versions and platform dependency.

Changes

Cohort / File(s) Summary of Changes
LinearB app enhancements
components/linearb/linearb.app.mjs
Added propDefinitions for teams and services (dynamic options); added getTeams(args = {}), getServices(args = {}), and getIncidents(args = {}) methods; changed getHeaders(headers)getHeaders(headers = {}).
New action: Search Incidents
components/linearb/actions/search-incidents/search-incidents.mjs
New exported action "Search Incidents" with props (app, teams, services, repositoryUrls, issuedAtBefore, issuedAtAfter, startedAt, endedAt, statuses, maxResults); run uses app.paginate with getIncidents to fetch incidents and returns results and a summary.
Create Incident props refactor
components/linearb/actions/create-incident/create-incident.mjs
Bumped version 0.0.20.0.3; replaced explicit string[] props for teams and services with propDefinition: [app, "teams"] / propDefinition: [app, "services"] and marked them optional.
Package metadata
components/linearb/package.json
Package version bumped 0.1.00.2.0; dependency @pipedream/platform updated ^1.6.0^3.1.0.
Source version bump / import order
components/linearb/sources/new-deploy-created/new-deploy-created.mjs
Top-level import order adjusted; source version bumped 0.0.10.0.2.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant UI as Pipedream UI
  participant SA as Search Incidents Action
  participant APP as LinearB App
  participant API as LinearB REST API

  U->>UI: Configure action (filters, maxResults)
  UI->>APP: Request prop options for `teams`/`services`
  APP->>API: GET /teams, GET /services
  API-->>APP: Teams, Services lists
  APP-->>UI: Options (names)

  U->>SA: Trigger with selected filters
  SA->>APP: paginate(getIncidents, payload, limit)
  loop pages until limit
    APP->>API: POST /incidents/search (filters)
    API-->>APP: Incidents page
    APP-->>SA: Page results
  end
  SA-->>U: Return incidents and summary
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A rabbit taps keys at morning's brim,
New searches hop out, tidy and prim.
Teams and services line in neat rows,
Incidents found where the wild data grows.
Versioned paws leave a cheerful skim 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The pull request focuses on adding incident-related actions and methods but does not implement the requested triggers for merge, pickup, pull request, or review events, nor does it include functionality for reporting data to other apps or sending GitHub issues as specified in issue #9417. Ensure the implementation covers all triggers (deploy, merge, pickup, pull request, review) and the specified action requirements for reporting data to other apps and sending issues to GitHub under issue #9417.
Description Check ⚠️ Warning The pull request description only contains a "Resolves #9417" line and does not follow the repository’s description template, which requires a "## WHY" section and any additional context as specified by the template. Please update the description to include the required template sections, especially a filled out "## WHY" block explaining the purpose and rationale of these changes, and any other relevant sections from the template.
Title Check ❓ Inconclusive Title "9417 linearb" uses the issue number and app name but does not describe the substantive changes in the pull request, making it too vague to convey the primary update. Consider renaming the pull request to a concise summary of the main change, such as "Add LinearB incident search action and update create-incident props to use propDefinitions."
✅ Passed checks (2 passed)
Check name Status Explanation
Out of Scope Changes Check ✅ Passed All code changes relate directly to the LinearB integration objectives, such as adding incident actions, propDefinitions, and API methods, and there are no unrelated modifications outside the scope of issue #9417.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 9417-linearb

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
Contributor

@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: 0

🧹 Nitpick comments (1)
components/linearb/actions/create-incident/create-incident.mjs (1)

68-73: Document case sensitivity requirements for consistency.

The search-incidents action notes "Lowercase only" for repository URLs (and teams/services in the app propDefinitions), but this action lacks similar guidance. Consider adding a note to the repositoryUrls description to clarify case requirements and ensure consistency across actions.

 repositoryUrls: {
   type: "string[]",
   label: "Repository URLs",
-  description: "The list of repos urls related to this incident. Eg. `https://github.com/myorg/repo1.git`",
+  description: "The list of repos urls related to this incident. **Lowercase only**. Eg. `https://github.com/myorg/repo1.git`",
   optional: true,
 },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c1a754 and ed64584.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • components/linearb/actions/create-incident/create-incident.mjs (2 hunks)
  • components/linearb/actions/search-incidents/search-incidents.mjs (1 hunks)
  • components/linearb/linearb.app.mjs (2 hunks)
  • components/linearb/package.json (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/linearb/actions/search-incidents/search-incidents.mjs (2)
components/linearb/actions/create-incident/create-incident.mjs (1)
  • response (98-112)
components/linearb/linearb.app.mjs (1)
  • response (98-105)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
🔇 Additional comments (8)
components/linearb/package.json (1)

3-3: LGTM! Version bumps are appropriate.

The package version increment to 0.2.0 correctly reflects the addition of new features (search action and propDefinitions), and the platform dependency update to ^3.1.0 aligns with the enhanced functionality in this PR.

Also applies to: 16-16

components/linearb/actions/create-incident/create-incident.mjs (1)

7-7: LGTM! PropDefinition refactoring improves maintainability.

The version bump and transition to propDefinition wiring for teams and services centralizes prop definitions in the app module, following DRY principles and ensuring consistency across actions.

Also applies to: 54-67

components/linearb/actions/search-incidents/search-incidents.mjs (3)

101-103: LGTM! Summary generation is correct.

The pluralization logic correctly handles singular and plural forms based on the result count.


36-59: Verify expected date format for search-incidents filters.
We couldn’t locate documentation on whether the search-incidents action accepts ISO 8601 timestamps or plain YYYY-MM-DD. Confirm the API’s expected date format for these filters and align the create-incident and search-incidents actions accordingly.


79-99: Issued_at payload structure is correct

The LinearB incidents search endpoint accepts issued_at as a nested object with before/after keys, so no change is needed.

components/linearb/linearb.app.mjs (3)

42-47: LGTM! Default parameter improves robustness.

Adding a default empty object for the headers parameter prevents potential undefined errors and makes the method more resilient.


70-89: LGTM! New API methods are well-structured.

The new methods getTeams, getServices, and getIncidents are correctly implemented:

  • getTeams appropriately uses the V2 API endpoint
  • getIncidents correctly uses POST for the search operation
  • All methods follow the existing pattern and properly spread additional arguments

8-37: Ignore pagination mismatch warning. The getTeams and getServices methods accept params.page via their args spread, so passing page is correct.

Likely an incorrect or invalid review comment.

Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

Moving to QA as this is description-only comment

@luancazarine
Copy link
Collaborator Author

/approve

Copy link
Contributor

@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

🧹 Nitpick comments (1)
components/linearb/actions/search-incidents/search-incidents.mjs (1)

86-89: Consider conditionally including the issued_at filter.

If both issuedAtBefore and issuedAtAfter are undefined, the API receives an issued_at object with undefined properties. This may cause unexpected behavior if the API doesn't handle undefined values gracefully.

Consider refactoring to only include the issued_at field when at least one value is provided:

         data: {
-          issued_at: {
-            before: this.issuedAtBefore,
-            after: this.issuedAtAfter,
-          },
+          ...(this.issuedAtBefore || this.issuedAtAfter
+            ? {
+                issued_at: {
+                  ...(this.issuedAtBefore && { before: this.issuedAtBefore }),
+                  ...(this.issuedAtAfter && { after: this.issuedAtAfter }),
+                },
+              }
+            : {}),
           started_at: this.startedAt,
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6861b50 and e39cb85.

📒 Files selected for processing (1)
  • components/linearb/actions/search-incidents/search-incidents.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/linearb/actions/search-incidents/search-incidents.mjs (2)
components/linearb/actions/create-incident/create-incident.mjs (1)
  • response (98-112)
components/linearb/linearb.app.mjs (1)
  • response (98-105)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (1)
components/linearb/actions/search-incidents/search-incidents.mjs (1)

90-95: No action needed Axios’s JSON serialization omits undefined values, so optional filter props aren’t sent when unset.

@luancazarine luancazarine merged commit c888bba into master Oct 9, 2025
10 checks passed
@luancazarine luancazarine deleted the 9417-linearb branch October 9, 2025 18:59
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.

LinearB

2 participants