Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Search by parent #2275

Merged
merged 7 commits into from
Sep 6, 2018
Merged

Search by parent #2275

merged 7 commits into from
Sep 6, 2018

Conversation

kwk
Copy link
Collaborator

@kwk kwk commented Sep 5, 2018

Allow to search for work items by parent.id and parent.number.

See https://openshift.io/openshiftio/Openshift_io/plan/detail/450.
See #2244.

@kwk kwk self-assigned this Sep 5, 2018
@alien-ike alien-ike changed the title WIP: Search by parent Search by parent Sep 5, 2018
@alien-ike alien-ike changed the title WIP: Search by parent Search by parent Sep 5, 2018
@kwk kwk changed the title Search by parent WIP: Search by parent Sep 5, 2018
@codecov-io
Copy link

codecov-io commented Sep 5, 2018

Codecov Report

Merging #2275 into master will increase coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2275      +/-   ##
==========================================
+ Coverage   69.34%   69.43%   +0.08%     
==========================================
  Files         175      175              
  Lines       16396    16407      +11     
==========================================
+ Hits        11370    11392      +22     
+ Misses       3932     3923       -9     
+ Partials     1094     1092       -2
Impacted Files Coverage Δ
workitem/table_join.go 89.89% <ø> (ø) ⬆️
search/search_repository.go 75.77% <100%> (ø) ⬆️
workitem/expression_compiler.go 82.86% <100%> (+0.68%) ⬆️
controller/workitem.go 78.83% <0%> (+0.56%) ⬆️
remoteworkitem/scheduler.go 60.97% <0%> (+7.31%) ⬆️
remoteworkitem/jira.go 100% <0%> (+25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c0eaf33...6000fdb. Read the comment docs.

@kwk kwk changed the title WIP: Search by parent Search by parent Sep 6, 2018
// disallowedColumns specified all fields that are allowed to be queried
// from the foreign table. When empty all columns are allowed.
// AllowedColumns specified all fields that are allowed to be queried from
// the foreign table. When empty all columns are allowed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comma, please, after the empty?
Like When empty, all columns are allowed. I couldn't understand the sentence at first. :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 6000fdb

@jarifibrahim
Copy link
Member

[test]

Copy link
Member

@jarifibrahim jarifibrahim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for explaining the changes over a call.

@kwk kwk merged commit 4909a90 into fabric8-services:master Sep 6, 2018
@kwk kwk deleted the search-by-parent branch September 6, 2018 11:17
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 ([email protected])
**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 ([email protected])
**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 ([email protected])
**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 ([email protected])
**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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants