- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.5k
New Components - launch_darkly_oauth #18006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| WalkthroughAdds OAuth-specific wrappers for multiple LaunchDarkly actions and sources by reusing base modules and adjusting prop definitions to inject the OAuth app. Updates the OAuth app to reuse LaunchDarkly methods and add an OAuth Authorization header helper. Adds a utility to adjust prop definitions and bumps package version and dependency. Changes
 Sequence Diagram(s)sequenceDiagram
  participant User
  participant OAuth_Action as OAuth Action
  participant App as OAuth App
  participant BaseAction as Base LaunchDarkly Action
  participant LD as LaunchDarkly API
  User->>OAuth_Action: Invoke action with props
  OAuth_Action->>App: getHeaders() with OAuth token
  OAuth_Action->>BaseAction: Call with adjusted props
  BaseAction->>LD: HTTP request (Authorization: Bearer <token>)
  LD-->>BaseAction: Response
  BaseAction-->>OAuth_Action: Result
  OAuth_Action-->>User: Output
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Assessment against linked issues
 Assessment against linked issues: Out-of-scope changes
 Possibly related PRs
 Suggested labels
 Suggested reviewers
 Poem
 ✨ Finishing Touches
 🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit: 
 SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
 Other keywords and placeholders
 CodeRabbit Configuration File ( | 
| The latest updates on your projects. Learn more about Vercel for Git ↗︎ | 
There was a problem hiding this 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/launch_darkly_oauth/actions/list-projects/list-projects.mjs (1)
1-22: Optional: DRY the wrapper pattern with a small helperAll OAuth wrappers share the same structure. Consider centralizing with a helper to reduce duplication and drift.
Apply this minimal refactor in-place:
import app from "../../launch_darkly_oauth.app.mjs"; -import common from "@pipedream/launchdarkly/actions/list-projects/list-projects.mjs"; - -import { adjustPropDefinitions } from "../../common/utils.mjs"; - -const { - name, description, type, ...others -} = common; -const props = adjustPropDefinitions(others.props, app); - -export default { - ...others, - key: "launch_darkly_oauth-list-projects", - version: "0.0.1", - name, - description, - type, - props: { - app, - ...props, - }, -}; +import common from "@pipedream/launchdarkly/actions/list-projects/list-projects.mjs"; +import { wrapOAuth } from "../../common/utils.mjs"; + +export default wrapOAuth(common, app, "launch_darkly_oauth-list-projects", "0.0.1");Support code (outside this file) you can add once to
components/launch_darkly_oauth/common/utils.mjs:export function wrapOAuth(common, app, key, version = "0.0.1") { const { name, description, type, ...others } = common; const props = adjustPropDefinitions(others.props ?? {}, app); return { ...others, key, version, name, description, type, props: { app, ...props }, }; }Also consider making
adjustPropDefinitionsresilient to missingprops:export function adjustPropDefinitions(props = {}, app) { /* existing body */ }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
- pnpm-lock.yamlis excluded by- !**/pnpm-lock.yaml
📒 Files selected for processing (16)
- components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs(1 hunks)
- components/launch_darkly_oauth/actions/get-feature-flag-status/get-feature-flag-status.mjs(1 hunks)
- components/launch_darkly_oauth/actions/get-feature-flag/get-feature-flag.mjs(1 hunks)
- components/launch_darkly_oauth/actions/get-project/get-project.mjs(1 hunks)
- components/launch_darkly_oauth/actions/list-environments/list-environments.mjs(1 hunks)
- components/launch_darkly_oauth/actions/list-feature-flags/list-feature-flags.mjs(1 hunks)
- components/launch_darkly_oauth/actions/list-members/list-members.mjs(1 hunks)
- components/launch_darkly_oauth/actions/list-projects/list-projects.mjs(1 hunks)
- components/launch_darkly_oauth/actions/toggle-feature-flag/toggle-feature-flag.mjs(1 hunks)
- components/launch_darkly_oauth/actions/update-feature-flag/update-feature-flag.mjs(1 hunks)
- components/launch_darkly_oauth/common/utils.mjs(1 hunks)
- components/launch_darkly_oauth/launch_darkly_oauth.app.mjs(1 hunks)
- components/launch_darkly_oauth/package.json(2 hunks)
- components/launch_darkly_oauth/sources/new-access-token-event/new-access-token-event.mjs(1 hunks)
- components/launch_darkly_oauth/sources/new-flag-event/new-flag-event.mjs(1 hunks)
- components/launch_darkly_oauth/sources/new-user-event/new-user-event.mjs(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (14)
components/launch_darkly_oauth/common/utils.mjs (14)
components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs (1)
props(9-9)components/launch_darkly_oauth/actions/get-feature-flag-status/get-feature-flag-status.mjs (1)
props(9-9)components/launch_darkly_oauth/actions/get-feature-flag/get-feature-flag.mjs (1)
props(9-9)components/launch_darkly_oauth/actions/get-project/get-project.mjs (1)
props(9-9)components/launch_darkly_oauth/actions/list-feature-flags/list-feature-flags.mjs (1)
props(9-9)components/launch_darkly_oauth/actions/list-members/list-members.mjs (1)
props(9-9)components/launch_darkly_oauth/actions/update-feature-flag/update-feature-flag.mjs (1)
props(9-9)components/launch_darkly_oauth/actions/list-environments/list-environments.mjs (1)
props(9-9)components/launch_darkly_oauth/actions/toggle-feature-flag/toggle-feature-flag.mjs (1)
props(9-9)components/launch_darkly_oauth/actions/list-projects/list-projects.mjs (1)
props(9-9)components/launch_darkly_oauth/sources/new-access-token-event/new-access-token-event.mjs (1)
props(9-9)components/launch_darkly_oauth/sources/new-flag-event/new-flag-event.mjs (1)
props(9-9)components/launch_darkly_oauth/sources/new-user-event/new-user-event.mjs (1)
props(9-9)components/monday_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/actions/list-feature-flags/list-feature-flags.mjs (1)
components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/actions/get-feature-flag/get-feature-flag.mjs (1)
components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/sources/new-flag-event/new-flag-event.mjs (1)
components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/actions/get-project/get-project.mjs (1)
components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/actions/update-feature-flag/update-feature-flag.mjs (1)
components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/actions/get-feature-flag-status/get-feature-flag-status.mjs (1)
components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/actions/list-projects/list-projects.mjs (2)
components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/sources/new-access-token-event/new-access-token-event.mjs (2)
components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/actions/list-members/list-members.mjs (2)
components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs (1)
components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/actions/list-environments/list-environments.mjs (2)
components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/sources/new-user-event/new-user-event.mjs (1)
components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
components/launch_darkly_oauth/actions/toggle-feature-flag/toggle-feature-flag.mjs (13)
components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/actions/get-feature-flag-status/get-feature-flag-status.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/actions/get-feature-flag/get-feature-flag.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/actions/get-project/get-project.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/actions/list-feature-flags/list-feature-flags.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/actions/list-members/list-members.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/actions/update-feature-flag/update-feature-flag.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/actions/list-environments/list-environments.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/actions/list-projects/list-projects.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/sources/new-access-token-event/new-access-token-event.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/sources/new-flag-event/new-flag-event.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/sources/new-user-event/new-user-event.mjs (2)
others(6-8)
props(9-9)components/launch_darkly_oauth/common/utils.mjs (1)
adjustPropDefinitions(1-40)
⏰ 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: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (17)
components/launch_darkly_oauth/package.json (1)
3-18: All OAuth-Wrapped Endpoints and Imports Verified
- Confirmed every import from "@pipedream/launchdarkly" in components/launch_darkly_oauth resolves.
- All 10 expected OAuth-wrapped actions are present:
- evaluate-feature-flag
- get-feature-flag
- get-feature-flag-status
- get-project
- list-environments
- list-feature-flags
- list-members
- list-projects
- toggle-feature-flag
- update-feature-flag
- All 3 expected OAuth-wrapped sources are present:
- new-access-token-event
- new-flag-event
- new-user-event
No missing files or broken imports detected—ready to merge.
components/launch_darkly_oauth/common/utils.mjs (1)
1-40: Prop definition adapter matches established pattern; LGTM.The implementation mirrors the pattern used in other OAuth packages (e.g., monday_oauth), correctly:
- Preserving string props
- Replacing the first propDefinition element with the OAuth app
- Dropping props of type "app"
No changes requested.
components/launch_darkly_oauth/launch_darkly_oauth.app.mjs (1)
1-17: App wrapper and headers override are correct; LGTM.
- Spreading ...launchdarkly.methods before getHeaders ensures the OAuth header logic overrides the base.
- Authorization header is appended last, preventing accidental override by callers.
Optional (no change required): consider adding Accept: application/json to be explicit for GET requests if any downstream relies on it.
components/launch_darkly_oauth/actions/evaluate-feature-flag/evaluate-feature-flag.mjs (1)
1-22: Wrapper pattern is correct and consistent; LGTM.
- adjustPropDefinitions usage is appropriate and props are correctly reintroduced alongside app.
- Key/version overrides are applied after spreading ...others.
No changes requested.
components/launch_darkly_oauth/actions/get-project/get-project.mjs (1)
1-22: Consistent OAuth wrapper; LGTM.
- Properly injects app and adjusted props.
- Correct key and version overrides.
No changes requested.
components/launch_darkly_oauth/actions/get-feature-flag/get-feature-flag.mjs (1)
1-22: Consistent OAuth wrapper; LGTM.Pattern matches other actions and correctly replaces propDefinition app ref. No issues spotted.
components/launch_darkly_oauth/sources/new-access-token-event/new-access-token-event.mjs (1)
1-22: Source wrapper is correct; LGTM.
- Props adjusted and app injected properly.
- Unique key and version set.
No changes requested.
components/launch_darkly_oauth/sources/new-flag-event/new-flag-event.mjs (1)
1-22: Source wrapper follows the same solid pattern; LGTM.Nothing concerning here; consistent with the rest of the OAuth-wrapped sources.
components/launch_darkly_oauth/actions/list-projects/list-projects.mjs (1)
1-22: Pattern-aligned OAuth wrapper — looks goodConsistently injects the OAuth app and adjusts prop definitions as elsewhere in the PR. Spread order ensures your overrides take precedence.
components/launch_darkly_oauth/actions/list-environments/list-environments.mjs (1)
1-22: LGTM — consistent OAuth wrapperCorrectly reuses base action metadata and injects
appwith adjusted props. Spread order and key override look correct.components/launch_darkly_oauth/actions/list-feature-flags/list-feature-flags.mjs (1)
1-22: LGTM — wrapper matches established patternImports are correct, props adjusted via utility, and key/version override is in the right place.
components/launch_darkly_oauth/sources/new-user-event/new-user-event.mjs (1)
1-22: Source wrapper looks correctProperly injects the OAuth app into prop definitions and preserves base source metadata. Key uniqueness looks fine.
components/launch_darkly_oauth/actions/update-feature-flag/update-feature-flag.mjs (1)
1-22: LGTM — update wrapper is correctOAuth app injection and prop adjustments look good. This action will rely on correct OAuth scopes on the app to avoid 403s at runtime.
components/launch_darkly_oauth/actions/toggle-feature-flag/toggle-feature-flag.mjs (1)
1-22: LGTM — toggle wrapper matches the patternAll fields and prop handling look consistent with other OAuth-wrapped actions.
components/launch_darkly_oauth/actions/list-members/list-members.mjs (2)
1-22: LGTM — list-members OAuth wrapperImplementation is consistent and correct.
1-22: Verification complete: all expected OAuth wrappers are present
All ten endpoints (get-feature-flag,get-feature-flag-status,list-feature-flags,list-projects,get-project,list-environments,list-members,toggle-feature-flag,update-feature-flag,new-user-event) have matchinglaunch_darkly_oauth-…keys in the codebase. No missing wrappers detected.components/launch_darkly_oauth/actions/get-feature-flag-status/get-feature-flag-status.mjs (1)
1-22: LGTM — status wrapper is correctUses the shared adjust utility and injects the app as expected. No issues spotted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @michelle0927 lgtm! Ready for QA!
Resolves #17725
@vunguyenhung: I'm getting 403 errors from some components, but I suspect it's because the account's trial period has ended.
Summary by CodeRabbit
New Features
Chores