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

Update /review/send to Include Code Graph URL in Stakwork Response #2152

Closed
5 tasks
Tracked by #2149
humansinstitute opened this issue Dec 11, 2024 · 4 comments · Fixed by #2158
Closed
5 tasks
Tracked by #2149

Update /review/send to Include Code Graph URL in Stakwork Response #2152

humansinstitute opened this issue Dec 11, 2024 · 4 comments · Fixed by #2158
Assignees
Labels

Comments

@humansinstitute
Copy link
Contributor

humansinstitute commented Dec 11, 2024

Description

Modify the /review/send endpoint to retrieve the WorkspaceCodeGraph URL and include it in the Stakwork payload response. The URL should be retrieved based on the workspace UUID associated with the feature.

Implementation Details

1. Modify PostTicketDataToStakwork Function

Add code graph URL retrieval and include it in the Stakwork payload:

// In PostTicketDataToStakwork handler
var (
    productBrief, featureBrief, codeGraphURL string
    feature                    db.WorkspaceFeatures
)

if ticket.FeatureUUID != "" {
    feature = th.db.GetFeatureByUuid(ticket.FeatureUUID)
    if feature.Uuid == "" {
        // ... existing error handling ...
    }

    // Get code graph URL for the workspace
    if feature.WorkspaceUuid != "" {
        codeGraph, err := th.db.GetCodeGraphByWorkspaceUUID(feature.WorkspaceUuid)
        if err == nil {
            codeGraphURL = codeGraph.Url
        }
        // Note: We don't error if code graph isn't found - it's optional
    }

    // ... existing feature brief and product brief retrieval ...
}

// Update stakwork payload to include codeGraph
stakworkPayload := map[string]interface{}{
    "name":        "Hive Ticket Builder",
    "workflow_id": 37324,
    "workflow_params": map[string]interface{}{
        "set_var": map[string]interface{}{
            "attributes": map[string]interface{}{
                "vars": map[string]interface{}{
                    // ... existing fields ...
                    "codeGraph": codeGraphURL,  // Add this line
                },
            },
        },
    },
}

Task List

  1. Update variable declarations in PostTicketDataToStakwork
  2. Add code graph retrieval logic after feature validation
  3. Modify Stakwork payload to include code graph URL
  4. Test endpoint with and without code graph present
  5. Update unit tests

Acceptance Criteria

  • Code graph URL is retrieved when available
  • URL is correctly included in Stakwork payload
  • Empty string is sent when no code graph exists
  • Existing functionality remains unchanged
  • Error handling follows existing patterns
@MuhammadUmer44
Copy link
Contributor

MuhammadUmer44 commented Dec 11, 2024

@humansinstitute Please assign me?

@MahtabBukhari
Copy link
Contributor

MahtabBukhari commented Dec 11, 2024

@humansinstitute please assign

@Shoaibdev7
Copy link
Contributor

Shoaibdev7 commented Dec 11, 2024

@humansinstitute I can help?

@AhsanFarooqDev
Copy link
Contributor

@humansinstitute can i help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants