This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ike Plugins (test-keeper)Thank you @kwk for this contribution! It seems that this PR already contains some added or changed tests. Good job! For more information please head over to official documentation. You can find there how to configure the plugin. |
alien-ike
changed the title
WIP: Fieldtype.ConvertToModelWithType
Fieldtype.ConvertToModelWithType
Sep 5, 2018
kwk
changed the title
Fieldtype.ConvertToModelWithType
WIP: Fieldtype.ConvertToModelWithType
Sep 5, 2018
Codecov Report
@@ Coverage Diff @@
## master #2274 +/- ##
==========================================
+ Coverage 69.39% 69.49% +0.09%
==========================================
Files 175 175
Lines 16392 16444 +52
==========================================
+ Hits 11376 11428 +52
- Misses 3923 3924 +1
+ Partials 1093 1092 -1
Continue to review full report at Codecov.
|
kwk
changed the title
WIP: Fieldtype.ConvertToModelWithType
Fieldtype.ConvertToModelWithType
Sep 5, 2018
jarifibrahim
approved these changes
Sep 5, 2018
kwk
added a commit
to openshiftio/saas-openshiftio
that referenced
this pull request
Sep 6, 2018
# About This description was generated using this script: ```sh #!/bin/bash set -e GHORG=${GHORG:-fabric8-services} GHREPO=${GHREPO:-fabric8-wit} cat <<EOF # About This description was generated using this script: \`\`\`sh `cat $0` \`\`\` Invoked as: `echo GHORG=${GHORG} GHREPO=${GHREPO} $(basename $0) ${@:1}` # Changes EOF git log \ --pretty="%n**Commit:** https://github.com/${GHORG}/${GHREPO}/commit/%H%n**Author:** %an (%ae)%n**Date:** %aI%n%n%s%n%n%b%n%n----%n" \ --reverse ${@:1} \ | sed -E "s/([\s|\(| ])#([0-9]+)/\1${GHORG}\/${GHREPO}#\2/g" ``` Invoked as: GHORG=fabric8-services GHREPO=fabric8-wit git-log-pr.sh 677410943faa4c4d403f15f9639a8a15b4c19be9..upstream/master # Changes **Commit:** fabric8-services/fabric8-wit@c0eaf33 **Author:** Konrad Kleine (193408+kwk@users.noreply.github.com) **Date:** 2018-09-05T12:47:43+02:00 Fieldtype.ConvertToModelWithType (fabric8-services/fabric8-wit#2274) # TL;DR When changing the type of a work item we have to check if fields are compatible. This logic was deeply embedded in the work item repository but it can be outsourced and made available to other pieces of the code as well. # About `ConvertToModelWithType` tries to find way to convert the value `v` from the current `FieldType` to the other `FieldType` in model representation; returns `error` otherwise. # Examples * For example if the given value `v` is a `string` and the other `FieldType` is a string list, we will return the value `v` as an array of `interface{}` objects. * Let's say the current `FieldType` is a string list and the other `FieldType` is a single `string` field, then we check if the value `v` has only one element and return that instead of the whole list. ---- **Commit:** fabric8-services/fabric8-wit@4909a90 **Author:** Konrad Kleine (193408+kwk@users.noreply.github.com) **Date:** 2018-09-06T13:17:10+02:00 Search by parent (fabric8-services/fabric8-wit#2275) Allow to search for work items by `parent.id` and `parent.number`. See https://openshift.io/openshiftio/Openshift_io/plan/detail/450. See fabric8-services/fabric8-wit#2244. ----
kwk
added a commit
to openshiftio/saas-openshiftio
that referenced
this pull request
Sep 6, 2018
**Commit:** fabric8-services/fabric8-wit@c0eaf33 **Author:** Konrad Kleine (193408+kwk@users.noreply.github.com) **Date:** 2018-09-05T12:47:43+02:00 Fieldtype.ConvertToModelWithType (fabric8-services/fabric8-wit#2274) # TL;DR When changing the type of a work item we have to check if fields are compatible. This logic was deeply embedded in the work item repository but it can be outsourced and made available to other pieces of the code as well. # About `ConvertToModelWithType` tries to find way to convert the value `v` from the current `FieldType` to the other `FieldType` in model representation; returns `error` otherwise. # Examples * For example if the given value `v` is a `string` and the other `FieldType` is a string list, we will return the value `v` as an array of `interface{}` objects. * Let's say the current `FieldType` is a string list and the other `FieldType` is a single `string` field, then we check if the value `v` has only one element and return that instead of the whole list. ---- **Commit:** fabric8-services/fabric8-wit@4909a90 **Author:** Konrad Kleine (193408+kwk@users.noreply.github.com) **Date:** 2018-09-06T13:17:10+02:00 Search by parent (fabric8-services/fabric8-wit#2275) Allow to search for work items by `parent.id` and `parent.number`. See https://openshift.io/openshiftio/Openshift_io/plan/detail/450. See fabric8-services/fabric8-wit#2244. ----
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL;DR
When changing the type of a work item we have to check if fields are compatible. This logic was deeply embedded in the work item repository but it can be outsourced and made available to other pieces of the code as well.
About
ConvertToModelWithType
tries to find way to convert the valuev
from the currentFieldType
to the otherFieldType
in model representation; returnserror
otherwise.Examples
v
is astring
and the otherFieldType
is a string list, we will return the valuev
as an array ofinterface{}
objects.FieldType
is a string list and the otherFieldType
is a singlestring
field, then we check if the valuev
has only one element and return that instead of the whole list.