Skip to content

connector-v2 -- main as base #692

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

Draft
wants to merge 42 commits into
base: main
Choose a base branch
from
Draft

Conversation

miguel-nascimento
Copy link
Contributor

Using main branch as base this time. Made using rebase, this PR is only to use the GitHub UI in order to compare both PR

Connectors v2

Connectors v2 went through many tests until we got a MVP. This document explains the different ways we tried, the things we thought about at each step, and where we are headed.

Connectors as Code

The idea with connectors as code was to put all possible settings directly into the code, creating objects like slackConfig or githubConfig.

These would have information about the connector like clientId, botScopes, and userScopes. This way, we could easily change the values in the code to set up any connector.

To save and get these values, we used ts-morph, but that caused some problems. Users could change the connector config to non-literal values.

For example:

export const slackConnectorConfig: Partial<SlackUserAuth> = {
  clientId: Deno.env.get(“slackConfigClientId”),
  botScopes: [“channels:read”],
  userScopes: [],
};

In order to grab value from .env, or grab any dynamic value, we would need to run the code. And tools like ts-morph cant do this. This invalidates the connector-as-code approach.

We need to run and get the config.

Connectors as Handler (Current Version)

The connectors as a handler approach is similar to connectors as code, but now we use the handler to run the applet and get the config.

This solves the problem of non-literal values and handles OAuth-related issues by using other applets to get links, like slack-install-link.

This way, connectors can work in different ways based on actions, like just giving back the configurations or doing OAuth, for example, case “get-auth-url” or case “get-config”.

There are some concerns with this method, though. Some connectors might need code execution and HTTP calls, which could take a long time or might fail.
If zipper.run has downtimes, the connectors won’t work.

Other issues include:

  • We might lose some development experience because auto-complete won’t work when using the applets. But this is expected to have a small impact since the file will be auto-generated using a playground or a local CLI.

Current things missing:

  • Authentication is needed.
  • How we handle existing connectors, whether we keep them working as they are or update everything using codemod, is still undecided.
    • Update: we will migrate all connectors to the new version.

Copy link

vercel bot commented Jan 5, 2024

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

Name Status Preview Comments Updated (UTC)
zipper-run ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2024 6:36pm

@miguel-nascimento
Copy link
Contributor Author

After the base change, applet run isn't working. Probably due to a change in the boot.

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