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

[full-ci] Set OCS version to up to date values #2918

Merged
merged 3 commits into from
May 7, 2022
Merged

Conversation

kulmann
Copy link
Member

@kulmann kulmann commented Dec 23, 2021

Description

This PR sets the OCS version fields to up to date values and already includes the "product" field, which hopefully gets merged in reva soonish cs3org/reva#2397

With these enhancements we'll be able to see the backend version in the browser console when we merged and released that in web: owncloud/web#6190

I guess setting the hardcoded version information during a release might be feasible for now. I didn't find any place where the current version is written down at the moment. In web we have it in the package.json so I was able to include it from there during bundling. Would be nice to have it a little less dirty here as well. Ideas for where to put the current oCIS version are welcome, I'll happily include that in this PR.

Related Issue

Results

Dev Debug Build

{
    "installed": true,
    "maintenance": false,
    "needsDbUpgrade": false,
    "version": "0.0.0.0",
    "versionstring": "0.0.0+dev",
    "edition": "Community",
    "productname": "Infinite Scale",
    "product": "Infinite Scale"
}

Local dev build make -C ocis clean build

{
    "installed": true,
    "maintenance": false,
    "needsDbUpgrade": false,
    "version": "0.0.0.0",
    "versionstring": "0.0.0+1538222a0",
    "edition": "Community",
    "productname": "Infinite Scale",
    "product": "Infinite Scale"
}

1538222a0 is the git commitID

This is valid semver build metadata https://semver.org/#spec-item-10

Pre Releases

go build -v -tags '' -ldflags '-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn -s -w -X "github.com/owncloud/ocis/v2/ocis-pkg/version.String=v2.0.0-beta1" -X "github.com/owncloud/ocis/v2/ocis-pkg/version.Date=20220507"' -o bin/ocis ./cmd/ocis
{
    "installed": true,
    "maintenance": false,
    "needsDbUpgrade": false,
    "version": "2.0.0.0",
    "versionstring": "2.0.0-beta1",
    "edition": "Community",
    "productname": "Infinite Scale",
    "product": "Infinite Scale"
}

Final Releases

go build -v -tags '' -ldflags '-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn -s -w -X "github.com/owncloud/ocis/v2/ocis-pkg/version.String=2.0.0" -X "github.com/owncloud/ocis/v2/ocis-pkg/version.Date=20220507"' -o bin/ocis ./cmd/ocis
{
    "installed": true,
    "maintenance": false,
    "needsDbUpgrade": false,
    "version": "2.0.0.0",
    "versionstring": "2.0.0",
    "edition": "Community",
    "productname": "Infinite Scale",
    "product": "Infinite Scale"
}

Screenshot from the web console

Bildschirmfoto 2022-05-07 um 22 22 22

Motivation and Context

Make bug reports a little bit easier / more precise.

How Has This Been Tested?

Only manually, since it's no code change but only hardcoded values.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • 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:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@kulmann kulmann self-assigned this Dec 23, 2021
@ownclouders
Copy link
Contributor

ownclouders commented Dec 23, 2021

💥 Acceptance test Core-API-Tests-ocis-storage-2 failed. Further test are cancelled...

@kulmann kulmann force-pushed the ocs-version-update branch 2 times, most recently from 40fd0d9 to 32318ee Compare January 4, 2022 11:43
@wkloucek
Copy link
Contributor

wkloucek commented Jan 4, 2022

I fixed the imports, but otherwise looks great.

Building oCIS like in the CI:
go build -v -tags '' -ldflags '-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn -s -w -X "github.com/owncloud/ocis/ocis-pkg/version.String=1.16.0" -X "github.com/owncloud/ocis/ocis-pkg/version.Date=20220104"' -o bin/ocis ./cmd/ocis

and querying the version like curl -k 'https://localhost:9200/ocs/v1.php/cloud/capabilities?format=json' -u einstein:relativity | jq '.ocs.data.version'

will return following for tags:

{
  "major": 1,
  "minor": 16,
  "micro": 0,
  "string": "1.16.0",
  "edition": "Community",
  "product": "oCIS"
}

will return following for non tagged builds:

{
  "major": 0,
  "minor": 0,
  "micro": 0,
  "string": "32318ee70",
  "edition": "Community",
  "product": "oCIS"
}

@kulmann kulmann marked this pull request as ready for review January 4, 2022 11:54
Copy link
Contributor

@wkloucek wkloucek left a comment

Choose a reason for hiding this comment

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

👍

@sonarcloud
Copy link

sonarcloud bot commented Jan 4, 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

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@kulmann
Copy link
Member Author

kulmann commented Jan 4, 2022

@wkloucek
Copy link
Contributor

@kulmann is this still on your roadmap? I would love to see this merged, after we update oC Web the next time (and the needed changes have been done in the SDK).

@kulmann
Copy link
Member Author

kulmann commented Jan 31, 2022

@kulmann is this still on your roadmap? I would love to see this merged, after we update oC Web the next time (and the needed changes have been done in the SDK).

Yes, we're currently working on bringing the most recent version of the sdk to web. When that finally worked I'll check if we can avoid the version check in sdk and then make this enhancement here possible.

@phil-davis
Copy link
Contributor

phil-davis commented Feb 21, 2022

Note: ocs.data.capabilities.core.productname has "ownCloud" for the oC10 product. Should that be set to "oCIS" on the oCIS implementation?

And if so, then the information will be duplicated in ocs.data.version.product

It seems odd to me to have that productname value inside core capabilities - it is not really a "capability", or maybe it is, "I am capable of being an "ownCloud". If so, then productname of the oCIS implementation is still "ownCloud" (I am a feature-equivalent implementation of the "set of capabilities" called "ownCloud").

Maybe oC10 should publish an ocs.data.version.product to make life easier for clients that want to report the product and major/minor/micro version details?

@phil-davis
Copy link
Contributor

In oC10 there is also:

$ curl -u admin:admin http://172.17.0.1:8080/status.php
{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"10.9.2.0","versionstring":"10.9.2 prealpha","edition":"Enterprise","productname":"ownCloud"}

And that has productname. If we want to call it "product" now, then we could make that endpoint return both productname and product fields in oC10, with the same value. That would also make life easy for any clients.

And we could also publish that stuff at an endpoint http://172.17.0.1:8080/status (without .php) so that clients can eventually switch to the endpoint without .php - but maybe that has all been discussed in issues elsewhere?

@micbar
Copy link
Contributor

micbar commented Mar 3, 2022

@kulmann @phil-davis proceed?

@kulmann
Copy link
Member Author

kulmann commented Mar 3, 2022

@kulmann @phil-davis proceed?

Thanks for the reminder. Created owncloud/owncloud-sdk#1016 just now. That needs to be merged and released, then sdk bumped in web, then web released and bumped in oCIS, and then we can update this PR here. Will try to sneak in an intermediate release within the sprint to not keep this open for too long.

@kulmann
Copy link
Member Author

kulmann commented Mar 3, 2022

Note: ocs.data.capabilities.core.productname has "ownCloud" for the oC10 product. Should that be set to "oCIS" on the oCIS implementation?

And if so, then the information will be duplicated in ocs.data.version.product

It seems odd to me to have that productname value inside core capabilities - it is not really a "capability", or maybe it is, "I am capable of being an "ownCloud". If so, then productname of the oCIS implementation is still "ownCloud" (I am a feature-equivalent implementation of the "set of capabilities" called "ownCloud").

Maybe oC10 should publish an ocs.data.version.product to make life easier for clients that want to report the product and major/minor/micro version details?

To be honest I have no clue why we have those two different sections with versioning information. I added the version string to the core capability as well. You're right, it's probably a good idea to announce the product in ocs.data.version.product for oc10 as well. I have the impression that this section is more appropriate for that kind of information. Will make a PR.

@kulmann
Copy link
Member Author

kulmann commented Mar 3, 2022

Also, rebased to current master.

@kulmann kulmann changed the title Set OCS version to up to date values [full-ci] Set OCS version to up to date values Mar 8, 2022
@phil-davis
Copy link
Contributor

Related oC10 core PR is owncloud/core#39851

@kulmann kulmann force-pushed the ocs-version-update branch 2 times, most recently from 332d6aa to 659affe Compare March 12, 2022 20:09
@kulmann
Copy link
Member Author

kulmann commented Mar 14, 2022

@phil-davis or @individual-it could someone from your team take a look why there are so many unexpected passes in the CI runs of this PR? thanks 🙏

@SwikritiT
Copy link
Contributor

@phil-davis or @individual-it could someone from your team take a look why there are so many unexpected passes in the CI runs of this PR? thanks pray

I'll take a look on this

@SwikritiT
Copy link
Contributor

SwikritiT commented Mar 15, 2022

@kulmann The passing tests are sharing related tests relating to permissions
In current master the Viewer role doesn't have the share permission
ViewerPermOld

Neither does the custom permission

customPermission

But In this PR the share permission is available in both
viewerPermNew
customPermissionNew

So all the tests that had the Viewer role with share permission are passing. Similar with custom-permissions.
If this is intended then I can add a commit removing all the passing tests.

The related issues of passing tests are:
#2260
#1277
#1922

@micbar
Copy link
Contributor

micbar commented May 6, 2022

yes guys, I get your point 😓

@micbar micbar force-pushed the ocs-version-update branch 2 times, most recently from b41ce06 to 79b929c Compare May 6, 2022 15:53
@phil-davis
Copy link
Contributor

https://drone.owncloud.com/owncloud/ocis/11550/42/6

-'{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"79b929c88.0","versionstring":"79b929c88","edition":"Community","productname":"oCIS","product":"oCIS"}'
      +'{"installed":true,"maintenance":false,"needsDbUpgrade":false,"version":"79b929c88.0","versionstring":"79b929c88","edition":"Community","productname":"Infinite Scale","product":"ocis"}'

Getting really close. "productname" is "oCIS" in capabilities and "Infinite Scale" in status.php
And "product" is "oCIS" or "ocis" (different case)

@micbar micbar force-pushed the ocs-version-update branch 2 times, most recently from ee8f0d5 to 99c145c Compare May 7, 2022 09:34
kulmann and others added 2 commits May 7, 2022 15:40
Needed to use github.com/Masterminds/semver/v3 instead of v1 to be able
to extract major, minor and patch version from a version string.
Falling back to 0.0.0 in any error case (e.g. if the version.String is a
hash)
@micbar
Copy link
Contributor

micbar commented May 7, 2022

@phil-davis Another improvement, the semver checking needs to be more tolerant.
owncloud/core#40058

@micbar
Copy link
Contributor

micbar commented May 7, 2022

@phil-davis This gets a green testsuite now. I will merge this as soon as the core pipeline is also green.

@micbar micbar force-pushed the ocs-version-update branch 3 times, most recently from 010944d to 1538222 Compare May 7, 2022 19:39
@sonarcloud
Copy link

sonarcloud bot commented May 7, 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 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@butonic butonic merged commit 8f1ecd3 into master May 7, 2022
@delete-merged-branch delete-merged-branch bot deleted the ocs-version-update branch May 7, 2022 21:17
ownclouders pushed a commit that referenced this pull request May 7, 2022
Merge: bae3834 071db57
Author: Jörn Friedrich Dreyer <jfd@owncloud.com>
Date:   Sat May 7 21:17:54 2022 +0000

    Merge pull request #2918 from owncloud/ocs-version-update

    [full-ci] Set OCS version to up to date values
@micbar micbar mentioned this pull request May 8, 2022
45 tasks
@wkloucek wkloucek mentioned this pull request Jun 13, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

status does not have new "product" data item
10 participants