FeatureRequestWorkflow
What it is
A support workflow that:
- Creates a GitHub feature request issue via the GitHub REST integration.
- Adds the created issue to a GitHub Project via the GitHub GraphQL integration.
- Caches both REST and GraphQL responses as JSON in object storage.
Public API
FeatureRequestWorkflowConfiguration(WorkflowConfiguration)- Holds configuration for GitHub integrations and project/field IDs.
FeatureRequestParameters(WorkflowParameters)- Input schema for creating a feature request issue (title, body, repo, labels, assignees, status/priority IDs).
FeatureRequestWorkflow(Workflow)create_feature_request(parameters: FeatureRequestParameters) -> Dict- Creates an issue, stores its JSON, adds it to a project with field values (status/priority/iteration), stores GraphQL JSON, and returns the created issue payload.
as_tools() -> List[BaseTool]- Exposes the workflow as a LangChain
StructuredToolnamedsupport_feature_request.
- Exposes the workflow as a LangChain
as_api(...) -> None- Present but does nothing (returns
None).
- Present but does nothing (returns
Configuration/Dependencies
- Requires:
GitHubIntegrationConfiguration(REST API configuration)GitHubGraphqlIntegrationConfiguration(GraphQL API configuration)
- Uses
ABIModule.get_instance().configurationdefaults for:data_store_pathproject_node_idstatus_field_idpriority_field_iditeration_field_iddefault_repositorypriority_option_idstatus_option_id
- Persists JSON via
StorageUtilsusingABIModule.get_instance().engine.services.object_storage.
Usage
from naas_abi_marketplace.domains.support.workflows.FeatureRequestWorkflow import (
FeatureRequestWorkflow,
FeatureRequestWorkflowConfiguration,
FeatureRequestParameters,
)
from naas_abi_marketplace.applications.github.integrations.GitHubIntegration import (
GitHubIntegrationConfiguration,
)
from naas_abi_marketplace.applications.github.integrations.GitHubGraphqlIntegration import (
GitHubGraphqlIntegrationConfiguration,
)
cfg = FeatureRequestWorkflowConfiguration(
github_integration_config=GitHubIntegrationConfiguration(...),
github_graphql_integration_config=GitHubGraphqlIntegrationConfiguration(...),
)
wf = FeatureRequestWorkflow(cfg)
issue = wf.create_feature_request(
FeatureRequestParameters(
issue_title="Add export button",
issue_body="Please add a CSV export button to the dashboard.",
# Optional overrides:
# repo_name="owner/repo",
# labels=["enhancement"],
# assignees=["octocat"],
# priority_id="...",
# status_id="...",
)
)
print(issue.get("html_url"))
Caveats
as_api(...)is a no-op; this workflow does not register any FastAPI routes.- JSON caching path is derived from
issue["repository_url"]by splitting onhttps://api.github.com/repos/; unexpected formats may affect storage paths. assigneesdefault is[]even though it is typed as optional.