• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

UiPath / uipathcli / 22833036745

09 Mar 2026 12:08AM UTC coverage: 90.732% (-0.2%) from 90.914%
22833036745

Pull #212

github

Chibi Vikram
Fix TestWriteMultipartFormWithClosedWriter to use failing writer

Use a writer that errors on Write() instead of a closed multipart writer,
since multipart.Writer.CreatePart doesn't check closed state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pull Request #212: Add studio solution commands, skill, and agents.md

598 of 674 new or added lines in 16 files covered. (88.72%)

3 existing lines in 1 file now uncovered.

7372 of 8125 relevant lines covered (90.73%)

1.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.24
/plugin/studio/solution/publish/solution_publish_command.go
1
// Package publish implements the command plugin for publishing a solution
2
// in UiPath Studio Web for deployment.
3
package publish
4

5
import (
6
        "bytes"
7
        "encoding/json"
8
        "errors"
9
        "fmt"
10
        "net/http"
11

12
        "github.com/UiPath/uipathcli/log"
13
        "github.com/UiPath/uipathcli/output"
14
        "github.com/UiPath/uipathcli/plugin"
15
        "github.com/UiPath/uipathcli/utils/api"
16
)
17

18
// The SolutionPublishCommand publishes a solution in Studio Web.
19
type SolutionPublishCommand struct{}
20

21
func (c SolutionPublishCommand) Command() plugin.Command {
1✔
22
        return *plugin.NewCommand("studio").
1✔
23
                WithCategory("solution", "UiPath Solution management", "Pack, unpack, push and pull UiPath Maestro solutions.").
1✔
24
                WithOperation("publish", "Publish Solution", "Publishes a solution in UiPath Studio Web for deployment").
1✔
25
                WithParameter(plugin.NewParameter("solution-id", plugin.ParameterTypeString, "Solution ID to publish").
1✔
26
                        WithRequired(true))
1✔
27
}
1✔
28

29
func (c SolutionPublishCommand) Execute(ctx plugin.ExecutionContext, writer output.OutputWriter, logger log.Logger) error {
1✔
30
        if ctx.Organization == "" {
2✔
31
                return errors.New("Organization is not set")
1✔
32
        }
1✔
33
        solutionId := c.getStringParameter("solution-id", "", ctx.Parameters)
1✔
34
        if solutionId == "" {
1✔
NEW
35
                return errors.New("Solution ID is required")
×
NEW
36
        }
×
37

38
        client := api.NewStudioClient(ctx.BaseUri, ctx.Organization, ctx.Auth.Token, ctx.Debug, ctx.Settings, logger)
1✔
39
        response, err := client.PublishSolution(solutionId)
1✔
40
        if err != nil {
2✔
41
                return err
1✔
42
        }
1✔
43

44
        result := solutionPublishResult{
1✔
45
                Status:    "Succeeded",
1✔
46
                RequestId: response.RequestId,
1✔
47
        }
1✔
48

1✔
49
        jsonData, err := json.Marshal(result)
1✔
50
        if err != nil {
1✔
NEW
51
                return fmt.Errorf("Publish command failed: %w", err)
×
NEW
52
        }
×
53
        return writer.WriteResponse(*output.NewResponseInfo(http.StatusOK, "200 OK", "HTTP/1.1", map[string][]string{}, bytes.NewReader(jsonData)))
1✔
54
}
55

56
func (c SolutionPublishCommand) getStringParameter(name string, defaultValue string, parameters []plugin.ExecutionParameter) string {
1✔
57
        result := defaultValue
1✔
58
        for _, p := range parameters {
2✔
59
                if p.Name == name {
2✔
60
                        if data, ok := p.Value.(string); ok {
2✔
61
                                result = data
1✔
62
                                break
1✔
63
                        }
64
                }
65
        }
66
        return result
1✔
67
}
68

69
func NewSolutionPublishCommand() *SolutionPublishCommand {
1✔
70
        return &SolutionPublishCommand{}
1✔
71
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc