diff --git a/actions/actions.go b/actions/actions.go index a2db8f80e8..59255473c7 100644 --- a/actions/actions.go +++ b/actions/actions.go @@ -1,35 +1,5 @@ package actions -/* - The actions system is a key component for process automation in WIT. It provides - a way of executing user-configurable, dynamic process steps depending on user - settings, schema settings and events in the WIT. - - The idea here is to provide a simple, yet powerful "publish-subscribe" system that - can connect any "event" in the system to any "action" with a clear decoupling - of events and actions with the goal of making the associations later dynamic and - configurable by the user ("user connects this event to this action"). Think - of a "IFTTT for WIT" (https://en.wikipedia.org/wiki/IFTTT). - - Actions are generic and atomic execution steps that do exactly one task and - are configurable. The actions system around the actions provide a key-based - execution of the actions. - - Some examples for an application of this system would be: - - closing all children of a parent WI that is being closed (the user connects the - "close" attribute change event of a WI to an action that closes all WIs of - a matching query). - - sending out notifications for mentions on markdown (the system executes an - action "send notification" for every mention found in markdown values). - - moving all WIs from one iteration to the next in the time sequence when - the original iteration is closed. - - For all these automations, the actions system provides a re-usable, flexible - and later user configurable way of doing that without creating lots of - custom code and/or custom process implementations that are hardcoded in the - WIT. -*/ - import ( "context" @@ -65,21 +35,19 @@ func ExecuteActionsByChangeset(ctx context.Context, db application.DB, userID uu actionConfig := actionConfigs[actionKey] switch actionKey { case rules.ActionKeyNil: - newContext, actionChanges, err = executeAction(rules.ActionNil{}, actionConfig, newContext, contextChanges, &actionChanges) + newContext, actionChanges, err = executeAction(rules.ActionNil{}, actionConfig, newContext, contextChanges, actionChanges) case rules.ActionKeyFieldSet: newContext, actionChanges, err = executeAction(rules.ActionFieldSet{ Db: db, Ctx: ctx, UserID: &userID, - }, actionConfig, newContext, contextChanges, &actionChanges) - /* commented out for now until this rule is added + }, actionConfig, newContext, contextChanges, actionChanges) case rules.ActionKeyStateToMetastate: newContext, actionChanges, err = executeAction(rules.ActionStateToMetaState{ Db: db, Ctx: ctx, UserID: &userID, - }, actionConfig, newContext, contextChanges, &actionChanges) - */ + }, actionConfig, newContext, contextChanges, actionChanges) default: return nil, nil, errs.New("action key " + actionKey + " is unknown") } @@ -93,7 +61,7 @@ func ExecuteActionsByChangeset(ctx context.Context, db application.DB, userID uu // executeAction executes the action given. The actionChanges contain the changes made by // prior action executions. The execution is expected to add/update their changes on this // change set. -func executeAction(act rules.Action, configuration string, newContext change.Detector, contextChanges change.Set, actionChanges *change.Set) (change.Detector, change.Set, error) { +func executeAction(act rules.Action, configuration string, newContext change.Detector, contextChanges change.Set, actionChanges change.Set) (change.Detector, change.Set, error) { if act == nil { return nil, nil, errs.New("rule can not be nil") } diff --git a/actions/doc.go b/actions/doc.go index 3f062fc6c1..8b66759ee7 100644 --- a/actions/doc.go +++ b/actions/doc.go @@ -3,7 +3,7 @@ Package actions system is a key component for process automation in WIT. It prov way of executing user-configurable, dynamic process steps depending on user settings, schema settings and events in the WIT. -The idea here is to provide a simple, yet powerful "signal-slot" system that +The idea here is to provide a simple, yet powerful "publish-subscribe" system that can connect any "event" in the system to any "action" with a clear decoupling of events and actions with the goal of making the associations later dynamic and configurable by the user ("user connects this event to this action"). Think diff --git a/actions/rules/action.go b/actions/rules/action.go index db7b7de4a6..d87bff003f 100644 --- a/actions/rules/action.go +++ b/actions/rules/action.go @@ -24,5 +24,5 @@ type Action interface { // updated attributes. It returns the new context. Note that this // needs the new (after change) context and the old value(s) as // part of the changeset. - OnChange(newContext change.Detector, contextChanges change.Set, configuration string, actionChanges *change.Set) (change.Detector, change.Set, error) + OnChange(newContext change.Detector, contextChanges change.Set, configuration string, actionChanges change.Set) (change.Detector, change.Set, error) } diff --git a/actions/rules/action_field_set.go b/actions/rules/action_field_set.go index c38b3f0a59..4411c228d1 100644 --- a/actions/rules/action_field_set.go +++ b/actions/rules/action_field_set.go @@ -52,7 +52,7 @@ func (act ActionFieldSet) storeWorkItem(wi *workitem.WorkItem) (*workitem.WorkIt } // OnChange executes the action rule. -func (act ActionFieldSet) OnChange(newContext change.Detector, contextChanges change.Set, configuration string, actionChanges *change.Set) (change.Detector, change.Set, error) { +func (act ActionFieldSet) OnChange(newContext change.Detector, contextChanges change.Set, configuration string, actionChanges change.Set) (change.Detector, change.Set, error) { // check if the newContext is a WorkItem, fail otherwise. wiContext, ok := newContext.(workitem.WorkItem) if !ok { @@ -76,7 +76,7 @@ func (act ActionFieldSet) OnChange(newContext change.Detector, contextChanges ch if !ok { return nil, nil, errs.New("unknown field name: " + k) } - *actionChanges = append(*actionChanges, change.Change{ + actionChanges = append(actionChanges, change.Change{ AttributeName: k, NewValue: v, OldValue: wiContext.Fields[k], @@ -100,5 +100,5 @@ func (act ActionFieldSet) OnChange(newContext change.Detector, contextChanges ch return nil, nil, errs.New("field attribute unknown: " + k) } } - return *actionResultContext, *actionChanges, nil + return *actionResultContext, actionChanges, nil } diff --git a/actions/rules/action_field_set_test.go b/actions/rules/action_field_set_test.go index e1a26f443f..ad630402eb 100644 --- a/actions/rules/action_field_set_test.go +++ b/actions/rules/action_field_set_test.go @@ -56,7 +56,7 @@ func (s *ActionFieldSetSuite) TestActionExecution() { } var convertChanges change.Set // Not using constants here intentionally. - afterActionWI, convertChanges, err := action.OnChange(newVersion, contextChanges, "{ \"system.state\": \"resolved\" }", &convertChanges) + afterActionWI, convertChanges, err := action.OnChange(newVersion, contextChanges, "{ \"system.state\": \"resolved\" }", convertChanges) require.NoError(t, err) require.Len(t, convertChanges, 1) require.Equal(t, workitem.SystemState, convertChanges[0].AttributeName) @@ -79,7 +79,7 @@ func (s *ActionFieldSetSuite) TestActionExecution() { } var convertChanges change.Set // Not using constants here intentionally. - afterActionWI, convertChanges, err := action.OnChange(newVersion, contextChanges, "{ \"system.state\": \"resolved\" }", &convertChanges) + afterActionWI, convertChanges, err := action.OnChange(newVersion, contextChanges, "{ \"system.state\": \"resolved\" }", convertChanges) require.NoError(t, err) require.Len(t, convertChanges, 1) require.Equal(t, workitem.SystemState, convertChanges[0].AttributeName) @@ -87,7 +87,7 @@ func (s *ActionFieldSetSuite) TestActionExecution() { require.Equal(t, workitem.SystemStateResolved, convertChanges[0].NewValue) require.Equal(t, workitem.SystemStateResolved, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemState]) // doing another change, the convertChange needs to stack. - afterActionWI, convertChanges, err = action.OnChange(afterActionWI, change.Set{}, "{ \"system.state\": \"new\" }", &convertChanges) + afterActionWI, convertChanges, err = action.OnChange(afterActionWI, change.Set{}, "{ \"system.state\": \"new\" }", convertChanges) require.NoError(t, err) require.Len(t, convertChanges, 2) require.Equal(t, workitem.SystemState, convertChanges[0].AttributeName) @@ -112,7 +112,7 @@ func (s *ActionFieldSetSuite) TestActionExecution() { UserID: &fxt.Identities[0].ID, } var convertChanges change.Set - _, _, err = action.OnChange(newVersion, contextChanges, "{ \"system.notavailable\": \"updatedState\" }", &convertChanges) + _, _, err = action.OnChange(newVersion, contextChanges, "{ \"system.notavailable\": \"updatedState\" }", convertChanges) require.NotNil(t, err) }) @@ -129,7 +129,7 @@ func (s *ActionFieldSetSuite) TestActionExecution() { UserID: &fxt.Identities[0].ID, } var convertChanges change.Set - _, convertChanges, err = action.OnChange(newVersion, contextChanges, "someNonJSON", &convertChanges) + _, convertChanges, err = action.OnChange(newVersion, contextChanges, "someNonJSON", convertChanges) require.NotNil(t, err) }) } diff --git a/actions/rules/action_nil.go b/actions/rules/action_nil.go index 8a005da3ee..56ab95e784 100644 --- a/actions/rules/action_nil.go +++ b/actions/rules/action_nil.go @@ -12,6 +12,6 @@ type ActionNil struct { var _ Action = ActionNil{} // OnChange executes the action rule. -func (act ActionNil) OnChange(newContext change.Detector, contextChanges change.Set, configuration string, actionChanges *change.Set) (change.Detector, change.Set, error) { +func (act ActionNil) OnChange(newContext change.Detector, contextChanges change.Set, configuration string, actionChanges change.Set) (change.Detector, change.Set, error) { return newContext, nil, nil } diff --git a/actions/rules/action_state_to_metastate.go b/actions/rules/action_state_to_metastate.go new file mode 100644 index 0000000000..636f7c3652 --- /dev/null +++ b/actions/rules/action_state_to_metastate.go @@ -0,0 +1,456 @@ +package rules + +import ( + "context" + "encoding/json" + "github.com/fabric8-services/fabric8-wit/actions/change" + "github.com/fabric8-services/fabric8-wit/id" + + errs "github.com/pkg/errors" + uuid "github.com/satori/go.uuid" + + "github.com/fabric8-services/fabric8-wit/application" + "github.com/fabric8-services/fabric8-wit/workitem" +) + +// ActionStateToMetaState implements the bidirectional mapping between state and column. +type ActionStateToMetaState struct { + Db application.DB + Ctx context.Context + UserID *uuid.UUID +} + +// make sure the rule is implementing the interface. +var _ Action = ActionStateToMetaState{} + +func (act ActionStateToMetaState) contains(s []interface{}, e interface{}) bool { + for _, a := range s { + if a == e { + return true + } + } + return false +} + +func (act ActionStateToMetaState) removeElement(s []interface{}, e interface{}) []interface{} { + for idx, a := range s { + if a == e { + copy(s[idx:], s[idx+1:]) + s[len(s)-1] = nil + s = s[:len(s)-1] + // we don't return here as there may be multiple copies of e in s. + } + } + return s +} + +// difference returns the differences between two slices. It returns two slices containing +// the added and removed elements compared from old and new arguments. +func (act ActionStateToMetaState) difference(old []interface{}, new []interface{}) ([]interface{}, []interface{}) { + var added []interface{} + var removed []interface{} + // added in slice2 + for _, elem := range new { + if !act.contains(old, elem) { + added = append(added, elem) + } + } + // removed in slice2 + for _, elem := range old { + if !act.contains(new, elem) { + removed = append(removed, elem) + } + } + return added, removed +} + +func (act ActionStateToMetaState) loadWorkItemBoardsBySpaceID(spaceID uuid.UUID) ([]*workitem.Board, error) { + space, err := act.Db.Spaces().Load(act.Ctx, spaceID) + if err != nil { + return nil, errs.Wrap(err, "error loading space") + } + boards, err := act.Db.Boards().List(act.Ctx, space.SpaceTemplateID) + if err != nil { + return nil, errs.Wrap(err, "error loading work item type") + } + return boards, nil +} + +func (act ActionStateToMetaState) loadWorkItemByID(id uuid.UUID) (*workitem.WorkItem, error) { + wi, err := act.Db.WorkItems().LoadByID(act.Ctx, id) + if err != nil { + return nil, errs.Wrap(err, "error loading work item") + } + return wi, nil +} + +func (act ActionStateToMetaState) storeWorkItem(workitem *workitem.WorkItem) (*workitem.WorkItem, error) { + err := application.Transactional(act.Db, func(appl application.Application) error { + var err error + workitem, _, err = appl.WorkItems().Save(act.Ctx, workitem.SpaceID, *workitem, *act.UserID) + if err != nil { + return errs.Wrap(err, "error updating work item") + } + return nil + }) + if err != nil { + return nil, err + } + return workitem, nil +} + +func (act ActionStateToMetaState) getValueListFromEnumField(wit workitem.WorkItemType, fieldName string) ([]interface{}, error) { + enumFieldType := wit.Fields[fieldName].Type + switch t := enumFieldType.(type) { + case workitem.EnumType: + return t.Values, nil + } + return nil, errs.New("given field on workitemtype " + wit.ID.String() + " is not an enum field: " + fieldName) +} + +// getStateToMetastateMap returns the mapping from state to metastate values read from the template. +func (act ActionStateToMetaState) getStateToMetastateMap(workitemTypeID uuid.UUID) (map[string]string, error) { + wit, err := act.Db.WorkItemTypes().Load(act.Ctx, workitemTypeID) + if err != nil { + return nil, err + } + stateList, err := act.getValueListFromEnumField(*wit, workitem.SystemState) + if err != nil { + return nil, err + } + metastateList, err := act.getValueListFromEnumField(*wit, workitem.SystemMetaState) + if err != nil { + return nil, err + } + if len(stateList) != len(metastateList) { + return nil, errs.Errorf("inconsistent number of states and metatstates in the current work item type (must be equal): %d states != %d metastates", len(stateList), len(metastateList)) + } + stateToMetastateMap := make(map[string]string) + for idx := range stateList { + thisState, ok := stateList[idx].(string) + if !ok { + return nil, errs.New("state value in value list is not of type string") + } + thisMetastate, ok := metastateList[idx].(string) + if !ok { + return nil, errs.New("metastate value in value list is not of type string") + } + // only the first state<->metatstate mapping needs to be taken as + // per definition. So we're only adding a new entry here if there + // is not an entry already existing. + if _, ok := stateToMetastateMap[thisState]; !ok { + stateToMetastateMap[thisState] = thisMetastate + } + } + return stateToMetastateMap, nil +} + +// getMetastateToStateMap returns the mapping from metastate to state values read from the template. +func (act ActionStateToMetaState) getMetastateToStateMap(workitemTypeID uuid.UUID) (map[string]string, error) { + stateToMetastate, err := act.getStateToMetastateMap(workitemTypeID) + if err != nil { + return nil, err + } + metastateToStateMap := make(map[string]string) + for state, metastate := range stateToMetastate { + // this is important: we only add a new entry if there + // is not an entry already existing. Therefore, we're only + // using the first mapping, satisfying the req for getting the + // first matching state for a metastate. + if _, ok := metastateToStateMap[metastate]; !ok { + metastateToStateMap[metastate] = state + } + } + return metastateToStateMap, nil +} + +func (act ActionStateToMetaState) addOrUpdateChange(changes change.Set, attributeName string, oldValue interface{}, newValue interface{}) change.Set { + for _, change := range changes { + if change.AttributeName == attributeName { + change.NewValue = newValue + return changes + } + } + newChanges := append(changes, change.Change{ + AttributeName: attributeName, + OldValue: oldValue, + NewValue: newValue, + }) + return newChanges +} + +func (act ActionStateToMetaState) fuseChanges(c1 change.Set, c2 change.Set) change.Set { + for _, change := range c2 { + c1 = act.addOrUpdateChange(c1, change.AttributeName, change.OldValue, change.NewValue) + } + return c1 +} + +// OnChange executes the action rule. It implements rules.Action. Returns the Work Item with eventual changes applied. +func (act ActionStateToMetaState) OnChange(newContext change.Detector, contextChanges change.Set, configuration string, actionChanges change.Set) (change.Detector, change.Set, error) { + if act.Ctx == nil { + return nil, nil, errs.New("context is nil") + } + if act.Db == nil { + return nil, nil, errs.New("database is nil") + } + if act.UserID == nil { + return nil, nil, errs.New("userID is nil") + } + if len(contextChanges) == 0 { + // no changes, just return what we have. + return newContext, actionChanges, nil + } + // if we have multiple changes, this iterates over them and cherrypicks, fusing the results together. + var err error + var executionChanges change.Set + for _, change := range contextChanges { + if change.AttributeName == workitem.SystemState { + newContext, executionChanges, err = act.onStateChange(newContext, contextChanges, configuration, actionChanges) + } + if change.AttributeName == workitem.SystemBoardcolumns { + newContext, executionChanges, err = act.onBoardColumnsChange(newContext, contextChanges, configuration, actionChanges) + } + if err != nil { + return nil, nil, err + } + actionChanges = act.fuseChanges(actionChanges, executionChanges) + } + // return the result + return newContext, actionChanges, nil +} + +// onBoardColumnsChange is executed when the columns change. It eventually updates the metastate and the state. Returns the Work Item with eventual changes applied. +func (act ActionStateToMetaState) onBoardColumnsChange(newContext change.Detector, contextChanges change.Set, configuration string, actionChanges change.Set) (change.Detector, change.Set, error) { + // we already assume that the rule applies, this needs to be checked in the controller. + // there is no additional check on the rule key. + wi, ok := newContext.(workitem.WorkItem) + if !ok { + return nil, nil, errs.New("given context is not a WorkItem instance") + } + // extract columns that changed from oldValue newValue + var columnsAdded []interface{} + for _, change := range contextChanges { + if change.AttributeName == workitem.SystemBoardcolumns { + var oldValue []interface{} + oldValue, ok := change.OldValue.([]interface{}) + if !ok && change.OldValue != nil { + // OldValue may be nil, so only throw error when non-nil and + // can not convert. + return nil, nil, errs.New("error converting oldValue set") + } + newValue, ok := change.NewValue.([]interface{}) + if !ok { + return nil, nil, errs.New("error converting newValue set") + } + columnsAdded, _ = act.difference(oldValue, newValue) + } + } + // from here on, we ignore the removed columns as a possible metastate transition is + // only happening on *adding* a new column. Removing column does not trigger a change. + if len(columnsAdded) == 0 { + // somehow, no actual changes on the columns. + return newContext, actionChanges, nil + } + // get the mapping. + mapping, err := act.getMetastateToStateMap(wi.Type) + if err != nil { + return nil, nil, err + } + // create a dirty flag. Note that we can not use len(actionChanges) as this + // may contain previous changes from the action chain. + wiDirty := false + var changes change.Set + // go over all added columns. We support multiple added columns at once. + for _, columnID := range columnsAdded { + // get board and column by columnID. + var thisColumn workitem.BoardColumn + boards, err := act.loadWorkItemBoardsBySpaceID(wi.SpaceID) + if err != nil { + return nil, nil, err + } + for _, board := range boards { + for _, column := range board.Columns { + if columnID == column.ID.String() { + thisColumn = column + } + } + } + // at this point, we don't check if the board was + // relevant (matching the type group) as the move into + // the column has already happened. We just make sure + // this rule applies to the column. + if thisColumn.TransRuleKey != ActionKeyStateToMetastate { + // this is a column that does not apply to the rule, we don't apply here. + return newContext, actionChanges, nil + } + // unmarshall the configuration. + config := map[string]string{} + err = json.Unmarshal([]byte(thisColumn.TransRuleArgument), &config) + if err != nil { + return nil, nil, err + } + // extract the column's metastate config. + if metaState, ok := config[ActionKeyStateToMetastateConfigMetastate]; ok { + if metaState == wi.Fields[workitem.SystemMetaState] { + // the WIs metastate is already the same as the columns + // metastate, so nothing to do. + return newContext, actionChanges, nil + } + // the metatstate changes, so set it on the WI. + changes = act.addOrUpdateChange(changes, workitem.SystemMetaState, wi.Fields[workitem.SystemMetaState], metaState) + wi.Fields[workitem.SystemMetaState] = metaState + wiDirty = true + // next, check if the state needs to change as well from the metastate. + if wi.Fields[workitem.SystemState] != mapping[metaState] { + // yes, the state changes as well. + changes = act.addOrUpdateChange(changes, workitem.SystemState, wi.Fields[workitem.SystemState], mapping[metaState]) + wi.Fields[workitem.SystemState] = mapping[metaState] + } + } + } + // finally, store the new work item state if something changed. + if wiDirty { + result, err := act.storeWorkItem(&wi) + if err != nil { + return nil, nil, err + } + // return to sender + return *result, changes, nil + } + // return to sender + return wi, changes, nil +} + +// onStateChange is executed when the state changes. It eventually updates the metastate and the boardcolumns. Returns the Work Item with eventual changes applied. +func (act ActionStateToMetaState) onStateChange(newContext change.Detector, contextChanges change.Set, configuration string, actionChanges change.Set) (change.Detector, change.Set, error) { + wi, ok := newContext.(workitem.WorkItem) + if !ok { + return nil, nil, errs.New("given context is not a WorkItem instance") + } + // get the mapping. + mapping, err := act.getStateToMetastateMap(wi.Type) + if err != nil { + return nil, nil, err + } + // update the workitem accordingly. + wiState := wi.Fields[workitem.SystemState].(string) + if wi.Fields[workitem.SystemMetaState] == mapping[wiState] { + // metastate remains stable, nothing to do. + return newContext, actionChanges, nil + } + // otherwise, update the metastate from the state. + changes := act.addOrUpdateChange(actionChanges, workitem.SystemMetaState, wi.Fields[workitem.SystemMetaState], mapping[wiState]) + wi.Fields[workitem.SystemMetaState] = mapping[wiState] + // next, get the columns of the workitem and see if these needs to be updated. + boards, err := act.loadWorkItemBoardsBySpaceID(wi.SpaceID) + if err != nil { + return nil, nil, err + } + // next, check which boards are relevant for this WI. + space, err := act.Db.Spaces().Load(act.Ctx, wi.SpaceID) + if err != nil { + return nil, nil, errs.Wrap(err, "error loading space") + } + groups, err := act.Db.WorkItemTypeGroups().List(act.Ctx, space.SpaceTemplateID) + if err != nil { + return nil, nil, errs.Wrap(err, "error loading type groups") + } + var relevantBoards []*workitem.Board + for _, board := range boards { + // this rule is only dealing with TypeLevelContext boards right now + // this may need to be extended when we allow other boards. + if board.ContextType == "TypeLevelContext" { + // now check if the type level in the Context includes the current WIs type + thisBoardContext, err := uuid.FromString(board.Context) + if err != nil { + return nil, nil, err + } + for _, group := range groups { + var typeListSlice id.Slice = group.TypeList + if group.ID == thisBoardContext && typeListSlice.Contains(wi.Type) { + // this board is relevant. + relevantBoards = append(relevantBoards, board) + } + } + } + } + // next, iterate over all relevant boards, checking their rule config + // and update the WI position accordingly. + var systemBoardColumns []interface{} + systemBoardColumns, ok = wi.Fields[workitem.SystemBoardcolumns].([]interface{}) + if !ok && wi.Fields[workitem.SystemBoardcolumns] != nil { + // wi.Fields[workitem.SystemBoardcolumns] may be empty, so we do a fallback. + return nil, nil, errs.New("type conversion failed for boardcolumns") + } + oldColumnsConfig := make([]interface{}, len(systemBoardColumns)) + copy(oldColumnsConfig, systemBoardColumns) + columnsChanged := false + for _, board := range relevantBoards { + // each WI can only be in exactly one columns on each board. + // we apply the first column that matches. If that happens, we + // flip alreadyPlacedInColumn and all subsequent matching columns + // are non-matching. + alreadyPlacedInColumn := false + for _, column := range board.Columns { + columnRuleKey := column.TransRuleKey + columnRuleConfig := column.TransRuleArgument + if columnRuleKey == ActionKeyStateToMetastate { + // unmarshall the configuration. + config := map[string]string{} + err := json.Unmarshal([]byte(columnRuleConfig), &config) + if err != nil { + return nil, nil, err + } + if metaState, ok := config[ActionKeyStateToMetastateConfigMetastate]; ok { + if metaState == wi.Fields[workitem.SystemMetaState] && !alreadyPlacedInColumn { + // the column config matches the *new* metastate, so the WI needs to + // appear in this column. + var currentSystemBoardColumn []interface{} + currentSystemBoardColumn, ok = wi.Fields[workitem.SystemBoardcolumns].([]interface{}) + // flip alreadyPlacedInColumn, so this will be the new column. Other + // matching columns are ignored on this board. + alreadyPlacedInColumn = true + if !ok && wi.Fields[workitem.SystemBoardcolumns] != nil { + // again, wi.Fields[workitem.SystemBoardcolumns] may be empty, so we + // only fail here when the conversion fails AND the slice is non nil. + return nil, nil, errs.New("error converting SystemBoardcolumns set") + } + if !act.contains(currentSystemBoardColumn, column.ID.String()) { + wi.Fields[workitem.SystemBoardcolumns] = append(currentSystemBoardColumn, column.ID.String()) + } + columnsChanged = true + } else { + // the column *does not* match the *new* metastate, so the column has to + // be removed from the WIs columns. Note that we can't just remove all + // entries in wi.Fields[workitem.SystemBoardcolumns] as there may be + // other columns from non-relevant boards in it that need to be left + // untouched. + var currentSystemBoardColumn []interface{} + currentSystemBoardColumn, ok = wi.Fields[workitem.SystemBoardcolumns].([]interface{}) + if !ok && wi.Fields[workitem.SystemBoardcolumns] != nil { + // again, wi.Fields[workitem.SystemBoardcolumns] may be empty, so we + // only fail here when the conversion fails AND the slice is non nil. + return nil, nil, errs.New("error converting SystemBoardcolumns set") + } + wi.Fields[workitem.SystemBoardcolumns] = act.removeElement(currentSystemBoardColumn, column.ID.String()) + columnsChanged = true + } + } else { + return nil, nil, errs.New("invalid configuration for transRuleKey '" + ActionKeyStateToMetastate + "': " + columnRuleConfig) + } + } + } + } + // if the column set has changed, create an entry for the change set. + if columnsChanged { + changes = act.addOrUpdateChange(changes, workitem.SystemBoardcolumns, oldColumnsConfig, wi.Fields[workitem.SystemBoardcolumns]) + } + // finally, store the new work item state if something changed. + result, err := act.storeWorkItem(&wi) + if err != nil { + return nil, nil, err + } + // and return to sender. + return *result, changes, nil +} diff --git a/actions/rules/action_state_to_metastate_test.go b/actions/rules/action_state_to_metastate_test.go new file mode 100644 index 0000000000..1f7bed8904 --- /dev/null +++ b/actions/rules/action_state_to_metastate_test.go @@ -0,0 +1,399 @@ +package rules + +import ( + "testing" + + "github.com/fabric8-services/fabric8-wit/actions/change" + "github.com/fabric8-services/fabric8-wit/resource" + "github.com/fabric8-services/fabric8-wit/workitem" + + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "github.com/fabric8-services/fabric8-wit/gormtestsupport" + tf "github.com/fabric8-services/fabric8-wit/test/testfixture" +) + +func TestSuiteActionStateToMetastate(t *testing.T) { + resource.Require(t, resource.Database) + suite.Run(t, &ActionStateToMetastateSuite{DBTestSuite: gormtestsupport.NewDBTestSuite()}) +} + +type ActionStateToMetastateSuite struct { + gormtestsupport.DBTestSuite +} + +func (s *ActionStateToMetastateSuite) TestContainsElement() { + s.T().Run("contains an element", func(t *testing.T) { + action := ActionStateToMetaState{} + a := []interface{}{0, 1, 2, 3, 2} + require.True(t, action.contains(a, 2)) + require.True(t, action.contains(a, 3)) + require.True(t, action.contains(a, 0)) + }) + s.T().Run("not contains an element", func(t *testing.T) { + action := ActionStateToMetaState{} + a := []interface{}{0, 1, 2, 3, 2} + require.False(t, action.contains(a, 4)) + require.False(t, action.contains(a, nil)) + require.False(t, action.contains(a, "foo")) + }) +} + +func (s *ActionStateToMetastateSuite) TestRemoveElement() { + s.T().Run("removing an existing element", func(t *testing.T) { + a := []interface{}{0, 1, 2, 3, 2} + a = ActionStateToMetaState{}.removeElement(a, 1) + expected := []interface{}{0, 2, 3, 2} + require.Len(t, a, 4) + require.Equal(t, expected, a) + a = ActionStateToMetaState{}.removeElement(a, 3) + expected = []interface{}{0, 2, 2} + require.Len(t, a, 3) + require.Equal(t, expected, a) + }) + s.T().Run("removing a non-existing element", func(t *testing.T) { + a := []interface{}{0, 1, 2, 3, 2} + a = ActionStateToMetaState{}.removeElement(a, 4) + require.Len(t, a, 5) + expected := []interface{}{0, 1, 2, 3, 2} + require.Equal(t, expected, a) + }) + s.T().Run("removing a duplicate element", func(t *testing.T) { + a := []interface{}{0, 1, 2, 3, 2} + a = ActionStateToMetaState{}.removeElement(a, 2) + expected := []interface{}{0, 1, 3} + require.Len(t, a, 3) + require.Equal(t, expected, a) + }) +} + +func (s *ActionStateToMetastateSuite) TestDifference() { + s.T().Run("finding differences", func(t *testing.T) { + a := []interface{}{0, 1, 2, 3, 2} + b := []interface{}{2, 3, 5} + added, removed := ActionStateToMetaState{}.difference(a, b) + require.Len(t, added, 1) + require.Len(t, removed, 2) + // wasting plenty more memory here + var expectedAdded []interface{} + expectedAdded = append(expectedAdded, 5) + var expectedRemoved []interface{} + expectedRemoved = append(expectedRemoved, 0) + expectedRemoved = append(expectedRemoved, 1) + require.Equal(t, added, expectedAdded) + require.Equal(t, removed, expectedRemoved) + }) +} + +func (s *ActionStateToMetastateSuite) TestActionExecution() { + // Note on the fixture: by default, the created board is attached to the type group + // with the same index. The columns on each board are as follows: + // 0 "New" "mNew" + // 1 "In Progress" "mInprogress" + // 2 "Resolved" "mResolved" + // 3 "Approved" "mResolved" + // All columns are set to the "BidirectionalStateToColumn" rule. The type has + // the following states/metastates: + // "new" "mNew" + // "open" "mOpen" + // "in progress" "mInprogress" + // "resolved" "mResolved" + // "closed" "mClosed" + fxtFn := func(t *testing.T) *tf.TestFixture { + // this sets up a work item in state "new" with matching metastate "mNew" and the corresponding column 0 ("New") + // this represents a single work item in an ordered "new" state. + return tf.NewTestFixture(t, s.DB, tf.CreateWorkItemEnvironment(), tf.WorkItemBoards(1), tf.WorkItems(1, func(fxt *tf.TestFixture, idx int) error { + fxt.WorkItems[idx].Fields[workitem.SystemState] = workitem.SystemStateNew + fxt.WorkItems[idx].Fields[workitem.SystemMetaState] = "mNew" + fxt.WorkItems[idx].Fields[workitem.SystemBoardcolumns] = []string{ + fxt.WorkItemBoards[idx].Columns[0].ID.String(), + } + return nil + })) + } + // test the fixture creation. + fxt := fxtFn(s.T()) + require.NotNil(s.T(), fxt) + require.Len(s.T(), fxt.WorkItems, 1) + require.Equal(s.T(), "mNew", fxt.WorkItems[0].Fields[workitem.SystemMetaState]) + require.Equal(s.T(), workitem.SystemStateNew, fxt.WorkItems[0].Fields[workitem.SystemState]) + require.Equal(s.T(), fxt.WorkItemBoards[0].Columns[0].ID.String(), fxt.WorkItems[0].Fields[workitem.SystemBoardcolumns].([]interface{})[0]) + + s.T().Run("updating the state for an existing work item", func(t *testing.T) { + fxt := fxtFn(t) + // set the state to "in progress" and create a changeset. + fxt.WorkItems[0].Fields[workitem.SystemState] = workitem.SystemStateInProgress + contextChanges := change.Set{ + { + AttributeName: workitem.SystemState, + OldValue: workitem.SystemStateNew, + NewValue: workitem.SystemStateInProgress, + }, + } + // run the test. + action := ActionStateToMetaState{ + Db: s.GormDB, + Ctx: s.Ctx, + UserID: &fxt.Identities[0].ID, + } + convertChanges := change.Set{} + // note: the rule does not use the explicit configuration, but reads from the template. + afterActionWI, convertChanges, err := action.OnChange(*fxt.WorkItems[0], contextChanges, "", convertChanges) + require.NoError(t, err) + require.Len(t, convertChanges, 2) + // check metastate validity. + require.Equal(t, workitem.SystemMetaState, convertChanges[0].AttributeName) + require.Equal(t, "mNew", convertChanges[0].OldValue) + require.Equal(t, "mInprogress", convertChanges[0].NewValue) + require.Equal(t, "mInprogress", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + // check column validity. + require.Equal(t, workitem.SystemBoardcolumns, convertChanges[1].AttributeName) + require.Len(t, convertChanges[1].OldValue, 1) + require.Equal(t, convertChanges[1].OldValue.([]interface{})[0], fxt.WorkItemBoards[0].Columns[0].ID.String()) + require.Equal(t, convertChanges[1].NewValue.([]interface{})[0], fxt.WorkItemBoards[0].Columns[1].ID.String()) + require.Equal(t, "mInprogress", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + require.Len(t, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemBoardcolumns].([]interface{}), 1) + require.Equal(t, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemBoardcolumns].([]interface{})[0], fxt.WorkItemBoards[0].Columns[1].ID.String()) + }) + + s.T().Run("updating the state for a vanilla work item", func(t *testing.T) { + fxt := fxtFn(t) + // this should be a vanilla work item, where metastate and boardcolumns is nil + delete(fxt.WorkItems[0].Fields, workitem.SystemMetaState) + delete(fxt.WorkItems[0].Fields, workitem.SystemBoardcolumns) + // set the state to "in progress" and create a changeset. + fxt.WorkItems[0].Fields[workitem.SystemState] = workitem.SystemStateInProgress + contextChanges := change.Set{ + { + AttributeName: workitem.SystemState, + OldValue: nil, + NewValue: workitem.SystemStateInProgress, + }, + } + // run the test. + action := ActionStateToMetaState{ + Db: s.GormDB, + Ctx: s.Ctx, + UserID: &fxt.Identities[0].ID, + } + convertChanges := change.Set{} + // note: the rule does not use the explicit configuration, but reads from the template. + afterActionWI, convertChanges, err := action.OnChange(*fxt.WorkItems[0], contextChanges, "", convertChanges) + require.NoError(t, err) + require.Len(t, convertChanges, 2) + // check metastate validity. + require.Equal(t, workitem.SystemMetaState, convertChanges[0].AttributeName) + require.Nil(t, convertChanges[0].OldValue) + require.Equal(t, "mInprogress", convertChanges[0].NewValue) + require.Equal(t, "mInprogress", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + // check column validity. + require.Equal(t, workitem.SystemBoardcolumns, convertChanges[1].AttributeName) + require.Empty(t, convertChanges[1].OldValue) + require.Equal(t, fxt.WorkItemBoards[0].Columns[1].ID.String(), convertChanges[1].NewValue.([]interface{})[0]) + require.Equal(t, "mInprogress", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + require.Len(t, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemBoardcolumns].([]interface{}), 1) + require.Equal(t, fxt.WorkItemBoards[0].Columns[1].ID.String(), afterActionWI.(workitem.WorkItem).Fields[workitem.SystemBoardcolumns].([]interface{})[0]) + }) + + s.T().Run("updating multiple attributes and state", func(t *testing.T) { + fxt := fxtFn(t) + // this should be a vanilla work item, where metastate and boardcolumns is nil + delete(fxt.WorkItems[0].Fields, workitem.SystemMetaState) + delete(fxt.WorkItems[0].Fields, workitem.SystemBoardcolumns) + // set the state to "in progress" and create a changeset. + fxt.WorkItems[0].Fields[workitem.SystemState] = workitem.SystemStateInProgress + fxt.WorkItems[0].Fields[workitem.SystemTitle] = "Updated Title" + contextChanges := change.Set{ + { + AttributeName: workitem.SystemTitle, + OldValue: nil, + NewValue: "Updated Title", + }, + { + AttributeName: workitem.SystemState, + OldValue: nil, + NewValue: workitem.SystemStateInProgress, + }, + } + // run the test. + action := ActionStateToMetaState{ + Db: s.GormDB, + Ctx: s.Ctx, + UserID: &fxt.Identities[0].ID, + } + convertChanges := change.Set{} + // note: the rule does not use the explicit configuration, but reads from the template. + afterActionWI, convertChanges, err := action.OnChange(*fxt.WorkItems[0], contextChanges, "", convertChanges) + require.NoError(t, err) + require.Len(t, convertChanges, 2) + // check metastate validity. + require.Equal(t, workitem.SystemMetaState, convertChanges[0].AttributeName) + require.Nil(t, convertChanges[0].OldValue) + require.Equal(t, "mInprogress", convertChanges[0].NewValue) + require.Equal(t, "mInprogress", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + // check column validity. + require.Equal(t, workitem.SystemBoardcolumns, convertChanges[1].AttributeName) + require.Empty(t, convertChanges[1].OldValue) + require.Equal(t, fxt.WorkItemBoards[0].Columns[1].ID.String(), convertChanges[1].NewValue.([]interface{})[0]) + require.Equal(t, "mInprogress", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + require.Len(t, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemBoardcolumns].([]interface{}), 1) + require.Equal(t, fxt.WorkItemBoards[0].Columns[1].ID.String(), afterActionWI.(workitem.WorkItem).Fields[workitem.SystemBoardcolumns].([]interface{})[0]) + }) + + s.T().Run("updating the state for a work item with multiple metastate mappings on columns", func(t *testing.T) { + fxt := fxtFn(t) + // this should be a vanilla work item, where metastate and boardcolumns is nil + delete(fxt.WorkItems[0].Fields, workitem.SystemMetaState) + delete(fxt.WorkItems[0].Fields, workitem.SystemBoardcolumns) + // set the state to "resolved" and create a changeset. + fxt.WorkItems[0].Fields[workitem.SystemState] = workitem.SystemStateResolved + contextChanges := change.Set{ + { + AttributeName: workitem.SystemState, + OldValue: nil, + NewValue: workitem.SystemStateResolved, + }, + } + // run the test. + action := ActionStateToMetaState{ + Db: s.GormDB, + Ctx: s.Ctx, + UserID: &fxt.Identities[0].ID, + } + convertChanges := change.Set{} + // note: the rule does not use the explicit configuration, but reads from the template. + afterActionWI, convertChanges, err := action.OnChange(*fxt.WorkItems[0], contextChanges, "", convertChanges) + require.NoError(t, err) + require.Len(t, convertChanges, 2) + // check metastate validity. + require.Equal(t, workitem.SystemMetaState, convertChanges[0].AttributeName) + require.Nil(t, convertChanges[0].OldValue) + require.Equal(t, "mResolved", convertChanges[0].NewValue) + require.Equal(t, "mResolved", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + // check column validity. For the resolved state, two columns are matching, + // but only the first one (column 2) should be used and available in the WI. + require.Equal(t, workitem.SystemBoardcolumns, convertChanges[1].AttributeName) + require.Empty(t, convertChanges[1].OldValue) + require.Equal(t, convertChanges[1].NewValue.([]interface{})[0], fxt.WorkItemBoards[0].Columns[2].ID.String()) + require.Equal(t, "mResolved", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + require.Len(t, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemBoardcolumns].([]interface{}), 1) + require.Equal(t, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemBoardcolumns].([]interface{})[0], fxt.WorkItemBoards[0].Columns[2].ID.String()) + }) + + s.T().Run("updating the columns for an existing work item", func(t *testing.T) { + fxt := fxtFn(t) + // set the column to the "in progress" column and create a changeset. + contextChanges := change.Set{ + { + AttributeName: workitem.SystemBoardcolumns, + OldValue: fxt.WorkItems[0].Fields[workitem.SystemBoardcolumns], + NewValue: []interface{}{fxt.WorkItemBoards[0].Columns[1].ID.String()}, + }, + } + fxt.WorkItems[0].Fields[workitem.SystemBoardcolumns] = []interface{}{fxt.WorkItemBoards[0].Columns[1].ID.String()} + // run the test. + action := ActionStateToMetaState{ + Db: s.GormDB, + Ctx: s.Ctx, + UserID: &fxt.Identities[0].ID, + } + convertChanges := change.Set{} + // note: the rule does not use the explicit configuration, but reads from the template. + afterActionWI, convertChanges, err := action.OnChange(*fxt.WorkItems[0], contextChanges, "", convertChanges) + require.NoError(t, err) + require.Len(t, convertChanges, 2) + // check metastate validity. + require.Equal(t, workitem.SystemMetaState, convertChanges[0].AttributeName) + require.Equal(t, "mNew", convertChanges[0].OldValue) + require.Equal(t, "mInprogress", convertChanges[0].NewValue) + require.Equal(t, "mInprogress", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + // check state validity. + require.Equal(t, workitem.SystemState, convertChanges[1].AttributeName) + require.Equal(t, workitem.SystemStateNew, convertChanges[1].OldValue) + require.Equal(t, workitem.SystemStateInProgress, convertChanges[1].NewValue) + require.Equal(t, workitem.SystemStateInProgress, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemState]) + }) + + s.T().Run("updating the state and columns for an existing work item", func(t *testing.T) { + fxt := fxtFn(t) + contextChanges := change.Set{ + { + AttributeName: workitem.SystemState, + OldValue: fxt.WorkItems[0].Fields[workitem.SystemState], + NewValue: workitem.SystemStateResolved, + }, + { + AttributeName: workitem.SystemBoardcolumns, + OldValue: fxt.WorkItems[0].Fields[workitem.SystemBoardcolumns], + NewValue: []interface{}{fxt.WorkItemBoards[0].Columns[2].ID.String()}, + }, + } + // set the state + fxt.WorkItems[0].Fields[workitem.SystemState] = workitem.SystemStateResolved + // set the column to the "resolved" column and create a changeset. + fxt.WorkItems[0].Fields[workitem.SystemBoardcolumns] = []interface{}{fxt.WorkItemBoards[0].Columns[2].ID.String()} + // run the test. + action := ActionStateToMetaState{ + Db: s.GormDB, + Ctx: s.Ctx, + UserID: &fxt.Identities[0].ID, + } + convertChanges := change.Set{} + // note: the rule does not use the explicit configuration, but reads from the template. + afterActionWI, convertChanges, err := action.OnChange(*fxt.WorkItems[0], contextChanges, "", convertChanges) + require.NoError(t, err) + require.Len(t, convertChanges, 2) + // check metastate validity. + require.Equal(t, workitem.SystemMetaState, convertChanges[0].AttributeName) + require.Equal(t, "mNew", convertChanges[0].OldValue) + require.Equal(t, "mResolved", convertChanges[0].NewValue) + require.Equal(t, "mResolved", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + // check column validity. For the resolved state, two columns are matching, + // but only the first one (column 2) should be used and available in the WI. + require.Equal(t, workitem.SystemBoardcolumns, convertChanges[1].AttributeName) + require.Equal(t, []interface{}{fxt.WorkItemBoards[0].Columns[2].ID.String()}, convertChanges[1].OldValue) + require.Equal(t, convertChanges[1].NewValue.([]interface{})[0], fxt.WorkItemBoards[0].Columns[2].ID.String()) + require.Equal(t, "mResolved", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + require.Len(t, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemBoardcolumns].([]interface{}), 1) + require.Equal(t, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemBoardcolumns].([]interface{})[0], fxt.WorkItemBoards[0].Columns[2].ID.String()) + // check state validity. + require.Equal(t, workitem.SystemStateResolved, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemState]) + }) + + s.T().Run("updating the columns for a vanilla work item", func(t *testing.T) { + fxt := fxtFn(t) + // set the column to the "in progress" column and create a changeset. + contextChanges := change.Set{ + { + AttributeName: workitem.SystemBoardcolumns, + OldValue: nil, + NewValue: []interface{}{fxt.WorkItemBoards[0].Columns[1].ID.String()}, + }, + } + delete(fxt.WorkItems[0].Fields, workitem.SystemMetaState) + fxt.WorkItems[0].Fields[workitem.SystemBoardcolumns] = []interface{}{fxt.WorkItemBoards[0].Columns[1].ID.String()} + // run the test. + action := ActionStateToMetaState{ + Db: s.GormDB, + Ctx: s.Ctx, + UserID: &fxt.Identities[0].ID, + } + convertChanges := change.Set{} + // note: the rule does not use the explicit configuration, but reads from the template. + afterActionWI, convertChanges, err := action.OnChange(*fxt.WorkItems[0], contextChanges, "", convertChanges) + require.NoError(t, err) + require.Len(t, convertChanges, 2) + // check metastate validity. + require.Equal(t, workitem.SystemMetaState, convertChanges[0].AttributeName) + require.Nil(t, convertChanges[0].OldValue) + require.Equal(t, "mInprogress", convertChanges[0].NewValue) + require.Equal(t, "mInprogress", afterActionWI.(workitem.WorkItem).Fields[workitem.SystemMetaState]) + // check state validity. + require.Equal(t, workitem.SystemState, convertChanges[1].AttributeName) + require.Equal(t, workitem.SystemStateNew, convertChanges[1].OldValue) + require.Equal(t, workitem.SystemStateInProgress, convertChanges[1].NewValue) + require.Equal(t, workitem.SystemStateInProgress, afterActionWI.(workitem.WorkItem).Fields[workitem.SystemState]) + }) + +} diff --git a/controller/test-files/search/show/filter_assignee_null_show_after_update_work_item.golden.json b/controller/test-files/search/show/filter_assignee_null_show_after_update_work_item.golden.json index 01d5c09f1a..c23796d711 100755 --- a/controller/test-files/search/show/filter_assignee_null_show_after_update_work_item.golden.json +++ b/controller/test-files/search/show/filter_assignee_null_show_after_update_work_item.golden.json @@ -5,7 +5,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestUpdateWorkItem.func1 in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestUpdateWorkItem.func1 in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/filter_assignee_null_update_work_item.golden.json b/controller/test-files/search/show/filter_assignee_null_update_work_item.golden.json index 01d5c09f1a..c23796d711 100755 --- a/controller/test-files/search/show/filter_assignee_null_update_work_item.golden.json +++ b/controller/test-files/search/show/filter_assignee_null_update_work_item.golden.json @@ -5,7 +5,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestUpdateWorkItem.func1 in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestUpdateWorkItem.func1 in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/filter_label_null_show_after_update_work_item.golden.json b/controller/test-files/search/show/filter_label_null_show_after_update_work_item.golden.json index ffec56bce0..b19ad0b53b 100755 --- a/controller/test-files/search/show/filter_label_null_show_after_update_work_item.golden.json +++ b/controller/test-files/search/show/filter_label_null_show_after_update_work_item.golden.json @@ -5,7 +5,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestUpdateWorkItem.func2 in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestUpdateWorkItem.func2 in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/filter_label_null_update_work_item.golden.json b/controller/test-files/search/show/filter_label_null_update_work_item.golden.json index ffec56bce0..b19ad0b53b 100755 --- a/controller/test-files/search/show/filter_label_null_update_work_item.golden.json +++ b/controller/test-files/search/show/filter_label_null_update_work_item.golden.json @@ -5,7 +5,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestUpdateWorkItem.func2 in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestUpdateWorkItem.func2 in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C-D_and_B-E_search_for_B_and_C/do_not_include_children.res.payload.golden.json b/controller/test-files/search/show/in_topology_A-B-C-D_and_B-E_search_for_B_and_C/do_not_include_children.res.payload.golden.json index 0bb4eb8759..0ce950720f 100755 --- a/controller/test-files/search/show/in_topology_A-B-C-D_and_B-E_search_for_B_and_C/do_not_include_children.res.payload.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C-D_and_B-E_search_for_B_and_C/do_not_include_children.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, @@ -93,7 +93,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 3, "system.order": 3000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C-D_and_B-E_search_for_B_and_C/include_children.res.payload.golden.json b/controller/test-files/search/show/in_topology_A-B-C-D_and_B-E_search_for_B_and_C/include_children.res.payload.golden.json index 60f2cc2905..66bb7e70ca 100755 --- a/controller/test-files/search/show/in_topology_A-B-C-D_and_B-E_search_for_B_and_C/include_children.res.payload.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C-D_and_B-E_search_for_B_and_C/include_children.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, @@ -98,7 +98,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 3, "system.order": 3000, "system.remote_item_id": null, @@ -192,7 +192,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, @@ -279,7 +279,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedChildren in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 5, "system.order": 5000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/A_with_tree-view=false.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/A_with_tree-view=false.res.golden.json index 9e8d8a0a29..82908d9d40 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/A_with_tree-view=false.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/A_with_tree-view=false.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/A_with_tree-view=true.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/A_with_tree-view=true.res.golden.json index 3e96ed5167..1c340dc748 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/A_with_tree-view=true.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/A_with_tree-view=true.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B,C_with_tree-view=false.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B,C_with_tree-view=false.res.golden.json index 564a93f779..440547f9dd 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B,C_with_tree-view=false.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B,C_with_tree-view=false.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, @@ -93,7 +93,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 3, "system.order": 3000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B,C_with_tree-view=true.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B,C_with_tree-view=true.res.golden.json index 4970cc7882..e57004b6b8 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B,C_with_tree-view=true.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B,C_with_tree-view=true.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, @@ -98,7 +98,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 3, "system.order": 3000, "system.remote_item_id": null, @@ -192,7 +192,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B_with_tree-view=false.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B_with_tree-view=false.res.golden.json index d574e19020..e254c07b88 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B_with_tree-view=false.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B_with_tree-view=false.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B_with_tree-view=true.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B_with_tree-view=true.res.golden.json index 3051c2f2f3..8c8201820f 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B_with_tree-view=true.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/B_with_tree-view=true.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, @@ -100,7 +100,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/C_with_tree-view=false.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/C_with_tree-view=false.res.golden.json index e6611d2ffa..82585813b9 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/C_with_tree-view=false.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/C_with_tree-view=false.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 3, "system.order": 3000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/C_with_tree-view=true.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/C_with_tree-view=true.res.golden.json index f57824acac..57db53f653 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/C_with_tree-view=true.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/C_with_tree-view=true.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 3, "system.order": 3000, "system.remote_item_id": null, @@ -100,7 +100,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, @@ -187,7 +187,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/D_with_tree-view=false.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/D_with_tree-view=false.res.golden.json index bedb594af6..04015f5993 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/D_with_tree-view=false.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/D_with_tree-view=false.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 4, "system.order": 4000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/D_with_tree-view=true.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/D_with_tree-view=true.res.golden.json index f4555ba16c..e0226f00b5 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/D_with_tree-view=true.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/D_with_tree-view=true.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 4, "system.order": 4000, "system.remote_item_id": null, @@ -100,7 +100,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/E_with_tree-view=false.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/E_with_tree-view=false.res.golden.json index 48c85a06d0..fd0db42528 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/E_with_tree-view=false.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/E_with_tree-view=false.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 5, "system.order": 5000, "system.remote_item_id": null, diff --git a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/E_with_tree-view=true.res.golden.json b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/E_with_tree-view=true.res.golden.json index 599861a7ac..ed07f9fb27 100755 --- a/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/E_with_tree-view=true.res.golden.json +++ b/controller/test-files/search/show/in_topology_A-B-C_and_A-D_search_for/E_with_tree-view=true.res.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*searchControllerTestSuite).TestIncludedParents in controller/search_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 5, "system.order": 5000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/list_children/ok.res.payload.golden.json b/controller/test-files/work_item/list_children/ok.res.payload.golden.json index 01ee65de26..12a22a82a0 100755 --- a/controller/test-files/work_item/list_children/ok.res.payload.golden.json +++ b/controller/test-files/work_item/list_children/ok.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemChildSuite).TestChildren.func1 in controller/work_item_children_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemChildSuite).TestChildren.func1 in controller/work_item_children_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 3, "system.order": 3000, "system.remote_item_id": null, @@ -92,7 +92,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemChildSuite).TestChildren.func1 in controller/work_item_children_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemChildSuite).TestChildren.func1 in controller/work_item_children_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/show/ok.has_children.res.payload.golden.json b/controller/test-files/work_item/show/ok.has_children.res.payload.golden.json index 65b4fccdab..6785ab0aaa 100755 --- a/controller/test-files/work_item/show/ok.has_children.res.payload.golden.json +++ b/controller/test-files/work_item/show/ok.has_children.res.payload.golden.json @@ -5,7 +5,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemChildSuite).TestChildren.func1 in controller/work_item_children_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemChildSuite).TestChildren.func1 in controller/work_item_children_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/show/ok.has_no_children.res.payload.golden.json b/controller/test-files/work_item/show/ok.has_no_children.res.payload.golden.json index 96ed63e578..5177a0a122 100755 --- a/controller/test-files/work_item/show/ok.has_no_children.res.payload.golden.json +++ b/controller/test-files/work_item/show/ok.has_no_children.res.payload.golden.json @@ -5,7 +5,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemChildSuite).TestChildren.func1 in controller/work_item_children_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemChildSuite).TestChildren.func1 in controller/work_item_children_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/area/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/area/valid_sample_1.res.payload.golden.json index 4949ccf5fc..461e119987 100755 --- a/controller/test-files/work_item/update/area/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/area/valid_sample_1.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/boardcolumn/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/boardcolumn/valid_sample_1.res.payload.golden.json index f1517bc953..1b3d392c35 100755 --- a/controller/test-files/work_item/update/boardcolumn/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/boardcolumn/valid_sample_1.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/bool/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/bool/valid_sample_1.res.payload.golden.json index f722e62669..1b02d849d5 100755 --- a/controller/test-files/work_item/update/bool/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/bool/valid_sample_1.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 3, "system.order": 3000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/codebase/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/codebase/valid_sample_1.res.payload.golden.json index 404022a274..ce288c10a2 100755 --- a/controller/test-files/work_item/update/codebase/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/codebase/valid_sample_1.res.payload.golden.json @@ -12,7 +12,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 4, "system.order": 4000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/duration/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/duration/valid_sample_1.res.payload.golden.json index 6d7a7b0333..0e205535da 100755 --- a/controller/test-files/work_item/update/duration/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/duration/valid_sample_1.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 5, "system.order": 5000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/duration/valid_sample_2.res.payload.golden.json b/controller/test-files/work_item/update/duration/valid_sample_2.res.payload.golden.json index 4cee348ec1..b69241e776 100755 --- a/controller/test-files/work_item/update/duration/valid_sample_2.res.payload.golden.json +++ b/controller/test-files/work_item/update/duration/valid_sample_2.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 5, "system.order": 5000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/float/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/float/valid_sample_1.res.payload.golden.json index c3b4705e5c..38bc1105a9 100755 --- a/controller/test-files/work_item/update/float/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/float/valid_sample_1.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 6, "system.order": 6000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/float/valid_sample_2.res.payload.golden.json b/controller/test-files/work_item/update/float/valid_sample_2.res.payload.golden.json index 0ed785aa7c..2e0997ed2d 100755 --- a/controller/test-files/work_item/update/float/valid_sample_2.res.payload.golden.json +++ b/controller/test-files/work_item/update/float/valid_sample_2.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 6, "system.order": 6000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/instant/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/instant/valid_sample_1.res.payload.golden.json index 16329bcdde..8f135e889b 100755 --- a/controller/test-files/work_item/update/instant/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/instant/valid_sample_1.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 7, "system.order": 7000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/integer/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/integer/valid_sample_1.res.payload.golden.json index 321fc3606b..5f9b8e25d0 100755 --- a/controller/test-files/work_item/update/integer/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/integer/valid_sample_1.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 8, "system.order": 8000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/integer/valid_sample_2.res.payload.golden.json b/controller/test-files/work_item/update/integer/valid_sample_2.res.payload.golden.json index 508c21dffc..2bac907d33 100755 --- a/controller/test-files/work_item/update/integer/valid_sample_2.res.payload.golden.json +++ b/controller/test-files/work_item/update/integer/valid_sample_2.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 8, "system.order": 8000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/iteration/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/iteration/valid_sample_1.res.payload.golden.json index 5522092f32..cceb663b8f 100755 --- a/controller/test-files/work_item/update/iteration/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/iteration/valid_sample_1.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 9, "system.order": 9000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/iteration/valid_sample_2.res.payload.golden.json b/controller/test-files/work_item/update/iteration/valid_sample_2.res.payload.golden.json index 2aee8b9ce7..3afd0715e0 100755 --- a/controller/test-files/work_item/update/iteration/valid_sample_2.res.payload.golden.json +++ b/controller/test-files/work_item/update/iteration/valid_sample_2.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 9, "system.order": 9000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/label/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/label/valid_sample_1.res.payload.golden.json index 6b62c2541a..32835128f9 100755 --- a/controller/test-files/work_item/update/label/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/label/valid_sample_1.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 10, "system.order": 10000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/label/valid_sample_2.res.payload.golden.json b/controller/test-files/work_item/update/label/valid_sample_2.res.payload.golden.json index 8e951f6b72..687afb9f7c 100755 --- a/controller/test-files/work_item/update/label/valid_sample_2.res.payload.golden.json +++ b/controller/test-files/work_item/update/label/valid_sample_2.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 10, "system.order": 10000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/markup/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/markup/valid_sample_1.res.payload.golden.json index ad6cbfac04..0f411d09db 100755 --- a/controller/test-files/work_item/update/markup/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/markup/valid_sample_1.res.payload.golden.json @@ -9,7 +9,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 11, "system.order": 11000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/markup/valid_sample_2.res.payload.golden.json b/controller/test-files/work_item/update/markup/valid_sample_2.res.payload.golden.json index 5f4f25dc65..b683c3f18e 100755 --- a/controller/test-files/work_item/update/markup/valid_sample_2.res.payload.golden.json +++ b/controller/test-files/work_item/update/markup/valid_sample_2.res.payload.golden.json @@ -9,7 +9,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 11, "system.order": 11000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/string/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/string/valid_sample_1.res.payload.golden.json index 245bdc0a7f..f09aa708a4 100755 --- a/controller/test-files/work_item/update/string/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/string/valid_sample_1.res.payload.golden.json @@ -6,7 +6,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 12, "system.order": 12000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/url/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/url/valid_sample_1.res.payload.golden.json index 7281da4091..32dca5bb1a 100755 --- a/controller/test-files/work_item/update/url/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/url/valid_sample_1.res.payload.golden.json @@ -5,7 +5,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 13, "system.order": 13000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/url/valid_sample_2.res.payload.golden.json b/controller/test-files/work_item/update/url/valid_sample_2.res.payload.golden.json index d2e7c9d038..aaebb75c6c 100755 --- a/controller/test-files/work_item/update/url/valid_sample_2.res.payload.golden.json +++ b/controller/test-files/work_item/update/url/valid_sample_2.res.payload.golden.json @@ -5,7 +5,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 13, "system.order": 13000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/url/valid_sample_3.res.payload.golden.json b/controller/test-files/work_item/update/url/valid_sample_3.res.payload.golden.json index 3808c0a1b1..a778b72458 100755 --- a/controller/test-files/work_item/update/url/valid_sample_3.res.payload.golden.json +++ b/controller/test-files/work_item/update/url/valid_sample_3.res.payload.golden.json @@ -5,7 +5,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 13, "system.order": 13000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/user/valid_sample_1.res.payload.golden.json b/controller/test-files/work_item/update/user/valid_sample_1.res.payload.golden.json index b6673df0b4..91828039c4 100755 --- a/controller/test-files/work_item/update/user/valid_sample_1.res.payload.golden.json +++ b/controller/test-files/work_item/update/user/valid_sample_1.res.payload.golden.json @@ -5,7 +5,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 14, "system.order": 14000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/user/valid_sample_2.res.payload.golden.json b/controller/test-files/work_item/update/user/valid_sample_2.res.payload.golden.json index e71fd8a997..986839830a 100755 --- a/controller/test-files/work_item/update/user/valid_sample_2.res.payload.golden.json +++ b/controller/test-files/work_item/update/user/valid_sample_2.res.payload.golden.json @@ -5,7 +5,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*WorkItem2Suite).TestWI2UpdateFieldOfDifferentSimpleTypes.func1 in controller/workitem_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 14, "system.order": 14000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item/update/workitem_type.res.payload.golden.json b/controller/test-files/work_item/update/workitem_type.res.payload.golden.json index 58462c84e9..f5c8afb263 100755 --- a/controller/test-files/work_item/update/workitem_type.res.payload.golden.json +++ b/controller/test-files/work_item/update/workitem_type.res.payload.golden.json @@ -9,7 +9,7 @@ "system.description": "```\nMissing fields in workitem type: Second WorkItem Type\n\nType1 Assigned To : First User (jon_doe), Second User (lorem_ipsum)\nType1 bar : hello\nType1 fooBar : open\nType1 integer-or-float-list : 101\nType1 reporter : First User (jon_doe)\n```\ndescription1\n", "system.description.markup": "Markdown", "system.description.rendered": "\u003cpre\u003e\u003ccode class=\"prettyprint\"\u003e\u003cspan class=\"typ\"\u003eMissing\u003c/span\u003e \u003cspan class=\"pln\"\u003efields\u003c/span\u003e \u003cspan class=\"kwd\"\u003ein\u003c/span\u003e \u003cspan class=\"pln\"\u003eworkitem\u003c/span\u003e \u003cspan class=\"kwd\"\u003etype\u003c/span\u003e\u003cspan class=\"pun\"\u003e:\u003c/span\u003e \u003cspan class=\"typ\"\u003eSecond\u003c/span\u003e \u003cspan class=\"typ\"\u003eWorkItem\u003c/span\u003e \u003cspan class=\"typ\"\u003eType\u003c/span\u003e\n\n\u003cspan class=\"typ\"\u003eType1\u003c/span\u003e \u003cspan class=\"typ\"\u003eAssigned\u003c/span\u003e \u003cspan class=\"typ\"\u003eTo\u003c/span\u003e \u003cspan class=\"pun\"\u003e:\u003c/span\u003e \u003cspan class=\"typ\"\u003eFirst\u003c/span\u003e \u003cspan class=\"typ\"\u003eUser\u003c/span\u003e \u003cspan class=\"pun\"\u003e(\u003c/span\u003e\u003cspan class=\"pln\"\u003ejon_doe\u003c/span\u003e\u003cspan class=\"pun\"\u003e)\u003c/span\u003e\u003cspan class=\"pun\"\u003e,\u003c/span\u003e \u003cspan class=\"typ\"\u003eSecond\u003c/span\u003e \u003cspan class=\"typ\"\u003eUser\u003c/span\u003e \u003cspan class=\"pun\"\u003e(\u003c/span\u003e\u003cspan class=\"pln\"\u003elorem_ipsum\u003c/span\u003e\u003cspan class=\"pun\"\u003e)\u003c/span\u003e\n\u003cspan class=\"typ\"\u003eType1\u003c/span\u003e \u003cspan class=\"pln\"\u003ebar\u003c/span\u003e \u003cspan class=\"pun\"\u003e:\u003c/span\u003e \u003cspan class=\"pln\"\u003ehello\u003c/span\u003e\n\u003cspan class=\"typ\"\u003eType1\u003c/span\u003e \u003cspan class=\"pln\"\u003efooBar\u003c/span\u003e \u003cspan class=\"pun\"\u003e:\u003c/span\u003e \u003cspan class=\"pln\"\u003eopen\u003c/span\u003e\n\u003cspan class=\"typ\"\u003eType1\u003c/span\u003e \u003cspan class=\"pln\"\u003einteger\u003c/span\u003e\u003cspan class=\"pun\"\u003e-\u003c/span\u003e\u003cspan class=\"kwd\"\u003eor\u003c/span\u003e\u003cspan class=\"pun\"\u003e-\u003c/span\u003e\u003cspan class=\"kwd\"\u003efloat\u003c/span\u003e\u003cspan class=\"pun\"\u003e-\u003c/span\u003e\u003cspan class=\"pln\"\u003elist\u003c/span\u003e \u003cspan class=\"pun\"\u003e:\u003c/span\u003e \u003cspan class=\"dec\"\u003e101\u003c/span\u003e\n\u003cspan class=\"typ\"\u003eType1\u003c/span\u003e \u003cspan class=\"pln\"\u003ereporter\u003c/span\u003e \u003cspan class=\"pun\"\u003e:\u003c/span\u003e \u003cspan class=\"typ\"\u003eFirst\u003c/span\u003e \u003cspan class=\"typ\"\u003eUser\u003c/span\u003e \u003cspan class=\"pun\"\u003e(\u003c/span\u003e\u003cspan class=\"pln\"\u003ejon_doe\u003c/span\u003e\u003cspan class=\"pun\"\u003e)\u003c/span\u003e\n\u003c/code\u003e\u003c/pre\u003e\n\n\u003cp\u003edescription1\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item_link/create/ok.res.payload.golden.json b/controller/test-files/work_item_link/create/ok.res.payload.golden.json index a01662f0e0..bfef60d1de 100755 --- a/controller/test-files/work_item_link/create/ok.res.payload.golden.json +++ b/controller/test-files/work_item_link/create/ok.res.payload.golden.json @@ -93,7 +93,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestCreate.func1.2 in controller/work_item_link_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestCreate.func1.2 in controller/work_item_link_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, @@ -176,7 +176,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestCreate.func1.2 in controller/work_item_link_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestCreate.func1.2 in controller/work_item_link_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, diff --git a/controller/test-files/work_item_link/list/ok.res.paylpad.golden.json b/controller/test-files/work_item_link/list/ok.res.paylpad.golden.json index 604af3b36c..e8d9bc1459 100755 --- a/controller/test-files/work_item_link/list/ok.res.paylpad.golden.json +++ b/controller/test-files/work_item_link/list/ok.res.paylpad.golden.json @@ -95,7 +95,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestList in controller/work_item_link_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestList in controller/work_item_link_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1, "system.remote_item_id": null, @@ -178,7 +178,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestList in controller/work_item_link_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestList in controller/work_item_link_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2, "system.remote_item_id": null, diff --git a/controller/test-files/work_item_link/show/ok.res.payload.golden.json b/controller/test-files/work_item_link/show/ok.res.payload.golden.json index 8ca0498fa4..6e19a6c367 100755 --- a/controller/test-files/work_item_link/show/ok.res.payload.golden.json +++ b/controller/test-files/work_item_link/show/ok.res.payload.golden.json @@ -93,7 +93,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestShow.func1.1 in controller/work_item_link_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestShow.func1.1 in controller/work_item_link_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 1, "system.order": 1000, "system.remote_item_id": null, @@ -176,7 +176,7 @@ "system.description": "`(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestShow.func1.1 in controller/work_item_link_blackbox_test.go)`", "system.description.markup": "Markdown", "system.description.rendered": "\u003cp\u003e\u003ccode\u003e(see function github.com/fabric8-services/fabric8-wit/controller_test.(*workItemLinkSuite).TestShow.func1.1 in controller/work_item_link_blackbox_test.go)\u003c/code\u003e\u003c/p\u003e\n", - "system.metastate": null, + "system.metastate": "mNew", "system.number": 2, "system.order": 2000, "system.remote_item_id": null, diff --git a/spacetemplate/assets/base.yaml b/spacetemplate/assets/base.yaml index 303f6f45a2..3e718a641a 100644 --- a/spacetemplate/assets/base.yaml +++ b/spacetemplate/assets/base.yaml @@ -50,7 +50,7 @@ work_item_types: "system.metastate": label: Meta State description: The meta-state of the work item - read_only: yes + read_only: no required: no type: simple_type: @@ -58,7 +58,7 @@ work_item_types: base_type: kind: string # This will allow other WITs to overwrite the values of the state. - rewritable_values: no + rewritable_values: yes # the sequence of the values need to match the sequence of the # system.state attributes. This encapsulates the mapping. values: diff --git a/test/testfixture/make_functions.go b/test/testfixture/make_functions.go index e69ad0d8c0..f055cb5ead 100644 --- a/test/testfixture/make_functions.go +++ b/test/testfixture/make_functions.go @@ -409,32 +409,32 @@ func makeWorkItemBoards(fxt *TestFixture) error { ID: uuid.NewV4(), Name: testsupport.CreateRandomValidTestName("New"), Order: 0, - TransRuleKey: "updateStateFromColumnMove", - TransRuleArgument: "{ 'metastate': 'mNew' }", + TransRuleKey: "BidirectionalStateToColumn", + TransRuleArgument: "{ \"metaState\": \"mNew\" }", BoardID: fxt.WorkItemBoards[i].ID, }, { ID: uuid.NewV4(), Name: testsupport.CreateRandomValidTestName("In Progress"), Order: 1, - TransRuleKey: "updateStateFromColumnMove", - TransRuleArgument: "{ 'metastate': 'mInprogress' }", + TransRuleKey: "BidirectionalStateToColumn", + TransRuleArgument: "{ \"metaState\": \"mInprogress\" }", BoardID: fxt.WorkItemBoards[i].ID, }, { ID: uuid.NewV4(), Name: testsupport.CreateRandomValidTestName("Resolved"), Order: 2, - TransRuleKey: "updateStateFromColumnMove", - TransRuleArgument: "{ 'metastate': 'mResolved' }", + TransRuleKey: "BidirectionalStateToColumn", + TransRuleArgument: "{ \"metaState\": \"mResolved\" }", BoardID: fxt.WorkItemBoards[i].ID, }, { ID: uuid.NewV4(), Name: testsupport.CreateRandomValidTestName("Approved"), Order: 3, - TransRuleKey: "updateStateFromColumnMove", - TransRuleArgument: "{ 'metastate': 'mResolved' }", + TransRuleKey: "BidirectionalStateToColumn", + TransRuleArgument: "{ \"metaState\": \"mResolved\" }", BoardID: fxt.WorkItemBoards[i].ID, }, }