Skip to content
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

Fix connector script and its execution #386

Merged
merged 4 commits into from
Apr 21, 2024

Conversation

mit-27
Copy link
Contributor

@mit-27 mit-27 commented Apr 21, 2024

Summary by CodeRabbit

  • New Features
    • Updated environment setup to support different distribution modes ("selfhosted" or "managed").
  • Refactor
    • Enhanced script execution compatibility with newer Node versions by using the --experimental-detect-module flag.
    • Improved directory path construction in scripts for more accurate file handling.
  • Documentation
    • Improved readability and clarity in the docs/open-source/contributors.mdx file.
    • Clarified instructions for setting environment variables and managing 3rd party OAuth apps.
    • Provided a script to enable new services efficiently.

Copy link

changeset-bot bot commented Apr 21, 2024

⚠️ No Changeset found

Latest commit: c4064b3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Apr 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
panora-client-ts ❌ Failed (Inspect) Apr 21, 2024 6:41am

Copy link
Contributor

coderabbitai bot commented Apr 21, 2024

Walkthrough

The recent updates focus on enhancing script execution compatibility with Node by using the --experimental-detect-module flag and refining environment variable configurations in .env.example. Additionally, a script adjustment corrects a directory access issue by modifying the baseDir variable.

Changes

File Path Change Summary
.env.example, packages/api/package.json Updated environment variables and Node script execution flags.
packages/api/scripts/connectorUpdate.js Adjusted baseDir variable to use argv.objectType.

Assessment against linked issues

Objective Addressed Explanation
Fix node error when running script of connector (#385)

Poem

🐇 Hop, hop, hop, in the code we dive deep,
🌟 Twinkling changes, secrets we keep.
A tweak here, a fix there, oh what a sight,
🛠️ Mending the scripts into the night.
With every commit, our software takes flight!
🚀💻


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between afc80f5 and c4064b3.
Files selected for processing (1)
  • docs/open-source/contributors.mdx (2 hunks)
Additional Context Used
LanguageTool (36)
docs/open-source/contributors.mdx (36)

Near line 9: The verb ‘set up’ is spelled as two words. The noun ‘setup’ is spelled as one.
Context: ... icon: "star" --- ## Introduction ### Setup your environnement We made a docker fi...


Near line 9: Possible spelling mistake found.
Context: ...r" --- ## Introduction ### Setup your environnement We made a docker file that builds Pano...


Near line 11: Possible spelling mistake found.
Context: ...ment We made a docker file that builds Panora from sources, specifically to help you ...


Near line 13: Possible spelling mistake found.
Context: ... use it. Execute these from your Panora's repo root folder <St...


Near line 29: Possible typo: you repeated a whitespace
Context: ...OVIDER_VERTICAL_SOFTWAREMODE_ATTRIBUTE` where ``` PROVIDER is any 3rd party ...


Near line 37: The abbreviation “i.e.” (= that is) requires two periods.
Context: ...CLIENT_SECRET, SUBDOMAIN, ... } ``` i.e HUBSPOT_CRM_CLOUD_CLIENT_ID ...


Near line 63: Possible spelling mistake found.
Context: ...ntegrations ✨ Make sure you are inside packages/api/src where the server lives ! # You wa...


Near line 63: Do not use a space before the final punctuation mark.
Context: ...ide packages/api/src where the server lives ! # You want to add a new 3rd Party not ...


Near line 65: Do not use a space before the final punctuation mark.
Context: ...You want to add a new 3rd Party not yet supported ? 🧑‍🎤 _Ie: Slack, Hubspot, Jira, Shopi...


Near line 67: Possible spelling mistake found.
Context: ...w 3rd Party not yet supported ? 🧑‍🎤 Ie: Slack, Hubspot, Jira, Shopify ... Fi...


Near line 71: Possible spelling mistake found.
Context: ...he 3rd party belongs to among these: - crm - ticketing - accounting - ats - filest...


Near line 74: Possible spelling mistake found.
Context: ...hese: - crm - ticketing - accounting - ats - filestorage - hris - marketingautomat...


Near line 75: Possible spelling mistake found.
Context: ... - crm - ticketing - accounting - ats - filestorage - hris - marketingautomation For the s...


Near line 76: Possible spelling mistake found.
Context: ...ting - accounting - ats - filestorage - hris - marketingautomation For the sake of ...


Near line 77: Possible spelling mistake found.
Context: ...accounting - ats - filestorage - hris - marketingautomation For the sake of the guide, now on we'l...


Near line 79: Possible spelling mistake found.
Context: ...der adding a 3rd party belonging to the crm vertical. ## 1. Look into the `packag...


Near line 81: Possible spelling mistake found.
Context: ...o build has its metadata set inside the providersConfig object. It should be available (if no...


Near line 83: Possible spelling mistake found.
Context: ... It should be available (if not contact Panora team) with active field set to `false...


Near line 84: Consider adding a comma after ‘Actually’ for more clarity.
Context: ...ng the integration has not been built. Actually an integration is built in 2 parts : -...


Near line 87: Possible spelling mistake found.
Context: ...n 2 parts : - the authentication part (oauth, api key, basic etc) which is built by ...


Near line 87: Possible spelling mistake found.
Context: ...ts : - the authentication part (oauth, api key, basic etc) which is built by the P...


Near line 87: In American English, abbreviations like “etc.” require a period.
Context: ...hentication part (oauth, api key, basic etc) which is built by the Panora team - th...


Near line 87: Possible spelling mistake found.
Context: ...i key, basic etc) which is built by the Panora team - the service integration where th...


Near line 92: Do not use a space before the final punctuation mark.
Context: ... to map a common object to your new 3rd Party ? 👩‍🎤 _Ie: Contact, Ticket, Deal, Comp...


Near line 94: Possible spelling mistake found.
Context: ... object to your new 3rd Party ? 👩‍🎤 Ie: Contact, Ticket, Deal, Company ... F...


Near line 96: Possible spelling mistake found.
Context: ...s map the common object contact under crm vertical to my3rdParty (in reality i...


Near line 98: Possible spelling mistake found.
Context: ... to set active field to true inside providersConfig. ## 1. Add a new service to map your ...


Near line 110: Possible spelling mistake found.
Context: ...y API is handled It must implement the IContactService interface. ```ts export interface ICo...


Near line 150: Possible spelling mistake found.
Context: ... ``` Check other implementations under /crm/contacts/services to fill the core fun...


Near line 165: ‘Last but not least’ might be wordy. Consider a shorter alternative.
Context: ...tactOutput = 3rdPartyContactInput; ``` Last but not least, inside mappers.ts you have to build ...


Near line 168: Possible spelling mistake found.
Context: ...e 3rdPartyContact. It must implement IContactMapper interface. ```ts export interface ICo...


Near line 210: Possible spelling mistake found.
Context: ... ``` Check other implementations under /crm/contacts/services to fill the core fun...


Near line 215: Possible spelling mistake found.
Context: ...iven command from the root directory of Panora. ```bash cd packages/api && pnpm insta...


Near line 221: Possible spelling mistake found.
Context: ... The script will automatically scan the /crm/contact/services folder and detect any...


Near line 223: Do not use a space before the final punctuation mark.
Context: ...ated across the codebase. ### Congrats Hero ! 🦸‍♀️ ### You now have built a new int...


Near line 225: Possible spelling mistake found.
Context: ...u now have built a new integration with Panora ### NB: The development kit to add int...

Additional comments not posted (5)
docs/open-source/contributors.mdx (5)

17-20: LGTM! Clear instructions for setting up environment variables.


29-37: Excellent explanation of environment variable setup for third-party OAuth apps.


42-44: Useful command for cleaning up the development environment before fresh installations.


48-50: Ensure this npm configuration does not adversely affect users on other platforms.

Verification successful

The verification process has confirmed that the npm configuration settings node-linker=hoisted and package-import-method=clone-or-copy are only specified in the docs/open-source/contributors.mdx file. There are no other files in the repository that contain these settings, which means there is no risk of these configurations adversely affecting other parts of the project.

  • docs/open-source/contributors.mdx: Contains the specific npm configurations.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check if there are platform-specific configurations in other parts of the project that might conflict.
rg "node-linker=hoisted|package-import-method=clone-or-copy" --files-with-matches

Length of output: 117


54-56: Correct and clear instructions for starting the development environment using Docker.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

socket-security bot commented Apr 21, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@nestjs/[email protected] None +2 168 kB nestjscore
npm/@nestjs/[email protected] environment, filesystem +1 63.2 kB nestjscore
npm/@nestjs/[email protected] None +14 321 kB nestjscore
npm/@nestjs/[email protected] None 0 21.2 kB nestjscore
npm/@nestjs/[email protected] Transitive: shell +3 4.59 MB nestjscore
npm/@nestjs/[email protected] None 0 202 kB nestjscore
npm/@ntegral/[email protected] Transitive: environment, eval, filesystem, network +26 7.91 MB ntegral
npm/@sentry/[email protected] environment, filesystem, network, shell, unsafe +4 7.03 MB sentry-bot
npm/@sentry/[email protected] Transitive: network +4 4.98 MB sentry-bot
npm/@types/[email protected] None 0 5.67 kB types
npm/@types/[email protected] None +3 71.7 kB types
npm/@types/[email protected] None +2 55.9 kB types
npm/[email protected] Transitive: environment, filesystem, network, shell +26 1.35 MB amitosh
npm/[email protected] filesystem, shell Transitive: environment, eval, network, unsafe +23 8.24 MB manast
npm/[email protected] None 0 776 kB typestack-release-bot
npm/[email protected] None +3 14.2 MB typestack-release-bot
npm/[email protected] None +1 30.2 kB dougwilson
npm/[email protected] None 0 778 B ehsalazar
npm/[email protected] environment, filesystem 0 79.1 kB motdotla
npm/[email protected] None 0 30.5 kB benjamn
npm/[email protected] Transitive: environment, eval, filesystem, network, shell, unsafe +274 19.1 MB simenb
npm/[email protected] unsafe Transitive: environment, eval, filesystem +18 1.64 MB iamolegga
npm/[email protected] None +1 14.7 kB hydra-newmedia
npm/[email protected] None +14 314 kB themikenicholson
npm/[email protected] None +1 13.2 kB jaredhanson
npm/[email protected] network +2 88.9 kB jaredhanson
npm/[email protected] environment Transitive: filesystem +16 1.25 MB matteo.collina
npm/[email protected] environment, filesystem, unsafe 0 11.2 MB prettier-bot
npm/[email protected] None +1 17.3 MB prismabot
npm/[email protected] None 0 293 kB rbuckton
npm/[email protected] None 0 4.5 MB blesh
npm/[email protected] filesystem +2 895 kB linusu
npm/[email protected] network Transitive: environment, eval, filesystem +36 1.87 MB titanism
npm/[email protected] environment, filesystem, unsafe Transitive: shell +79 12.4 MB kul
npm/[email protected] filesystem Transitive: environment, eval, network, shell, unsafe +86 15.2 MB johnnyreilly
npm/[email protected] environment, filesystem, unsafe +16 1.98 MB cspotcode
npm/[email protected] environment, filesystem, unsafe +3 509 kB jonaskello
npm/[email protected] None 0 40.1 MB typescript-bot
npm/[email protected] None 0 123 kB ctavan

🚮 Removed packages: npm/@stytch/[email protected], npm/@stytch/[email protected], npm/@tanstack/[email protected], npm/@tanstack/[email protected], npm/@tanstack/[email protected], npm/@tanstack/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Copy link

socket-security bot commented Apr 21, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Install scripts npm/[email protected]
  • Install script: preinstall
  • Source: node scripts/preinstall-entry.js
Install scripts npm/[email protected]
  • Install script: install
  • Source: node-pre-gyp install --fallback-to-build
Install scripts npm/[email protected]
  • Install script: postinstall
  • Source: node postinstall.js
Protestware/Troll package npm/[email protected]
  • Note: This package prints a protestware console message regarding Ukraine for users with Russian language locale

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

What is protestware?

This package is a joke, parody, or includes undocumented or hidden behavior unrelated to its primary function.

Consider that consuming this package my come along with functionality unrelated to its primary purpose.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@naelob naelob merged commit 691a900 into panoratech:main Apr 21, 2024
10 of 13 checks passed
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.

Fix node error when running script of connector
2 participants