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

Classify functions exposed by Rovo modules as user invocable with testing #55

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

dxu2-atlassian
Copy link
Contributor

Tests with logic of implementation still being drafted.

Copy link

Thank you for your submission! Like many open source projects, we ask that you sign our CLA (Contributor License Agreement) before we can accept your contribution.
If your email is listed below, please ensure that you sign the CLA with the same email address.

The following users still need to sign our CLA:
❌dxu2atlassian

Already signed the CLA? To re-check, try refreshing the page.

#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
pub struct Action<'a> {
pub key: &'a str,
pub name: &'a str, // TODO: this is not in the manifest in the example forge app, wouldn't this fail? https://bitbucket.org/atlassian/rovo-data-discoverability/src/2743f6ca42589c7d1fb2d50e0d9e65e5ef1aebbe/manifest.yml#lines-3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just leave it off, since serde will still deserialize it correctly if an object contains more keys than what you want to deserialize into.

pub struct Action<'a> {
pub key: &'a str,
pub name: &'a str, // TODO: this is not in the manifest in the example forge app, wouldn't this fail? https://bitbucket.org/atlassian/rovo-data-discoverability/src/2743f6ca42589c7d1fb2d50e0d9e65e5ef1aebbe/manifest.yml#lines-3
pub function: &'a str,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be an Option<&'a str>, since the action can also just have an endpoint property instead of a function property.

// Rovo Module Functions
// No invokable functions for Rovo Agents but Action can have numerous user invokable functions
action.iter().for_each(|action| {
if let Some(function) = action.function {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just directly pass action.function to extend.


// TODO: Rovo Action documentation states this is mandatory field but example apps don't use it, a typo? or are "required" fields not strictly enforced?
// eg: https://bitbucket.org/atlassian/rovo-data-discoverability/src/2743f6ca42589c7d1fb2d50e0d9e65e5ef1aebbe/manifest.yml#lines-3
pub name: &'a str,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not mandatory or you don't know, you can just leave it off, since we really only care about function.

@dxu2-atlassian dxu2-atlassian marked this pull request as ready for review December 4, 2024 22:08
@jwong101
Copy link
Contributor

jwong101 commented Dec 5, 2024

LGTM. Clean up the commit history, and I'll merge it in.

@jwong101 jwong101 merged commit 03e073e into atlassian-labs:main Dec 6, 2024
1 check 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.

2 participants