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

[EN-1502] Refactor manifest creation for legacy connectors #46

Merged
merged 3 commits into from
Sep 14, 2022

Conversation

rukolahasser
Copy link
Contributor

It's hard to migrate some legacy connectors to the new repo, so we need a way to create manifest manually.

@rukolahasser rukolahasser force-pushed the feature/refactor-traderjoe-EN-1502 branch from dd97ad5 to 5975bcd Compare September 12, 2022 11:41
@cnkarz
Copy link
Contributor

cnkarz commented Sep 13, 2022

I think @azhang wants to keep manifest limiting. What issue did you have? Why did you need to make it so?

@rukolahasser
Copy link
Contributor Author

I think @azhang wants to keep manifest limiting. What issue did you have? Why did you need to make it so?

@cnkarz It's kinda hard to migrate traderjoe to the new connectors repo, so i don't want it to crash when manifest file doesn't exist.
You can call it like this:

m := connector.CreateManifest("traderjoe", "nakji", "0.0.0")

c, err := connector.NewConnector(connector.WithManifest(m))
if err != nil {
    log.Error().Err(err).Msg("failed to instantiate connector")
}

in this way you can override manifest on instantiation.

@cnkarz
Copy link
Contributor

cnkarz commented Sep 13, 2022

I don't understand why this can't be included in a manifest file. Or do you need additional functionality?
Also the code is quite confusing. Why not just pass the manifest object to NewConnector directly and set it as c.manifest = m ?

@rukolahasser
Copy link
Contributor Author

@cnkarz

  1. Because in the blep repo, the working dir is different, so it can't be included in the manifest file.
  2. The manifest field is not exported, so we cannot access it, also it will panic when it reaches c.id().
  3. I'm trying to change as little code as possible to make it work cuz many connectors are dependent on it.

manifest.go Outdated Show resolved Hide resolved
manifest.go Outdated Show resolved Hide resolved
connector.go Show resolved Hide resolved
@rukolahasser rukolahasser merged commit 7595287 into main Sep 14, 2022
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.

None yet

2 participants