Skip to content

Commit

Permalink
Merge pull request #2918 from owncloud/ocs-version-update
Browse files Browse the repository at this point in the history
[full-ci] Set OCS version to up to date values
  • Loading branch information
butonic authored May 7, 2022
2 parents bae3834 + 071db57 commit 8f1ecd3
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .drone.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The test runner source for API tests
CORE_COMMITID=403bd55c38a823f7915a04105e95fad5db84185b
CORE_BRANCH=master
CORE_COMMITID=b19721114df5cefeca22926a97e635245849ddf6
CORE_BRANCH=version-status-php-fix2

# The test runner source for UI tests
WEB_COMMITID=b747d299b66a2f9f11559c8c14ce3d6fd64a6135
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/ocs-version-product-field.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Product field in OCS version

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).

https://github.com/owncloud/ocis/pull/2918
21 changes: 12 additions & 9 deletions extensions/frontend/pkg/revaconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strconv"

"github.com/owncloud/ocis/v2/extensions/frontend/pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/version"
)

// FrontendConfigFromStruct will adapt an oCIS config struct into a reva mapstructure to start a reva service.
Expand Down Expand Up @@ -138,10 +139,11 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} {
"installed": true,
"maintenance": false,
"needsDbUpgrade": false,
"version": "10.0.11.5",
"versionstring": "10.0.11",
"edition": "community",
"productname": "reva",
"version": version.Long(),
"versionstring": version.GetString(),
"edition": "Community",
"productname": "Infinite Scale",
"product": "Infinite Scale",
"hostname": "",
},
"support_url_signing": true,
Expand Down Expand Up @@ -210,11 +212,12 @@ func FrontendConfigFromStruct(cfg *config.Config) map[string]interface{} {
},
},
"version": map[string]interface{}{
"edition": "reva",
"major": 10,
"minor": 0,
"micro": 11,
"string": "10.0.11",
"product": "Infinite Scale",
"edition": "Community",
"major": version.Parsed().Major(),
"minor": version.Parsed().Minor(),
"micro": version.Parsed().Patch(),
"string": version.GetString(),
},
},
},
Expand Down
5 changes: 5 additions & 0 deletions extensions/ocdav/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ func Server(cfg *config.Config) *cli.Command {
ocdav.Prefix(cfg.HTTP.Prefix),
ocdav.GatewaySvc(cfg.Reva.Address),
ocdav.JWTSecret(cfg.TokenManager.JWTSecret),
ocdav.ProductName(cfg.Status.ProductName),
ocdav.Product(cfg.Status.Product),
ocdav.Version(cfg.Status.Version),
ocdav.VersionString(cfg.Status.VersionString),
ocdav.Edition(cfg.Status.Edition),
// ocdav.FavoriteManager() // FIXME needs a proper persistence implementation
// ocdav.LockSystem(), // will default to the CS3 lock system
// ocdav.TLSConfig() // tls config for the http server
Expand Down
10 changes: 10 additions & 0 deletions extensions/ocdav/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type Config struct {
Middleware Middleware `yaml:"middleware"`

Context context.Context `yaml:"-"`
Status Status `yaml:"-"`
}
type Tracing struct {
Enabled bool `yaml:"enabled" env:"OCIS_TRACING_ENABLED;OCDAV_TRACING_ENABLED" desc:"Activates tracing."`
Expand Down Expand Up @@ -75,3 +76,12 @@ type Middleware struct {
type Auth struct {
CredentialsByUserAgent map[string]string `yaml:"credentials_by_user_agent"`
}

// Status holds the configurable values for the status.php
type Status struct {
Version string
VersionString string
Product string
ProductName string
Edition string
}
8 changes: 8 additions & 0 deletions extensions/ocdav/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package defaults

import (
"github.com/owncloud/ocis/v2/extensions/ocdav/pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/version"
)

func FullDefaultConfig() *config.Config {
Expand Down Expand Up @@ -42,6 +43,13 @@ func DefaultConfig() *config.Config {
CredentialsByUserAgent: map[string]string{},
},
},
Status: config.Status{
Version: version.Long(),
VersionString: version.GetString(),
Product: "Infinite Scale",
ProductName: "Infinite Scale",
Edition: "Community",
},
}
}

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ go 1.17
require (
github.com/CiscoM31/godata v1.0.5
github.com/GeertJohan/yubigo v0.0.0-20190917122436-175bc097e60e
github.com/Masterminds/semver v1.5.0
github.com/ReneKroon/ttlcache/v2 v2.11.0
github.com/blevesearch/bleve/v2 v2.3.2
github.com/blevesearch/bleve_index_api v1.0.1
github.com/coreos/go-oidc/v3 v3.1.0
github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde
github.com/cs3org/reva/v2 v2.3.1-0.20220506133959-1ad146903c6f
github.com/cs3org/reva/v2 v2.3.1-0.20220506154310-71844dde23d4
github.com/disintegration/imaging v1.6.2
github.com/glauth/glauth/v2 v2.0.0-20211021011345-ef3151c28733
github.com/go-chi/chi/v5 v5.0.7
Expand Down Expand Up @@ -89,7 +90,6 @@ require (
github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e // indirect
github.com/BurntSushi/toml v1.1.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20211112122917-428f8eabeeb3 // indirect
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,8 @@ github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde h1:WrD9O8ZaWvsm0
github.com/cs3org/go-cs3apis v0.0.0-20220412090512-93c5918b4bde/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/reva v1.18.0 h1:MbPS5ZAa8RzKcTxAVeSDdISB3XXqLIxqB03BTN5ReBY=
github.com/cs3org/reva v1.18.0/go.mod h1:e5VDUDu4vVWIeVkZcW//n6UZzhGGMa+Tz/whCiX3N6o=
github.com/cs3org/reva/v2 v2.3.0 h1:AwDwqqzAKTrkBz1ifOy3U92C12zk92uBw6LyhLAjCBc=
github.com/cs3org/reva/v2 v2.3.0/go.mod h1:2e/4HcIy54Mic3V7Ow0bz4n5dkZU0dHIZSWomFe5vng=
github.com/cs3org/reva/v2 v2.3.1-0.20220506133959-1ad146903c6f h1:1vv8pODAoBgFGCP7UGoQCxvY6hK3vb6KirlqUNRcRys=
github.com/cs3org/reva/v2 v2.3.1-0.20220506133959-1ad146903c6f/go.mod h1:2e/4HcIy54Mic3V7Ow0bz4n5dkZU0dHIZSWomFe5vng=
github.com/cs3org/reva/v2 v2.3.1-0.20220506154310-71844dde23d4 h1:nr35Kdfp8lnYTxissRlgqIOirIe2NpE3+OEq4GRbGDg=
github.com/cs3org/reva/v2 v2.3.1-0.20220506154310-71844dde23d4/go.mod h1:2e/4HcIy54Mic3V7Ow0bz4n5dkZU0dHIZSWomFe5vng=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
Expand Down
37 changes: 35 additions & 2 deletions ocis-pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,52 @@
package version

import (
"strconv"
"time"

"github.com/Masterminds/semver"
)

var (
// String gets defined by the build system.
String = "0.0.0"
String = "dev"

// Date indicates the build date.
Date = "00000000"
Date = time.Now().Format("20060102")
)

// Compiled returns the compile time of this service.
func Compiled() time.Time {
t, _ := time.Parse("20060102", Date)
return t
}

// GetString returns a version string with pre-releases and metadata
func GetString() string {
return Parsed().String()
}

// Parsed returns a semver Version
func Parsed() *semver.Version {
versionToParse := String
if String == "dev" {
versionToParse = "0.0.0+dev"
}
parsedVersion, err := semver.NewVersion(versionToParse)
// We have no semver version but a commitid
if err != nil {
parsedVersion, err = semver.NewVersion("0.0.0+" + String)
// this should never happen
if err != nil {
return &semver.Version{}
}
}
return parsedVersion
}

// Long returns the legacy version with 4 number parts like 10.9.8.0
func Long() string {
return strconv.FormatInt(Parsed().Major(), 10) + "." +
strconv.FormatInt(Parsed().Minor(), 10) + "." +
strconv.FormatInt(Parsed().Patch(), 10) + "." + "0"
}
4 changes: 0 additions & 4 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -1613,10 +1613,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers

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

#### [status does not have new product data item](https://github.com/owncloud/ocis/issues/3317)

- [apiCapabilities/capabilities.feature:959](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiCapabilities/capabilities.feature#L959)

#### public links without permission are allowed now

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

0 comments on commit 8f1ecd3

Please sign in to comment.