Repository: owncloud/ocis
Pull request #7553 (2023-10-20 12:41:09)

enhancement: improve content extraction stop word cleaning
## Description
So far it has not been possible to determine whether
the content for the search should be cleaned of stop words or not.

This can now be set with the newly introduced settings option `SEARCH_EXTRACTOR_TIKA_CLEAN_STOP_WORDS=false`
which is enabled by default.

In addition, the stop word cleanup is no longer as aggressive and now ignores numbers, urls,
basically everything except the defined stop words.

## Related Issue
- Fixes https://github.com/owncloud/ocis/issues/6674

## Motivation and Context
..., no bugs, ... yummy
![ezgif-2-09128abecb](https://github.com/owncloud/ocis/assets/49308105/6d903618-ca23-4c50-9bd3-a534d3c6cc5d)

## How Has This Been Tested?
- unit tests

## Types of changes
- [X] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Technical debt
- [ ] Tests only (no source changes)

## Checklist:
<!-- Tick the checkboxes when done. -->
<!-- Raise documentation ticket in owncloud.github.io/ -->
- [X] Code changes
- [X] Unit tests added
- [ ] Acceptance tests added
- [ ] Documentation ticket raised: <link> 


sonarcloud[bot]: Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=owncloud_ocis&pullRequest=7553)

[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=7553&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=7553&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=7553&resolved=false&types=BUG)  
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=7553&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=7553&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=7553&resolved=false&types=VULNERABILITY)  
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=owncloud_ocis&pullRequest=7553&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=owncloud_ocis&pullRequest=7553&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=owncloud_ocis&pullRequest=7553&resolved=false&types=SECURITY_HOTSPOT)  
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=7553&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=7553&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=owncloud_ocis&pullRequest=7553&resolved=false&types=CODE_SMELL)

[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=7553&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=7553&metric=new_coverage&view=list)  
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=7553&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=owncloud_ocis&pullRequest=7553&metric=new_duplicated_lines_density&view=list)



Patch:
diff --git a/changelog/unreleased/enhancement-search-content-extraction-cleanup.md b/changelog/unreleased/enhancement-search-content-extraction-cleanup.md
new file mode 100644
index 00000000000..566b15f7792
--- /dev/null
+++ b/changelog/unreleased/enhancement-search-content-extraction-cleanup.md
@@ -0,0 +1,15 @@
+Enhancement: Tika content extraction cleanup for search
+
+So far it has not been possible to determine whether the
+content for search should be cleaned up of 'stop words' or not.
+Stop words are filling words like "I, you, have, am" etc and
+defined by the search engine.
+
+The behaviour can now be set with the newly introduced settings option `SEARCH_EXTRACTOR_TIKA_CLEAN_STOP_WORDS=false`
+which is enabled by default.
+
+In addition, the stop word cleanup is no longer as aggressive and now ignores numbers, urls,
+basically everything except the defined stop words.
+
+https://github.com/owncloud/ocis/pull/7553
+https://github.com/owncloud/ocis/issues/6674
diff --git a/go.mod b/go.mod
index 163f38f0502..54724081deb 100644
--- a/go.mod
+++ b/go.mod
@@ -11,7 +11,7 @@ require (
 	github.com/bbalet/stopwords v1.0.0
 	github.com/blevesearch/bleve/v2 v2.3.10
 	github.com/coreos/go-oidc v2.2.1+incompatible
-	github.com/coreos/go-oidc/v3 v3.6.0
+	github.com/coreos/go-oidc/v3 v3.7.0
 	github.com/cs3org/go-cs3apis v0.0.0-20230727093620-0f4399be4543
 	github.com/cs3org/reva/v2 v2.16.1-0.20231020092327-051345fa7b18
 	github.com/disintegration/imaging v1.6.2
diff --git a/go.sum b/go.sum
index 3fbe5e39b29..142e6ed2b18 100644
--- a/go.sum
+++ b/go.sum
@@ -995,8 +995,8 @@ github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkE
 github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
 github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk=
 github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
-github.com/coreos/go-oidc/v3 v3.6.0 h1:AKVxfYw1Gmkn/w96z0DbT/B/xFnzTd3MkZvWLjF4n/o=
-github.com/coreos/go-oidc/v3 v3.6.0/go.mod h1:ZpHUsHBucTUj6WOkrP4E20UPynbLZzhTQ1XKCXkxyPc=
+github.com/coreos/go-oidc/v3 v3.7.0 h1:FTdj0uexT4diYIPlF4yoFVI5MRO1r5+SEcIpEw9vC0o=
+github.com/coreos/go-oidc/v3 v3.7.0/go.mod h1:yQzSCqBnK3e6Fs5l+f5i0F8Kwf0zpH9bPEsbY00KanM=
 github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
 github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
 github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
diff --git a/services/search/README.md b/services/search/README.md
index 82df9ca3dc3..739fc3a6771 100644
--- a/services/search/README.md
+++ b/services/search/README.md
@@ -70,6 +70,9 @@ When the search service can reach Tika, it begins to read out the content on dem
 
 Content extraction and handling the extracted content can be very resource intensive. Content extraction is therefore limited to files with a certain file size. The default limit is 20MB and can be configured using the `SEARCH_CONTENT_EXTRACTION_SIZE_LIMIT` variable.
 
+When extracting the content you can specify whether filler words are ignored or not.
+To keep them, the environment variable `SEARCH_EXTRACTOR_TIKA_CLEAN_STOP_WORDS` must be set to false.
+
 When using the Tika container and docker-compose, consider the following:
 
 *   See the [ocis_wopi](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_wopi) example.
diff --git a/services/search/pkg/config/content.go b/services/search/pkg/config/content.go
index 1159bf22c35..df753056a68 100644
--- a/services/search/pkg/config/content.go
+++ b/services/search/pkg/config/content.go
@@ -9,5 +9,6 @@ type Extractor struct {
 
 // ExtractorTika configures the Tika extractor
 type ExtractorTika struct {
-	TikaURL string `yaml:"tika_url" env:"SEARCH_EXTRACTOR_TIKA_TIKA_URL" desc:"URL of the tika server."`
+	TikaURL        string `yaml:"tika_url" env:"SEARCH_EXTRACTOR_TIKA_TIKA_URL" desc:"URL of the tika server."`
+	CleanStopWords bool   `yaml:"clean_stop_words" env:"SEARCH_EXTRACTOR_TIKA_CLEAN_STOP_WORDS" desc:"Defines if stop words should be cleaned or not. See the documentation for more details."`
 }
diff --git a/services/search/pkg/config/defaults/defaultconfig.go b/services/search/pkg/config/defaults/defaultconfig.go
index c7575081c71..3f4cce3e0ab 100644
--- a/services/search/pkg/config/defaults/defaultconfig.go
+++ b/services/search/pkg/config/defaults/defaultconfig.go
@@ -43,7 +43,8 @@ func DefaultConfig() *config.Config {
 			Type:             "basic",
 			CS3AllowInsecure: false,
 			Tika: config.ExtractorTika{
-				TikaURL: "http://127.0.0.1:9998",
+				TikaURL:        "http://127.0.0.1:9998",
+				CleanStopWords: true,
 			},
 		},
 		Events: config.Events{
diff --git a/services/search/pkg/content/content.go b/services/search/pkg/content/content.go
index e58f35dc435..ef334e07064 100644
--- a/services/search/pkg/content/content.go
+++ b/services/search/pkg/content/content.go
@@ -1,5 +1,15 @@
 package content
 
+import (
+	"strings"
+
+	"github.com/bbalet/stopwords"
+)
+
+func init() {
+	stopwords.OverwriteWordSegmenter(`[^ ]+`)
+}
+
 // Document wraps all resource meta fields,
 // it is used as a content extraction result.
 type Document struct {
@@ -11,3 +21,7 @@ type Document struct {
 	MimeType string
 	Tags     []string
 }
+
+func CleanString(content, langCode string) string {
+	return strings.TrimSpace(stopwords.CleanString(content, langCode, true))
+}
diff --git a/services/search/pkg/content/tika.go b/services/search/pkg/content/tika.go
index 1979cdbcdb3..b2953170b48 100644
--- a/services/search/pkg/content/tika.go
+++ b/services/search/pkg/content/tika.go
@@ -5,11 +5,11 @@ import (
 	"fmt"
 	"strings"
 
-	"github.com/bbalet/stopwords"
 	gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
 	provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
 	"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
 	"github.com/google/go-tika/tika"
+
 	"github.com/owncloud/ocis/v2/ocis-pkg/log"
 	"github.com/owncloud/ocis/v2/services/search/pkg/config"
 )
@@ -20,7 +20,8 @@ type Tika struct {
 	*Basic
 	Retriever
 	tika                       *tika.Client
-	contentExtractionSizeLimit uint64
+	ContentExtractionSizeLimit uint64
+	CleanStopWords             bool
 }
 
 // NewTikaExtractor creates a new Tika instance.
@@ -41,7 +42,8 @@ func NewTikaExtractor(gatewaySelector pool.Selectable[gateway.GatewayAPIClient],
 		Basic:                      basic,
 		Retriever:                  newCS3Retriever(gatewaySelector, logger, cfg.Extractor.CS3AllowInsecure),
 		tika:                       tika.NewClient(nil, cfg.Extractor.Tika.TikaURL),
-		contentExtractionSizeLimit: cfg.ContentExtractionSizeLimit,
+		ContentExtractionSizeLimit: cfg.ContentExtractionSizeLimit,
+		CleanStopWords:             cfg.Extractor.Tika.CleanStopWords,
 	}, nil
 }
 
@@ -56,7 +58,7 @@ func (t Tika) Extract(ctx context.Context, ri *provider.ResourceInfo) (Document,
 		return doc, nil
 	}
 
-	if ri.Size > t.contentExtractionSizeLimit {
+	if ri.Size > t.ContentExtractionSizeLimit {
 		t.logger.Info().Interface("ResourceID", ri.Id).Str("Name", ri.Name).Msg("file exceeds content extraction size limit. skipping.")
 		return doc, nil
 	}
@@ -86,8 +88,8 @@ func (t Tika) Extract(ctx context.Context, ri *provider.ResourceInfo) (Document,
 		}
 	}
 
-	if lang, _ := t.tika.LanguageString(ctx, doc.Content); lang != "" {
-		doc.Content = stopwords.CleanString(doc.Content, lang, true)
+	if langCode, _ := t.tika.LanguageString(ctx, doc.Content); langCode != "" && t.CleanStopWords {
+		doc.Content = CleanString(doc.Content, langCode)
 	}
 
 	return doc, nil
diff --git a/vendor/github.com/coreos/go-oidc/v3/oidc/jwks.go b/vendor/github.com/coreos/go-oidc/v3/oidc/jwks.go
index 539933b3d9e..b1e3f7e3ff5 100644
--- a/vendor/github.com/coreos/go-oidc/v3/oidc/jwks.go
+++ b/vendor/github.com/coreos/go-oidc/v3/oidc/jwks.go
@@ -8,7 +8,7 @@ import (
 	"crypto/rsa"
 	"errors"
 	"fmt"
-	"io/ioutil"
+	"io"
 	"net/http"
 	"sync"
 	"time"
@@ -159,7 +159,7 @@ func (r *RemoteKeySet) verify(ctx context.Context, jws *jose.JSONWebSignature) (
 	// https://openid.net/specs/openid-connect-core-1_0.html#RotateSigKeys
 	keys, err := r.keysFromRemote(ctx)
 	if err != nil {
-		return nil, fmt.Errorf("fetching keys %v", err)
+		return nil, fmt.Errorf("fetching keys %w", err)
 	}
 
 	for _, key := range keys {
@@ -228,11 +228,11 @@ func (r *RemoteKeySet) updateKeys() ([]jose.JSONWebKey, error) {
 
 	resp, err := doRequest(r.ctx, req)
 	if err != nil {
-		return nil, fmt.Errorf("oidc: get keys failed %v", err)
+		return nil, fmt.Errorf("oidc: get keys failed %w", err)
 	}
 	defer resp.Body.Close()
 
-	body, err := ioutil.ReadAll(resp.Body)
+	body, err := io.ReadAll(resp.Body)
 	if err != nil {
 		return nil, fmt.Errorf("unable to read response body: %v", err)
 	}
diff --git a/vendor/github.com/coreos/go-oidc/v3/oidc/oidc.go b/vendor/github.com/coreos/go-oidc/v3/oidc/oidc.go
index b159d1ccd7b..6e2b0e567b7 100644
--- a/vendor/github.com/coreos/go-oidc/v3/oidc/oidc.go
+++ b/vendor/github.com/coreos/go-oidc/v3/oidc/oidc.go
@@ -10,7 +10,7 @@ import (
 	"errors"
 	"fmt"
 	"hash"
-	"io/ioutil"
+	"io"
 	"mime"
 	"net/http"
 	"strings"
@@ -211,7 +211,7 @@ func NewProvider(ctx context.Context, issuer string) (*Provider, error) {
 	}
 	defer resp.Body.Close()
 
-	body, err := ioutil.ReadAll(resp.Body)
+	body, err := io.ReadAll(resp.Body)
 	if err != nil {
 		return nil, fmt.Errorf("unable to read response body: %v", err)
 	}
@@ -332,7 +332,7 @@ func (p *Provider) UserInfo(ctx context.Context, tokenSource oauth2.TokenSource)
 		return nil, err
 	}
 	defer resp.Body.Close()
-	body, err := ioutil.ReadAll(resp.Body)
+	body, err := io.ReadAll(resp.Body)
 	if err != nil {
 		return nil, err
 	}
diff --git a/vendor/github.com/coreos/go-oidc/v3/oidc/verify.go b/vendor/github.com/coreos/go-oidc/v3/oidc/verify.go
index 3e5ffbc76e5..0bca49a8992 100644
--- a/vendor/github.com/coreos/go-oidc/v3/oidc/verify.go
+++ b/vendor/github.com/coreos/go-oidc/v3/oidc/verify.go
@@ -7,7 +7,7 @@ import (
 	"encoding/json"
 	"errors"
 	"fmt"
-	"io/ioutil"
+	"io"
 	"net/http"
 	"strings"
 	"time"
@@ -182,7 +182,7 @@ func resolveDistributedClaim(ctx context.Context, verifier *IDTokenVerifier, src
 	}
 	defer resp.Body.Close()
 
-	body, err := ioutil.ReadAll(resp.Body)
+	body, err := io.ReadAll(resp.Body)
 	if err != nil {
 		return nil, fmt.Errorf("unable to read response body: %v", err)
 	}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 91e10ed1237..e0051c7ccac 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -312,7 +312,7 @@ github.com/containerd/cgroups/v3/cgroup2/stats
 # github.com/coreos/go-oidc v2.2.1+incompatible
 ## explicit
 github.com/coreos/go-oidc
-# github.com/coreos/go-oidc/v3 v3.6.0
+# github.com/coreos/go-oidc/v3 v3.7.0
 ## explicit; go 1.19
 github.com/coreos/go-oidc/v3/oidc
 # github.com/coreos/go-semver v0.3.0


Test patch:
diff --git a/services/search/pkg/content/content_test.go b/services/search/pkg/content/content_test.go
new file mode 100644
index 00000000000..17631fe4d79
--- /dev/null
+++ b/services/search/pkg/content/content_test.go
@@ -0,0 +1,36 @@
+package content_test
+
+import (
+	"testing"
+
+	. "github.com/stretchr/testify/assert"
+
+	"github.com/owncloud/ocis/v2/services/search/pkg/content"
+)
+
+func TestCleanContent(t *testing.T) {
+	tests := []struct {
+		given  string
+		expect string
+	}{
+		{
+			given:  "find can keeper should keeper will",
+			expect: "keeper keeper",
+		},
+		{
+			given:  "user1 shares the file to Marie",
+			expect: "user1 shares file marie",
+		},
+		{
+			given:  "content contains https://localhost/remote.php/dav/files/admin/Photos/San%20Francisco.jpg and stop word",
+			expect: "content contains https://localhost/remote.php/dav/files/admin/photos/san%20francisco.jpg stop word",
+		},
+	}
+
+	for _, tc := range tests {
+		tc := tc
+		t.Run(tc.given, func(t *testing.T) {
+			Equal(t, tc.expect, content.CleanString(tc.given, "en"))
+		})
+	}
+}
diff --git a/services/search/pkg/content/tika_test.go b/services/search/pkg/content/tika_test.go
index fa261182417..fbb5c0578b1 100644
--- a/services/search/pkg/content/tika_test.go
+++ b/services/search/pkg/content/tika_test.go
@@ -11,11 +11,12 @@ import (
 	provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
 	. "github.com/onsi/ginkgo/v2"
 	. "github.com/onsi/gomega"
+	"github.com/stretchr/testify/mock"
+
 	"github.com/owncloud/ocis/v2/ocis-pkg/log"
 	conf "github.com/owncloud/ocis/v2/services/search/pkg/config/defaults"
 	"github.com/owncloud/ocis/v2/services/search/pkg/content"
 	contentMocks "github.com/owncloud/ocis/v2/services/search/pkg/content/mocks"
-	"github.com/stretchr/testify/mock"
 )
 
 var _ = Describe("Tika", func() {
@@ -48,6 +49,7 @@ var _ = Describe("Tika", func() {
 
 			cfg := conf.DefaultConfig()
 			cfg.Extractor.Tika.TikaURL = srv.URL
+			cfg.Extractor.Tika.CleanStopWords = true
 
 			var err error
 			tika, err = content.NewTikaExtractor(nil, log.NewLogger(), cfg)
@@ -82,7 +84,7 @@ var _ = Describe("Tika", func() {
 		})
 
 		It("removes stop words", func() {
-			body = "body to test stop words!!! I, you, he, she, it, we, you, they, stay"
+			body = "body to test stop words!!! against almost everyone"
 			language = "en"
 
 			doc, err := tika.Extract(context.TODO(), &provider.ResourceInfo{
@@ -90,7 +92,20 @@ var _ = Describe("Tika", func() {
 				Size: 1,
 			})
 			Expect(err).ToNot(HaveOccurred())
-			Expect(doc.Content).To(Equal("body test stop words i stay "))
+			Expect(doc.Content).To(Equal("body test stop words!!!"))
+		})
+
+		It("keeps stop words", func() {
+			body = "body to test stop words!!! against almost everyone"
+			language = "en"
+
+			tika.CleanStopWords = false
+			doc, err := tika.Extract(context.TODO(), &provider.ResourceInfo{
+				Type: provider.ResourceType_RESOURCE_TYPE_FILE,
+				Size: 1,
+			})
+			Expect(err).ToNot(HaveOccurred())
+			Expect(doc.Content).To(Equal(body))
 		})
 	})
 })
diff --git a/tests/acceptance/features/coreApiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature b/tests/acceptance/features/coreApiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature
index 8f840e79552..08b0a0f45f8 100644
--- a/tests/acceptance/features/coreApiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature
+++ b/tests/acceptance/features/coreApiShareCreateSpecialToShares2/createShareReceivedInMultipleWays.feature
@@ -261,36 +261,36 @@ Feature: share resources where the sharee receives the share in multiple ways
     And user "Alice" should not be able to delete folder "/Shares/child1/child2"
 
 
-  # Scenario: sharing parent folder to user with all permissions and its child folder to group with read permission then check reshare operation
-  #   Given group "grp1" has been created
-  #   And user "Carol" has been created with default attributes and without skeleton files
-  #   And user "Carol" has created the following folders
-  #     | path                  |
-  #     | /parent               |
-  #     | /parent/child1        |
-  #     | /parent/child1/child2 |
-  #   And user "Alice" has been added to group "grp1"
-  #   And user "Brian" has been added to group "grp1"
-  #   And user "Carol" has created a share with settings
-  #     | path        | /parent |
-  #     | shareType   | user    |
-  #     | shareWith   | Brian   |
-  #     | permissions | all     |
-  #   And user "Carol" has created a share with settings
-  #     | path        | /parent/child1 |
-  #     | shareType   | group          |
-  #     | shareWith   | grp1           |
-  #     | permissions | read           |
-  #   When user "Brian" creates a share using the sharing API with settings
-  #     | path        | /Shares/parent |
-  #     | shareType   | user           |
-  #     | shareWith   | Alice          |
-  #     | permissions | read           |
-  #   Then the HTTP status code should be "200"
-  #   And the OCS status code should be "100"
-  #   And as "Brian" folder "/Shares/child1" should exist
-  #   And as "Alice" folder "/Shares/child1" should exist
-  #   And as "Alice" folder "/Shares/parent" should exist
+  Scenario: sharing parent folder to user with all permissions and its child folder to group with read permission then check reshare operation
+    Given group "grp1" has been created
+    And user "Carol" has been created with default attributes and without skeleton files
+    And user "Carol" has created the following folders
+      | path                  |
+      | /parent               |
+      | /parent/child1        |
+      | /parent/child1/child2 |
+    And user "Alice" has been added to group "grp1"
+    And user "Brian" has been added to group "grp1"
+    And user "Carol" has created a share with settings
+      | path        | /parent |
+      | shareType   | user    |
+      | shareWith   | Brian   |
+      | permissions | all     |
+    And user "Carol" has created a share with settings
+      | path        | /parent/child1 |
+      | shareType   | group          |
+      | shareWith   | grp1           |
+      | permissions | read           |
+    When user "Brian" creates a share using the sharing API with settings
+      | path        | /Shares/parent |
+      | shareType   | user           |
+      | shareWith   | Alice          |
+      | permissions | read           |
+    Then the HTTP status code should be "200"
+    And the OCS status code should be "100"
+    And as "Brian" folder "/Shares/child1" should exist
+    And as "Alice" folder "/Shares/child1" should exist
+    And as "Alice" folder "/Shares/parent" should exist
 
 
   Scenario: sharing parent folder to group with read permission and its child folder to user with all permissions then check create operation
@@ -458,8 +458,8 @@ Feature: share resources where the sharee receives the share in multiple ways
     And as "Brian" folder "Shares/sharedParent" should exist
     And as "Brian" file "Shares/sharedParent/child/lorem.txt" should exist
 
-
-  Scenario Outline: share receiver renames a group share and receives same resource through user share with additional permissions
+  @skip @issue-7555
+  Scenario Outline: share receiver renames a group share and receives same resource through user share with additional permissions 
     Given using OCS API version "<ocs_api_version>"
     And group "grp" has been created
     And user "Brian" has been added to group "grp"
diff --git a/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature b/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature
index 829a74de1a9..974acc6a84a 100644
--- a/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature
+++ b/tests/acceptance/features/coreApiShareManagementBasicToShares/createShareToSharesFolder.feature
@@ -469,7 +469,7 @@ Feature: sharing
       | 1               | 100             |
       | 2               | 200             |
 
-  @issue-2146 @issue-764
+  @issue-2146 @issue-764 @issue-7555
   Scenario: share a file by multiple channels and download from sub-folder and direct file share
     Given these users have been created with default attributes and without skeleton files:
       | username |
diff --git a/tests/acceptance/features/coreApiShareManagementBasicToShares/deleteShareFromShares.feature b/tests/acceptance/features/coreApiShareManagementBasicToShares/deleteShareFromShares.feature
index 886579217d3..982e04c45ce 100644
--- a/tests/acceptance/features/coreApiShareManagementBasicToShares/deleteShareFromShares.feature
+++ b/tests/acceptance/features/coreApiShareManagementBasicToShares/deleteShareFromShares.feature
@@ -11,7 +11,7 @@ Feature: sharing
       | Brian    |
     And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
 
-
+  @issue-7555
   Scenario Outline: delete all group shares
     Given using OCS API version "<ocs_api_version>"
     And group "grp1" has been created
diff --git a/tests/acceptance/features/coreApiShareUpdateToShares/updateShare.feature b/tests/acceptance/features/coreApiShareUpdateToShares/updateShare.feature
index 205276e2e53..7e52a4d81a4 100644
--- a/tests/acceptance/features/coreApiShareUpdateToShares/updateShare.feature
+++ b/tests/acceptance/features/coreApiShareUpdateToShares/updateShare.feature
@@ -28,7 +28,7 @@ Feature: sharing
       | 1               | 100             |
       | 2               | 200             |
 
-  @issue-1289
+  @issue-1289 @issue-7555
   Scenario Outline: keep group permissions in sync when the share is renamed by the receiver and then the permissions are updated by sharer
     Given using OCS API version "<ocs_api_version>"
     And user "Brian" has been created with default attributes and without skeleton files
diff --git a/tests/acceptance/features/coreApiTrashbin/trashbinSharingToShares.feature b/tests/acceptance/features/coreApiTrashbin/trashbinSharingToShares.feature
index 1073d8fa07f..3b537191052 100644
--- a/tests/acceptance/features/coreApiTrashbin/trashbinSharingToShares.feature
+++ b/tests/acceptance/features/coreApiTrashbin/trashbinSharingToShares.feature
@@ -7,7 +7,7 @@ Feature: using trashbin together with sharing
     Given user "Alice" has been created with default attributes and without skeleton files
     And user "Alice" has uploaded file with content "file to delete" to "/textfile0.txt"
 
-  @smokeTest
+  @smokeTest @issue-7555
   Scenario Outline: deleting a received folder doesn't move it to trashbin
     Given using <dav-path-version> DAV path
     And user "Brian" has been created with default attributes and without skeleton files
@@ -27,7 +27,7 @@ Feature: using trashbin together with sharing
       | dav-path-version |
       | spaces           |
 
-
+  @issue-7555
   Scenario Outline: deleting a file in a received folder moves it to trashbin of both users
     Given using <dav-path-version> DAV path
     And user "Brian" has been created with default attributes and without skeleton files
@@ -150,7 +150,7 @@ Feature: using trashbin together with sharing
       | dav-path-version |
       | spaces           |
 
-
+  @issue-7555
   Scenario Outline: deleting a file in a received folder when restored it comes back to the original path
     Given using <dav-path-version> DAV path
     And user "Brian" has been created with default attributes and without skeleton files
diff --git a/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature b/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature
index ba11a5aadf2..5d30287b18b 100644
--- a/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature
+++ b/tests/acceptance/features/coreApiVersions/fileVersionAuthor.feature
@@ -144,7 +144,7 @@ Feature: file versions remember the author of each version
       | 1     | Brian  |
       | 2     | Alice  |
 
-
+  @issue-7555
   Scenario: enable file versioning and check the history of changes in sharer after renaming file by sharee
     Given group "grp1" has been created
     And user "Alice" has been added to group "grp1"