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

Feature: Update to JSON Plugin Schema to Support Private Plugin Sources #2470

Open
wants to merge 48 commits into
base: main
Choose a base branch
from

Conversation

Bee-Mar
Copy link

@Bee-Mar Bee-Mar commented Dec 22, 2024

Summary

The pull request introduces the ability to add plugins from private sources, which includes GitHub, GitLab, Bitbucket and arbitrary hosts. The JSON schema was reworked to be more declarative, which forces the user declare components of the addressed location. Changing the structure allows for future flexibility, and was needed in my case when working with repositories only accessible through an AWS tunnel. While it does make the include section more verbose, I believe the verbosity is a positive.

In short, the plugin declaration syntax goes from something like this:

  "include": [
    "github:<org>/<repo>?dir=<plugin-dir>"
  ]

to

"include": [
  {
    "type": "github",
    "owner": "org",
    "repo": "repository",
    "dir": "subdir"
  }
]

An example of privately hosted plugins accessible through SSH:

"include": [
  {
    "type": "ssh",
    "host": "localhost",
    "port": 1234,
    "owner": "org",
    "repo": "repository",
    "dir": "subdir"
  }
]

How was it tested?

New unit tests were added to internal/plugin/git_test.go, and this has been tested in by creating several repos to use as a test-bed, and ensuring they can be installed by declaring them in the devbox.json. Additionally, I have used this for my desired purpose, which is to access Devbox plugins only accessible in a privately hosted GitLab repo behind an AWS tunnel.

Addtional unit tests can be added if preferred. Please let me know what changes/improvements you'd like to see.

Thank you in advance for taking the time to review my pull request!

Bee-Mar added 30 commits May 24, 2024 22:41
@Bee-Mar Bee-Mar marked this pull request as ready for review December 22, 2024 22:40
@Bee-Mar Bee-Mar changed the title Feature: Update to JSON Plugin Schema to Allow Private Sources Feature: Update to JSON Plugin Schema to Support Private Plugin Sources Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant