mirror of
https://github.com/strongdm/comply
synced 2024-11-22 07:34:54 +00:00
fixes #45
This commit is contained in:
parent
06b8a2fe44
commit
44931ca808
@ -14,7 +14,7 @@ var procedureCommand = cli.Command{
|
|||||||
Usage: "create ticket by procedure ID",
|
Usage: "create ticket by procedure ID",
|
||||||
ArgsUsage: "procedureID",
|
ArgsUsage: "procedureID",
|
||||||
Action: procedureAction,
|
Action: procedureAction,
|
||||||
Before: projectMustExist,
|
Before: beforeAll(projectMustExist, ticketingMustBeConfigured),
|
||||||
}
|
}
|
||||||
|
|
||||||
func procedureAction(c *cli.Context) error {
|
func procedureAction(c *cli.Context) error {
|
||||||
|
@ -50,6 +50,10 @@ func GetPlugin(ts TicketSystem) TicketPlugin {
|
|||||||
tsPluginsMu.Lock()
|
tsPluginsMu.Lock()
|
||||||
defer tsPluginsMu.Unlock()
|
defer tsPluginsMu.Unlock()
|
||||||
|
|
||||||
|
if ts == NoTickets {
|
||||||
|
return &noopTicketSystem{}
|
||||||
|
}
|
||||||
|
|
||||||
tp, ok := tsPlugins[ts]
|
tp, ok := tsPlugins[ts]
|
||||||
if !ok {
|
if !ok {
|
||||||
panic("Unknown ticket system: " + ts)
|
panic("Unknown ticket system: " + ts)
|
||||||
@ -100,3 +104,36 @@ func Register(ts TicketSystem, plugin TicketPlugin) {
|
|||||||
|
|
||||||
tsPlugins[ts] = plugin
|
tsPlugins[ts] = plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type noopTicketSystem struct{}
|
||||||
|
|
||||||
|
func (*noopTicketSystem) Get(ID string) (*Ticket, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
func (*noopTicketSystem) FindOpen() ([]*Ticket, error) {
|
||||||
|
return []*Ticket{}, nil
|
||||||
|
}
|
||||||
|
func (*noopTicketSystem) FindByTag(name, value string) ([]*Ticket, error) {
|
||||||
|
return []*Ticket{}, nil
|
||||||
|
}
|
||||||
|
func (*noopTicketSystem) FindByTagName(name string) ([]*Ticket, error) {
|
||||||
|
return []*Ticket{}, nil
|
||||||
|
}
|
||||||
|
func (*noopTicketSystem) Create(ticket *Ticket, labels []string) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (*noopTicketSystem) Configure(map[string]interface{}) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (*noopTicketSystem) Prompts() map[string]string {
|
||||||
|
return make(map[string]string)
|
||||||
|
}
|
||||||
|
func (*noopTicketSystem) Links() TicketLinks {
|
||||||
|
return TicketLinks{}
|
||||||
|
}
|
||||||
|
func (*noopTicketSystem) LinkFor(ticket *Ticket) string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
func (*noopTicketSystem) Configured() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user