-
Notifications
You must be signed in to change notification settings - Fork 172
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
feat: Add plugin for prefect #284
base: main
Are you sure you want to change the base?
feat: Add plugin for prefect #284
Conversation
@avinash-santhanagopalan There are some commits you should sign, otherwise this cannot be merged |
Ping me after TODOs around config file importing are removed, and all commits are signed. I think this PR would be getting close to the finish line, after those are resolved. |
39c7a73
to
5a6256c
Compare
Signed-off-by: Avinash Santhanagopalan <avinash.santhanagopalan@agilebits.com>
Signed-off-by: Avinash Santhanagopalan <avinash.santhanagopalan@agilebits.com>
Signed-off-by: Avinash Santhanagopalan <avinash.santhanagopalan@agilebits.com>
5a6256c
to
d5d2691
Compare
@AndyTitu I've signed previous commits and removed the file importer portions. Let me know if there are further changes required. |
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.
Hey Avinash! Thanks for building this plugin 🙌 Overall it looks good. I've left a few comments to increase the test coverage and make some things a bit more future compatible.
Once these points are addressed, this is good to go in my opinion 🚀
plugins/prefect/access_key.go
Outdated
Composition: &schema.ValueComposition{ | ||
Length: 124, | ||
Prefix: "https://api.prefect.cloud/api/accounts/", | ||
Charset: schema.Charset{ | ||
Uppercase: false, | ||
Lowercase: true, | ||
Digits: true, | ||
}, | ||
}, |
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.
It looks like Prefect also supports custom deployments. In that case, the API URL will be completely unpredictable. So I'd suggest we remove this composition field to assure maximum compatibility.
Composition: &schema.ValueComposition{ | |
Length: 124, | |
Prefix: "https://api.prefect.cloud/api/accounts/", | |
Charset: schema.Charset{ | |
Uppercase: false, | |
Lowercase: true, | |
Digits: true, | |
}, | |
}, |
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.
Ah I wasn't aware the API URL can change completely. One minor point is that the format of the URL will definitely have an account UUID and a workspace UUID following uuid4 format. Not sure if there is a way to specifically check that. I've had trouble in the past where I missed a single character while initiating and prefect's failure to authenticate messages were less than helpful.
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.
@avinash-santhanagopalan Shell Plugins' importer SDK handles the importing of the API URL (which has the UUID segments) seamlessly. I think your overall concern is how to create/use UUID only in the tests. You can use a random UUID from https://uuid.rocks/ for that purpose.
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.
One minor point is that the format of the URL will definitely have an account UUID and a workspace UUID following uuid4 format. Not sure if there is a way to specifically check that. I've had trouble in the past where I missed a single character while initiating and prefect's failure to authenticate messages were less than helpful.
Hmm. That's a good point. However, I don't think we have a good way to check for that right now. I can imagine us introducing more flexible validators for credentials at some point, which could help here. However, such a thing is not currently planned. So I think the best we can do for now, is rely on Prefect's error messaging here.
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.
@avinash-santhanagopalan We are less interested in determining composition for an URL-type field. Also there's no way currently to define an exact structure the field could take. So I agree with Joris that specifying this value composition could do more harm than good in this case, so we can just remove it altogether.
@avinash-santhanagopalan is there anything we can do to help move this forward? |
@avinash-santhanagopalan Let us know if there's anything that we can do to help move this forward! |
Overview
Adds a plugin for prefect cli
Type of change
Related Issue(s)
How To Test
Install prefect:
Test the plugin:
Changelog
Authenticate Prefect using 1Password Shell Plugin