Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure the same data on /ocs/v?.php/config like oC10 [full-ci] #3113

Merged
merged 2 commits into from
Mar 29, 2022

Conversation

wkloucek
Copy link
Contributor

@wkloucek wkloucek commented Feb 4, 2022

Description

together with https://github.com/cs3org/reva/pull/2692/files, we now return the same (weird / wrong) info as oC10:

oCIS /ocs/v2.php/config

<ocs>
  <meta>
    <status>ok</status>
    <statuscode>200</statuscode>
    <message>OK</message>
  </meta>
  <data>
    <version>1.7</version>
    <website>ownCloud</website>
    <host>localhost:9200</host>
    <contact/>
    <ssl>false</ssl>
  </data>
</ocs>

https://cloud.owncloud.com/ocs/v2.php/config:

<ocs>
  <meta>
    <status>ok</status>
    <statuscode>200</statuscode>
    <message/>
    <totalitems/>
    <itemsperpage/>
  </meta>
  <data>
    <version>1.7</version>
    <website>ownCloud</website>
    <host>cloud.owncloud.com</host>
    <contact/>
    <ssl>false</ssl>
  </data>
</ocs>

Related Issue

@wkloucek wkloucek force-pushed the ocs-config-like-oc10 branch 2 times, most recently from 17c234a to 52cefe4 Compare February 4, 2022 10:32
@ownclouders
Copy link
Contributor

ownclouders commented Feb 4, 2022

💥 Acceptance test Web-Tests-ocis-smoke-ocis-storage-2 failed. Further test are cancelled...

@owncloud owncloud deleted a comment from update-docs bot Feb 23, 2022
@phil-davis
Copy link
Contributor

https://drone.owncloud.com/owncloud/ocis/9619/21/4

+ ocis/bin/ocis server

can't connect to nats (stan) server, retrying in 746.090823ms

{"level":"error","error":"remove /srv/app/tmp/ocis/storage/metadata/nodes/root.flock: no such file or directory","time":"2022-02-24T10:17:43Z","caller":"/go/pkg/mod/github.com/cs3org/reva@v1.16.1-0.20220221135950-8cc813ecfc4c/pkg/storage/fs/ocis/ocis.go:48","message":"could not setup tree"}

{"level":"error","service":"storage","error":"http service dataprovider could not be started,: could not setup tree: remove /srv/app/tmp/ocis/storage/metadata/nodes/root.flock: no such file or directory","time":"2022-02-24T10:17:43Z","message":"error starting the http server"}

ocis fell over with the "flock" problem. CI needs to be run again - maybe rebase anyway?

@phil-davis
Copy link
Contributor

"This branch is 1 commit ahead, 33 commits behind master. "
https://github.com/owncloud/ocis/tree/ocs-config-like-oc10

It would be good to rebase this - there were good fixes in oCIS late yesterday.

@wkloucek wkloucek force-pushed the ocs-config-like-oc10 branch 2 times, most recently from 6848469 to c84845e Compare March 1, 2022 07:56
@wkloucek wkloucek changed the title ensure the same data on /ocs/v?.php/config like oC10 ensure the same data on /ocs/v?.php/config like oC10 [full-ci] Mar 1, 2022
@wkloucek
Copy link
Contributor Author

wkloucek commented Mar 1, 2022

@phil-davis could you please have look, since I get weird errors in https://drone.owncloud.com/owncloud/ocis/9683/26/6, eg.:

    Examples:
      | ocs_api_version | ocs_status_code |
      | 1               | 100             |
        │ url has unexpected value 'ocis-server:9200/#/s/UNJVPbPUBTxEUzj'
        │ 
        url doesn't have value 'AN_URL'
        Failed asserting that false is true.
      | 2               | 200             |
        │ url has unexpected value 'ocis-server:9200/#/s/VWEIREAmnDlXdFo'
        │ 
        url doesn't have value 'AN_URL'
        Failed asserting that false is true.

@kulmann
Copy link
Member

kulmann commented Mar 15, 2022

@phil-davis could you please have look, since I get weird errors in https://drone.owncloud.com/owncloud/ocis/9683/26/6, eg.:

    Examples:
      | ocs_api_version | ocs_status_code |
      | 1               | 100             |
        │ url has unexpected value 'ocis-server:9200/#/s/UNJVPbPUBTxEUzj'
        │ 
        url doesn't have value 'AN_URL'
        Failed asserting that false is true.
      | 2               | 200             |
        │ url has unexpected value 'ocis-server:9200/#/s/VWEIREAmnDlXdFo'
        │ 
        url doesn't have value 'AN_URL'
        Failed asserting that false is true.

That looks like the respective test mocks data on the (now) wrong config vars, right?

@phil-davis
Copy link
Contributor

https://github.com/owncloud/core/blob/master/tests/acceptance/features/bootstrap/FeatureContext.php has:

	public function isAPublicLinkUrl(string $url):bool {
		if (OcisHelper::isTestingOnReva()) {
			$urlEnding = \ltrim($url, '/');
		} else {
			if (\substr($url, 0, 4) !== "http") {
				return false;
			}
			$urlEnding = \substr($url, \strlen($this->getBaseUrl() . '/'));
		}

		if (OcisHelper::isTestingOnOcisOrReva()) {
			$matchResult = \preg_match("%^(#/)?s/([a-zA-Z0-9]{15})$%", $urlEnding);
		} else {
			$matchResult = \preg_match("%^(index.php/)?s/([a-zA-Z0-9]{15})$%", $urlEnding);
		}

		// preg_match returns (int) 1 for a match, we want to return a boolean.
		if ($matchResult === 1) {
			$isPublicLinkUrl = true;
		} else {
			$isPublicLinkUrl = false;
		}
		return $isPublicLinkUrl;
	}

For oCIS, the value is expected to be a string that starts with #/s/ or just s/ (the #/ is optional, I think there was discussion in the past about that). But the test code does not expect that the public link URL has the host and port part at the front.

I guess that in current master that ocis-server:9200/ does not appear at the start, but in this PR ocis-server:9200/ does appear at the start of the URL?

On oC10, public links are just specified as index.php/s/xxxxxxxxxxxxxxx - they do not have the "base url" mentioned.

What is the requirement? (and we can easily make the tests expect it)

@sonarcloud
Copy link

sonarcloud bot commented Mar 29, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@wkloucek wkloucek merged commit 00cb115 into master Mar 29, 2022
@delete-merged-branch delete-merged-branch bot deleted the ocs-config-like-oc10 branch March 29, 2022 11:52
ownclouders pushed a commit that referenced this pull request Mar 29, 2022
Merge: 4fda0a8 4578f5c
Author: Willy Kloucek <34452982+wkloucek@users.noreply.github.com>
Date:   Tue Mar 29 13:52:00 2022 +0200

    Merge pull request #3113 from owncloud/ocs-config-like-oc10

    ensure the same data on /ocs/v?.php/config like oC10 [full-ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants