Skip to content

Commit 8f1ecd3

Browse files
authored
Merge pull request #2918 from owncloud/ocs-version-update
[full-ci] Set OCS version to up to date values
2 parents bae3834 + 071db57 commit 8f1ecd3

File tree

10 files changed

+81
-23
lines changed

10 files changed

+81
-23
lines changed

.drone.env

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The test runner source for API tests
2-
CORE_COMMITID=403bd55c38a823f7915a04105e95fad5db84185b
3-
CORE_BRANCH=master
2+
CORE_COMMITID=b19721114df5cefeca22926a97e635245849ddf6
3+
CORE_BRANCH=version-status-php-fix2
44

55
# The test runner source for UI tests
66
WEB_COMMITID=b747d299b66a2f9f11559c8c14ce3d6fd64a6135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Enhancement: Product field in OCS version
2+
3+
We've added a new field to the OCS Version, which is supposed to announce the product name. The web ui as a client will make use of it to make the backend product and version available (e.g. for easier bug reports).
4+
5+
https://github.com/owncloud/ocis/pull/2918

extensions/frontend/pkg/revaconfig/config.go

+12-9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"strconv"
66

77
"github.com/owncloud/ocis/v2/extensions/frontend/pkg/config"
8+
"github.com/owncloud/ocis/v2/ocis-pkg/version"
89
)
910

1011
// FrontendConfigFromStruct will adapt an oCIS config struct into a reva mapstructure to start a reva service.
@@ -138,10 +139,11 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} {
138139
"installed": true,
139140
"maintenance": false,
140141
"needsDbUpgrade": false,
141-
"version": "10.0.11.5",
142-
"versionstring": "10.0.11",
143-
"edition": "community",
144-
"productname": "reva",
142+
"version": version.Long(),
143+
"versionstring": version.GetString(),
144+
"edition": "Community",
145+
"productname": "Infinite Scale",
146+
"product": "Infinite Scale",
145147
"hostname": "",
146148
},
147149
"support_url_signing": true,
@@ -210,11 +212,12 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} {
210212
},
211213
},
212214
"version": map[string]interface{}{
213-
"edition": "reva",
214-
"major": 10,
215-
"minor": 0,
216-
"micro": 11,
217-
"string": "10.0.11",
215+
"product": "Infinite Scale",
216+
"edition": "Community",
217+
"major": version.Parsed().Major(),
218+
"minor": version.Parsed().Minor(),
219+
"micro": version.Parsed().Patch(),
220+
"string": version.GetString(),
218221
},
219222
},
220223
},

extensions/ocdav/pkg/command/server.go

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ func Server(cfg *config.Config) *cli.Command {
5555
ocdav.Prefix(cfg.HTTP.Prefix),
5656
ocdav.GatewaySvc(cfg.Reva.Address),
5757
ocdav.JWTSecret(cfg.TokenManager.JWTSecret),
58+
ocdav.ProductName(cfg.Status.ProductName),
59+
ocdav.Product(cfg.Status.Product),
60+
ocdav.Version(cfg.Status.Version),
61+
ocdav.VersionString(cfg.Status.VersionString),
62+
ocdav.Edition(cfg.Status.Edition),
5863
// ocdav.FavoriteManager() // FIXME needs a proper persistence implementation
5964
// ocdav.LockSystem(), // will default to the CS3 lock system
6065
// ocdav.TLSConfig() // tls config for the http server

extensions/ocdav/pkg/config/config.go

+10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type Config struct {
3333
Middleware Middleware `yaml:"middleware"`
3434

3535
Context context.Context `yaml:"-"`
36+
Status Status `yaml:"-"`
3637
}
3738
type Tracing struct {
3839
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;OCDAV_TRACING_ENABLED" desc:"Activates tracing."`
@@ -75,3 +76,12 @@ type Middleware struct {
7576
type Auth struct {
7677
CredentialsByUserAgent map[string]string `yaml:"credentials_by_user_agent"`
7778
}
79+
80+
// Status holds the configurable values for the status.php
81+
type Status struct {
82+
Version string
83+
VersionString string
84+
Product string
85+
ProductName string
86+
Edition string
87+
}

extensions/ocdav/pkg/config/defaults/defaultconfig.go

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package defaults
22

33
import (
44
"github.com/owncloud/ocis/v2/extensions/ocdav/pkg/config"
5+
"github.com/owncloud/ocis/v2/ocis-pkg/version"
56
)
67

78
func FullDefaultConfig() *config.Config {
@@ -42,6 +43,13 @@ func DefaultConfig() *config.Config {
4243
CredentialsByUserAgent: map[string]string{},
4344
},
4445
},
46+
Status: config.Status{
47+
Version: version.Long(),
48+
VersionString: version.GetString(),
49+
Product: "Infinite Scale",
50+
ProductName: "Infinite Scale",
51+
Edition: "Community",
52+
},
4553
}
4654
}
4755

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ go 1.17
55
require (
66
github.com/CiscoM31/godata v1.0.5
77
github.com/GeertJohan/yubigo v0.0.0-20190917122436-175bc097e60e
8+
github.com/Masterminds/semver v1.5.0
89
github.com/ReneKroon/ttlcache/v2 v2.11.0
910
github.com/blevesearch/bleve/v2 v2.3.2
1011
github.com/blevesearch/bleve_index_api v1.0.1
1112
github.com/coreos/go-oidc/v3 v3.1.0
1213
github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde
13-
github.com/cs3org/reva/v2 v2.3.1-0.20220506133959-1ad146903c6f
14+
github.com/cs3org/reva/v2 v2.3.1-0.20220506154310-71844dde23d4
1415
github.com/disintegration/imaging v1.6.2
1516
github.com/glauth/glauth/v2 v2.0.0-20211021011345-ef3151c28733
1617
github.com/go-chi/chi/v5 v5.0.7
@@ -89,7 +90,6 @@ require (
8990
github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e // indirect
9091
github.com/BurntSushi/toml v1.1.0 // indirect
9192
github.com/Masterminds/goutils v1.1.1 // indirect
92-
github.com/Masterminds/semver v1.5.0 // indirect
9393
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
9494
github.com/Microsoft/go-winio v0.5.1 // indirect
9595
github.com/ProtonMail/go-crypto v0.0.0-20211112122917-428f8eabeeb3 // indirect

go.sum

+2-4
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,8 @@ github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde h1:WrD9O8ZaWvsm0
318318
github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
319319
github.com/cs3org/reva v1.18.0 h1:MbPS5ZAa8RzKcTxAVeSDdISB3XXqLIxqB03BTN5ReBY=
320320
github.com/cs3org/reva v1.18.0/go.mod h1:e5VDUDu4vVWIeVkZcW//n6UZzhGGMa+Tz/whCiX3N6o=
321-
github.com/cs3org/reva/v2 v2.3.0 h1:AwDwqqzAKTrkBz1ifOy3U92C12zk92uBw6LyhLAjCBc=
322-
github.com/cs3org/reva/v2 v2.3.0/go.mod h1:2e/4HcIy54Mic3V7Ow0bz4n5dkZU0dHIZSWomFe5vng=
323-
github.com/cs3org/reva/v2 v2.3.1-0.20220506133959-1ad146903c6f h1:1vv8pODAoBgFGCP7UGoQCxvY6hK3vb6KirlqUNRcRys=
324-
github.com/cs3org/reva/v2 v2.3.1-0.20220506133959-1ad146903c6f/go.mod h1:2e/4HcIy54Mic3V7Ow0bz4n5dkZU0dHIZSWomFe5vng=
321+
github.com/cs3org/reva/v2 v2.3.1-0.20220506154310-71844dde23d4 h1:nr35Kdfp8lnYTxissRlgqIOirIe2NpE3+OEq4GRbGDg=
322+
github.com/cs3org/reva/v2 v2.3.1-0.20220506154310-71844dde23d4/go.mod h1:2e/4HcIy54Mic3V7Ow0bz4n5dkZU0dHIZSWomFe5vng=
325323
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
326324
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY=
327325
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=

ocis-pkg/version/version.go

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,52 @@
11
package version
22

33
import (
4+
"strconv"
45
"time"
6+
7+
"github.com/Masterminds/semver"
58
)
69

710
var (
811
// String gets defined by the build system.
9-
String = "0.0.0"
12+
String = "dev"
1013

1114
// Date indicates the build date.
12-
Date = "00000000"
15+
Date = time.Now().Format("20060102")
1316
)
1417

1518
// Compiled returns the compile time of this service.
1619
func Compiled() time.Time {
1720
t, _ := time.Parse("20060102", Date)
1821
return t
1922
}
23+
24+
// GetString returns a version string with pre-releases and metadata
25+
func GetString() string {
26+
return Parsed().String()
27+
}
28+
29+
// Parsed returns a semver Version
30+
func Parsed() *semver.Version {
31+
versionToParse := String
32+
if String == "dev" {
33+
versionToParse = "0.0.0+dev"
34+
}
35+
parsedVersion, err := semver.NewVersion(versionToParse)
36+
// We have no semver version but a commitid
37+
if err != nil {
38+
parsedVersion, err = semver.NewVersion("0.0.0+" + String)
39+
// this should never happen
40+
if err != nil {
41+
return &semver.Version{}
42+
}
43+
}
44+
return parsedVersion
45+
}
46+
47+
// Long returns the legacy version with 4 number parts like 10.9.8.0
48+
func Long() string {
49+
return strconv.FormatInt(Parsed().Major(), 10) + "." +
50+
strconv.FormatInt(Parsed().Minor(), 10) + "." +
51+
strconv.FormatInt(Parsed().Patch(), 10) + "." + "0"
52+
}

tests/acceptance/expected-failures-API-on-OCIS-storage.md

-4
Original file line numberDiff line numberDiff line change
@@ -1613,10 +1613,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers
16131613

16141614
- [apiMain/checksums.feature:233](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiMain/checksums.feature#L233)
16151615

1616-
#### [status does not have new product data item](https://github.com/owncloud/ocis/issues/3317)
1617-
1618-
- [apiCapabilities/capabilities.feature:959](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiCapabilities/capabilities.feature#L959)
1619-
16201616
#### public links without permission are allowed now
16211617

16221618
- [apiShareUpdateToShares/updateShare.feature:113](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareUpdateToShares/updateShare.feature#L113)

0 commit comments

Comments
 (0)