From 29037ce9899ff139c420e000b45fbf657260884d Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 29 Jul 2022 10:21:23 +0200 Subject: [PATCH 01/30] remove unused length from adoc template --- docs/templates/ADOC.tmpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/templates/ADOC.tmpl b/docs/templates/ADOC.tmpl index 0028eafa222..9082884135d 100644 --- a/docs/templates/ADOC.tmpl +++ b/docs/templates/ADOC.tmpl @@ -8,10 +8,9 @@ | Description {{- range .Fields}} -{{ $numVars := len .EnvVars }} | {{- range $i, $value := .EnvVars }}{{- if $i }} + {{ end -}} -`{{- $value }}` +`{{- $value }}` {{- end }} a| [subs=-attributes] +{{.Type}}+ From e35327cdf28903243b89be7779e84d62b0154661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Tue, 12 Jul 2022 10:27:35 +0200 Subject: [PATCH 02/30] Add a cli for listing and cleaning up expired uploads Fixes #2622 --- services/storage-users/pkg/command/root.go | 1 + services/storage-users/pkg/command/uploads.go | 150 ++++++++++++++++++ services/storage-users/pkg/config/config.go | 1 + .../pkg/config/defaults/defaultconfig.go | 7 +- .../storage-users/pkg/revaconfig/config.go | 1 + 5 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 services/storage-users/pkg/command/uploads.go diff --git a/services/storage-users/pkg/command/root.go b/services/storage-users/pkg/command/root.go index 5ae9e6e86f5..21c3089b6cd 100644 --- a/services/storage-users/pkg/command/root.go +++ b/services/storage-users/pkg/command/root.go @@ -18,6 +18,7 @@ func GetCommands(cfg *config.Config) cli.Commands { Server(cfg), // interaction with this service + Uploads(cfg), // infos about this service Health(cfg), diff --git a/services/storage-users/pkg/command/uploads.go b/services/storage-users/pkg/command/uploads.go new file mode 100644 index 00000000000..0aa7174c348 --- /dev/null +++ b/services/storage-users/pkg/command/uploads.go @@ -0,0 +1,150 @@ +package command + +import ( + "fmt" + "os" + "strconv" + "sync" + "time" + + tusd "github.com/tus/tusd/pkg/handler" + "github.com/urfave/cli/v2" + + "github.com/cs3org/reva/v2/pkg/storage" + "github.com/cs3org/reva/v2/pkg/storage/fs/registry" + "github.com/owncloud/ocis/v2/services/storage-users/pkg/config" + "github.com/owncloud/ocis/v2/services/storage-users/pkg/config/parser" + "github.com/owncloud/ocis/v2/services/storage-users/pkg/revaconfig" +) + +func Uploads(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "uploads", + Usage: "manage uploads", + Before: func(c *cli.Context) error { + if err := parser.ParseConfig(cfg); err != nil { + fmt.Printf("%v", err) + return err + } + return nil + }, + Subcommands: []*cli.Command{ + ListUploads(cfg), + PurgeExpiredUploads(cfg), + }, + } +} + +// ListUploads prints a list of all incomplete uploads +func ListUploads(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "list", + Usage: fmt.Sprintf("Print a list of all incomplete uploads"), + Category: "services", + Before: func(c *cli.Context) error { + err := parser.ParseConfig(cfg) + if err != nil { + fmt.Printf("%v", err) + os.Exit(1) + } + return err + }, + Action: func(c *cli.Context) error { + f, ok := registry.NewFuncs[cfg.Driver] + if !ok { + fmt.Fprintf(os.Stderr, "Unknown filesystem driver '%s'\n", cfg.Driver) + os.Exit(1) + } + drivers := revaconfig.UserDrivers(cfg) + fs, err := f(drivers[cfg.Driver].(map[string]interface{})) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to initialize filesystem driver '%s'\n", cfg.Driver) + return err + } + + managingFS, ok := fs.(storage.UploadsManager) + if !ok { + fmt.Fprintf(os.Stderr, "'%s' storage does not support listing expired uploads\n", cfg.Driver) + os.Exit(1) + } + + uploads, err := managingFS.ListUploads() + if err != nil { + return err + } + + fmt.Println("Incomplete uploads:") + for _, u := range uploads { + fmt.Printf(" - %s (%s, Size: %d, Expires: %s)\n", u.ID, u.MetaData["filename"], u.Size, expiredString(u.MetaData["expires"])) + } + return nil + }, + } +} + +// PurgeExpiredUploads is the entry point for the server command. +func PurgeExpiredUploads(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "purge", + Usage: fmt.Sprintf("Let %s extension clean up leftovers from expired downloads", cfg.Service.Name), + Category: "services", + Before: func(c *cli.Context) error { + err := parser.ParseConfig(cfg) + if err != nil { + fmt.Printf("%v", err) + os.Exit(1) + } + return err + }, + Action: func(c *cli.Context) error { + f, ok := registry.NewFuncs[cfg.Driver] + if !ok { + fmt.Fprintf(os.Stderr, "Unknown filesystem driver '%s'\n", cfg.Driver) + os.Exit(1) + } + drivers := revaconfig.UserDrivers(cfg) + fs, err := f(drivers[cfg.Driver].(map[string]interface{})) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to initialize filesystem driver '%s'\n", cfg.Driver) + return err + } + + managingFS, ok := fs.(storage.UploadsManager) + if !ok { + fmt.Fprintf(os.Stderr, "'%s' storage does not support purging expired uploads\n", cfg.Driver) + os.Exit(1) + } + + wg := sync.WaitGroup{} + wg.Add(1) + purgedChannel := make(chan tusd.FileInfo) + + go func() { + for purged := range purgedChannel { + fmt.Printf("Purging %s (Filename: %s, Size: %d, Expires: %s)\n", + purged.ID, purged.MetaData["filename"], purged.Size, expiredString(purged.MetaData["expires"])) + + } + wg.Done() + }() + + err = managingFS.PurgeExpiredUploads(purgedChannel) + close(purgedChannel) + wg.Wait() + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to purge expired uploads '%s'\n", err) + return err + } + return nil + }, + } +} + +func expiredString(e string) string { + expired := "N/A" + iExpires, err := strconv.Atoi(e) + if err == nil { + expired = time.Unix(int64(iExpires), 0).Format(time.RFC3339) + } + return expired +} diff --git a/services/storage-users/pkg/config/config.go b/services/storage-users/pkg/config/config.go index f84aeb6e80c..4e4b733540c 100644 --- a/services/storage-users/pkg/config/config.go +++ b/services/storage-users/pkg/config/config.go @@ -28,6 +28,7 @@ type Config struct { MountID string `yaml:"mount_id" env:"STORAGE_USERS_MOUNT_ID" desc:"Mount ID of this storage."` ExposeDataServer bool `yaml:"expose_data_server" env:"STORAGE_USERS_EXPOSE_DATA_SERVER" desc:"Exposes the data server directly to users and bypasses the data gateway. Ensure that the data server address is reachable by users."` ReadOnly bool `yaml:"readonly" env:"STORAGE_USERS_READ_ONLY" desc:"Set this storage to be read-only."` + UploadExpiration int64 `yaml:"upload_expiration" env:"STORAGE_USERS_UPLOAD_EXPIRATION" desc:"Duration after which uploads will expire."` Supervised bool `yaml:"-"` Context context.Context `yaml:"-"` diff --git a/services/storage-users/pkg/config/defaults/defaultconfig.go b/services/storage-users/pkg/config/defaults/defaultconfig.go index e792c92077a..6448a8b82aa 100644 --- a/services/storage-users/pkg/config/defaults/defaultconfig.go +++ b/services/storage-users/pkg/config/defaults/defaultconfig.go @@ -39,9 +39,10 @@ func DefaultConfig() *config.Config { Reva: &config.Reva{ Address: "127.0.0.1:9142", }, - DataServerURL: "http://localhost:9158/data", - MountID: "1284d238-aa92-42ce-bdc4-0b0000009157", - Driver: "ocis", + DataServerURL: "http://localhost:9158/data", + MountID: "1284d238-aa92-42ce-bdc4-0b0000009157", + UploadExpiration: 24 * 60 * 60, + Driver: "ocis", Drivers: config.Drivers{ OwnCloudSQL: config.OwnCloudSQLDriver{ Root: filepath.Join(defaults.BaseDataPath(), "storage", "owncloud"), diff --git a/services/storage-users/pkg/revaconfig/config.go b/services/storage-users/pkg/revaconfig/config.go index 21ce7f2e736..c6a2a713eb4 100644 --- a/services/storage-users/pkg/revaconfig/config.go +++ b/services/storage-users/pkg/revaconfig/config.go @@ -29,6 +29,7 @@ func StorageUsersConfigFromStruct(cfg *config.Config) map[string]interface{} { "mount_id": cfg.MountID, "expose_data_server": cfg.ExposeDataServer, "data_server_url": cfg.DataServerURL, + "upload_expiration": cfg.UploadExpiration, }, }, "interceptors": map[string]interface{}{ From 51282fc277a9558bd4259bb8dda2e5c9b80ac9e8 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 4 Aug 2022 10:24:52 +0200 Subject: [PATCH 03/30] pin wopiserver to v8.3.3 for continous deployment examples --- deployments/examples/ocis_wopi/.env | 2 +- deployments/examples/ocis_wopi/docker-compose.yml | 2 +- docs/ocis/deployment/ocis_wopi.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deployments/examples/ocis_wopi/.env b/deployments/examples/ocis_wopi/.env index 003e205896d..4f094654801 100644 --- a/deployments/examples/ocis_wopi/.env +++ b/deployments/examples/ocis_wopi/.env @@ -24,7 +24,7 @@ ADMIN_PASSWORD= DEMO_USERS= ### Wopi server settings ### -# cs3org wopi server version. Defaults to "latest" +# cs3org wopi server version. Defaults to "v8.3.3" WOPISERVER_DOCKER_TAG= # cs3org wopi server domain. Defaults to "wopiserver.owncloud.test" WOPISERVER_DOMAIN= diff --git a/deployments/examples/ocis_wopi/docker-compose.yml b/deployments/examples/ocis_wopi/docker-compose.yml index 3c4a40be551..90083d9024a 100644 --- a/deployments/examples/ocis_wopi/docker-compose.yml +++ b/deployments/examples/ocis_wopi/docker-compose.yml @@ -131,7 +131,7 @@ services: driver: "local" restart: always wopiserver: - image: cs3org/wopiserver:${WOPISERVER_DOCKER_TAG:-latest} + image: cs3org/wopiserver:${WOPISERVER_DOCKER_TAG:-v8.3.3} networks: ocis-net: entrypoint: diff --git a/docs/ocis/deployment/ocis_wopi.md b/docs/ocis/deployment/ocis_wopi.md index 964f68dc4ff..658cd56f798 100644 --- a/docs/ocis/deployment/ocis_wopi.md +++ b/docs/ocis/deployment/ocis_wopi.md @@ -80,7 +80,7 @@ See also [example server setup]({{< ref "preparing_server" >}}) DEMO_USERS= ### Wopi server settings ### - # cs3org wopi server version. Defaults to "latest" + # cs3org wopi server version. Defaults to "v8.3.3" WOPISERVER_DOCKER_TAG= # cs3org wopi server domain. Defaults to "wopiserver.owncloud.test" WOPISERVER_DOMAIN= From 94646c80609f06c8eee9072e62ca07ebfc9dd369 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 5 Aug 2022 13:48:22 +0200 Subject: [PATCH 04/30] add middleware to rewrite the /.well-known/openid-configuration endpoint for external idps --- ...rewrite-well-known-openid-configuration.md | 10 ++++ services/proxy/pkg/command/server.go | 5 ++ services/proxy/pkg/config/config.go | 1 + .../proxy/pkg/middleware/oidc_well-known.go | 54 +++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 changelog/unreleased/feature-rewrite-well-known-openid-configuration.md create mode 100644 services/proxy/pkg/middleware/oidc_well-known.go diff --git a/changelog/unreleased/feature-rewrite-well-known-openid-configuration.md b/changelog/unreleased/feature-rewrite-well-known-openid-configuration.md new file mode 100644 index 00000000000..92ce995ffd8 --- /dev/null +++ b/changelog/unreleased/feature-rewrite-well-known-openid-configuration.md @@ -0,0 +1,10 @@ +Enhancement: Fix behavior for foobar (in present tense) + +We've added the configuration option `PROXY_OIDC_REWRITE_WELLKNOWN` to rewrite the `/.well-known/openid-configuration` endpoint. +If active, it serves the `/.well-known/openid-configuration` response of the original IDP configured in `OCIS_OIDC_ISSUER` / `PROXY_OIDC_ISSUER`. This is needed so that the Desktop Client, Android Client and iOS Client can discover the OIDC identity provider. + +Previously this rewrite needed to be performed with an external proxy as NGINX or Traefik if an external IDP was used. + +https://github.com/owncloud/ocis/pull/4346 +https://github.com/owncloud/ocis/issues/2819 +https://github.com/owncloud/ocis/issues/3280 diff --git a/services/proxy/pkg/command/server.go b/services/proxy/pkg/command/server.go index 5ce0d1373a7..81342945f12 100644 --- a/services/proxy/pkg/command/server.go +++ b/services/proxy/pkg/command/server.go @@ -173,6 +173,11 @@ func loadMiddlewares(ctx context.Context, logger log.Logger, cfg *config.Config) chimiddleware.RequestID, middleware.AccessLog(logger), middleware.HTTPSRedirect, + middleware.OIDCWellKnownRewrite( + logger, cfg.OIDC.Issuer, + cfg.OIDC.RewriteWellKnown, + oidcHTTPClient, + ), // now that we established the basics, on with authentication middleware middleware.Authentication( diff --git a/services/proxy/pkg/config/config.go b/services/proxy/pkg/config/config.go index 2b9118deabc..ce98f8ede2f 100644 --- a/services/proxy/pkg/config/config.go +++ b/services/proxy/pkg/config/config.go @@ -95,6 +95,7 @@ type OIDC struct { AccessTokenVerifyMethod string `yaml:"access_token_verify_method" env:"PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD" desc:"Sets how OIDC access tokens should be verified. Possible values are 'none' and 'jwt'. When using 'none', no special validation apart from using it for accessing the IPD's userinfo endpoint will be done. When using 'jwt', it tries to parse the access token as a jwt token and verifies the signature using the keys published on the IDP's 'jwks_uri'."` UserinfoCache UserinfoCache `yaml:"user_info_cache"` JWKS JWKS `yaml:"jwks"` + RewriteWellKnown bool `yaml:"rewrite_well_known" env:"PROXY_OIDC_REWRITE_WELLKNOWN" desc:"Enables rewriting the /.well-known/openid-configuration to the configured OIDC issuer. Needed by the Desktop Client, Android Client and iOS Client to discover the OIDC provider."` } type JWKS struct { diff --git a/services/proxy/pkg/middleware/oidc_well-known.go b/services/proxy/pkg/middleware/oidc_well-known.go new file mode 100644 index 00000000000..26db70a58b1 --- /dev/null +++ b/services/proxy/pkg/middleware/oidc_well-known.go @@ -0,0 +1,54 @@ +package middleware + +import ( + "io" + "net/http" + "net/url" + "path" + + "github.com/owncloud/ocis/v2/ocis-pkg/log" +) + +var ( + wellKnownPath = "/.well-known/openid-configuration" +) + +// OIDCWellKnownRewrite is a middleware that rewrites the /.well-known/openid-configuration endpoint for external IDPs. +func OIDCWellKnownRewrite(logger log.Logger, oidcISS string, rewrite bool, oidcClient *http.Client) func(http.Handler) http.Handler { + + oidcURL, _ := url.Parse(oidcISS) + oidcURL.Path = path.Join(oidcURL.Path, wellKnownPath) + + return func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if rewrite && path.Clean(r.URL.Path) == wellKnownPath { + + wellKnownRes, err := oidcClient.Get(oidcURL.String()) + if err != nil { + logger.Error(). + Err(err). + Str("middleware", "oidc wellknown rewrite"). + Str("url", oidcURL.String()). + Msg("get information from url failed") + w.WriteHeader(http.StatusInternalServerError) + } + defer wellKnownRes.Body.Close() + + copyHeader(w.Header(), wellKnownRes.Header) + w.WriteHeader(wellKnownRes.StatusCode) + io.Copy(w, wellKnownRes.Body) + + return + } + next.ServeHTTP(w, r) + }) + } +} + +func copyHeader(dst, src http.Header) { + for k, vv := range src { + for _, v := range vv { + dst.Add(k, v) + } + } +} From 205f87f987d9bbf34877a1819cefe1a9e998e9b1 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Fri, 5 Aug 2022 14:12:08 +0200 Subject: [PATCH 05/30] adapt deployment examples --- .../examples/oc10_ocis_parallel/docker-compose.yml | 12 +----------- .../examples/ocis_keycloak/docker-compose.yml | 10 +--------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/deployments/examples/oc10_ocis_parallel/docker-compose.yml b/deployments/examples/oc10_ocis_parallel/docker-compose.yml index 114398b744d..c24ad7a6d2b 100644 --- a/deployments/examples/oc10_ocis_parallel/docker-compose.yml +++ b/deployments/examples/oc10_ocis_parallel/docker-compose.yml @@ -70,6 +70,7 @@ services: environment: # Keycloak IDP specific configuration OCIS_OIDC_ISSUER: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}/auth/realms/${KEYCLOAK_REALM:-owncloud} + PROXY_OIDC_REWRITE_WELLKNOWN: "true" WEB_OIDC_CLIENT_ID: ocis-web WEB_OIDC_SCOPE: openid profile email owncloud # external ldap is supposed to be read only @@ -227,17 +228,6 @@ services: - "traefik.http.routers.keycloak.tls.certresolver=http" - "traefik.http.routers.keycloak.service=keycloak" - "traefik.http.services.keycloak.loadbalancer.server.port=8080" - # let /.well-known/openid-configuration be served by Keycloak - # so that clients (Desktop, iOS and Android) can detect OIDC, 302 redirect is not valid according RFC - # https://doc.owncloud.com/server/admin_manual/configuration/user/oidc/#set-up-service-discovery - - "traefik.http.middlewares.idp-headers.headers.customrequestheaders.X-Forwarded-Host=${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}" - - "traefik.http.middlewares.idp-prefix.addprefix.prefix=/auth/realms/${KEYCLOAK_REALM:-owncloud}" - - "traefik.http.middlewares.idp-override.chain.middlewares=idp-headers,idp-prefix" - - "traefik.http.routers.idp-wellknown.entrypoints=https" - - "traefik.http.routers.idp-wellknown.tls.certresolver=http" - - "traefik.http.routers.idp-wellknown.rule=Host(`${CLOUD_DOMAIN:-cloud.owncloud.test}`) && Path(`/.well-known/openid-configuration`)" - - "traefik.http.routers.idp-wellknown.middlewares=idp-override" - - "traefik.http.routers.idp-wellknown.service=keycloak" logging: driver: "local" restart: always diff --git a/deployments/examples/ocis_keycloak/docker-compose.yml b/deployments/examples/ocis_keycloak/docker-compose.yml index 7fbb44ae953..630ca1b70ea 100644 --- a/deployments/examples/ocis_keycloak/docker-compose.yml +++ b/deployments/examples/ocis_keycloak/docker-compose.yml @@ -57,6 +57,7 @@ services: # Keycloak IDP specific configuration PROXY_AUTOPROVISION_ACCOUNTS: "true" OCIS_OIDC_ISSUER: https://${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}/auth/realms/${KEYCLOAK_REALM:-oCIS} + PROXY_OIDC_REWRITE_WELLKNOWN: "true" WEB_OIDC_CLIENT_ID: ${OCIS_OIDC_CLIENT_ID:-web} # general config OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test} @@ -121,15 +122,6 @@ services: - "traefik.http.routers.keycloak.tls.certresolver=http" - "traefik.http.routers.keycloak.service=keycloak" - "traefik.http.services.keycloak.loadbalancer.server.port=8080" - # let /.well-known/openid-configuration be served by Keycloak - - "traefik.http.middlewares.idp-headers.headers.customrequestheaders.X-Forwarded-Host=${KEYCLOAK_DOMAIN:-keycloak.owncloud.test}" - - "traefik.http.middlewares.idp-prefix.addprefix.prefix=/auth/realms/${KEYCLOAK_REALM:-oCIS}" - - "traefik.http.middlewares.idp-override.chain.middlewares=idp-headers,idp-prefix" - - "traefik.http.routers.idp-wellknown.entrypoints=https" - - "traefik.http.routers.idp-wellknown.tls.certresolver=http" - - "traefik.http.routers.idp-wellknown.rule=Host(`${OCIS_DOMAIN:-ocis.owncloud.test}`) && Path(`/.well-known/openid-configuration`)" - - "traefik.http.routers.idp-wellknown.middlewares=idp-override" - - "traefik.http.routers.idp-wellknown.service=keycloak" depends_on: - postgres logging: From 60642208f9495de328235de5bf9d075d2084eade Mon Sep 17 00:00:00 2001 From: sushmita56 Date: Tue, 2 Aug 2022 17:25:39 +0545 Subject: [PATCH 06/30] added test for copy folder operation modified steps of scenarios related to shares jail space updated expected to failure by shares jail addressed review removed shares jail expected to failure --- ...ected-failures-localAPI-on-OCIS-storage.md | 18 +- .../features/apiSpaces/copySpaces.feature | 184 +++++++++++++++++- .../features/apiSpaces/moveSpaces.feature | 12 +- 3 files changed, 185 insertions(+), 29 deletions(-) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index b36b50d7238..1874e6f1f03 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -22,25 +22,9 @@ The expected failures in this file are from features in the owncloud/ocis repo. ### [Search by shares jail works incorrect](https://github.com/owncloud/ocis/issues/4014) - [apiSpaces/search.feature:43](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/search.feature#L43) -### [Depth infinity not supported for space Shares Jail](https://github.com/owncloud/ocis/issues/4188) -- [apiSpaces/copySpaces.feature:112](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/copySpaces.feature#L112) -- [apiSpaces/copySpaces.feature:113](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/copySpaces.feature#L113) -- [apiSpaces/copySpaces.feature:114](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/copySpaces.feature#L114) -- [apiSpaces/copySpaces.feature:163](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/copySpaces.feature#L163) -- [apiSpaces/copySpaces.feature:260](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/copySpaces.feature#L260) -- [apiSpaces/copySpaces.feature:261](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/copySpaces.feature#L261) -- [apiSpaces/moveSpaces.feature:161](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/moveSpaces.feature#L161) -- [apiSpaces/moveSpaces.feature:162](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/moveSpaces.feature#L162) -- [apiSpaces/moveSpaces.feature:181](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/moveSpaces.feature#L181) -- [apiSpaces/moveSpaces.feature:182](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/moveSpaces.feature#L182) -- [apiSpaces/moveSpaces.feature:183](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/moveSpaces.feature#L183) -- [apiSpaces/moveSpaces.feature:184](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/moveSpaces.feature#L184) -- [apiSpaces/moveSpaces.feature:185](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/moveSpaces.feature#L185) -- [apiSpaces/moveSpaces.feature:186](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/moveSpaces.feature#L186) -- [apiSpaces/moveSpaces.feature:189](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/moveSpaces.feature#L189) - ### [Changing personal drive quota on another user as admin is not possible](https://github.com/owncloud/ocis/issues/4325) - [apiSpaces/changeSpaces.feature:221](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/changeSpaces.feature#L221) - [apiSpaces/changeSpaces.feature:222](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/changeSpaces.feature#L222) - [apiSpaces/changeSpaces.feature:223](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/changeSpaces.feature#L223) - [apiSpaces/changeSpaces.feature:224](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/changeSpaces.feature#L224) + diff --git a/tests/acceptance/features/apiSpaces/copySpaces.feature b/tests/acceptance/features/apiSpaces/copySpaces.feature index 03711d0f0a2..3d0cfa13d05 100644 --- a/tests/acceptance/features/apiSpaces/copySpaces.feature +++ b/tests/acceptance/features/apiSpaces/copySpaces.feature @@ -104,8 +104,8 @@ Feature: copy file And user "Alice" has accepted share "/testshare" offered by user "Brian" When user "Alice" copies file "project.txt" from space "Project" to "/testshare/project.txt" inside space "Shares Jail" using the WebDAV API Then the HTTP status code should be "201" - And for user "Alice" the space "Shares Jail" should contain these entries: - | /testshare/project.txt | + And for user "Alice" folder "testshare" of the space "Shares Jail" should contain these files: + | project.txt | And for user "Alice" the content of the file "/testshare/project.txt" of the space "Shares Jail" should be "Project content" Examples: | role | @@ -167,8 +167,8 @@ Feature: copy file And user "Alice" has uploaded file with content "personal content" to "personal.txt" When user "Alice" copies file "personal.txt" from space "Personal" to "/testshare/personal.txt" inside space "Shares Jail" using the WebDAV API Then the HTTP status code should be "201" - And for user "Alice" the space "Shares Jail" should contain these entries: - | /testshare/personal.txt | + And for user "Alice" folder "testshare" of the space "Shares Jail" should contain these files: + | personal.txt | And for user "Alice" the content of the file "/testshare/personal.txt" of the space "Shares Jail" should be "personal content" @@ -249,8 +249,8 @@ Feature: copy file And user "Alice" has accepted share "/testshare2" offered by user "Brian" When user "Alice" copies file "/testshare1/testshare1.txt" from space "Shares Jail" to "/testshare2/testshare1.txt" inside space "Shares Jail" using the WebDAV API Then the HTTP status code should be "201" - And for user "Alice" the space "Shares Jail" should contain these entries: - | /testshare2/testshare1.txt | + And for user "Alice" folder "testshare2" of the space "Shares Jail" should contain these files: + | testshare1.txt | And for user "Brian" the space "Personal" should contain these entries: | /testshare2/testshare1.txt | And for user "Alice" the content of the file "/testshare2/testshare1.txt" of the space "Shares Jail" should be "testshare1 content" @@ -279,3 +279,175 @@ Feature: copy file | permissions | | 31 | | 17 | + + + Scenario Outline: Copying a folder within the same space project with different role + Given the administrator has given "Alice" the role "Space Admin" using the settings api + And user "Alice" has created a space "Project" with the default quota using the GraphApi + And user "Alice" has created a folder "folder1" in space "Project" + And user "Alice" has created a folder "folder2" in space "Project" + And user "Alice" has uploaded a file inside space "Project" with content "some content" to "folder2/demo.txt" + And user "Alice" has shared a space "Project" to user "Brian" with role "" + When user "Brian" copies folder "folder2" to "folder1/folder2" inside space "Project" using the WebDAV API + Then the HTTP status code should be "" + And for user "Brian" the space "Project" contain these entries: + | folder1/folder2/demo.txt | + Examples: + | role | shouldOrNot | status-code | + | manager | should | 201 | + | editor | should | 201 | + | viewer | should not | 403 | + + + + Scenario Outline: User copies a folder from a space project with different role to a space project with different role + Given the administrator has given "Brian" the role "Space Admin" using the settings api + And user "Brian" has created a space "Project1" with the default quota using the GraphApi + And user "Brian" has created a space "Project2" with the default quota using the GraphApi + And user "Brian" has created a folder "folder1" in space "Project1" + And user "Brian" has uploaded a file inside space "Project1" with content "some content" to "/folder1/demo.txt" + And user "Brian" has shared a space "Project2" to user "Alice" with role "" + And user "Brian" has shared a space "Project1" to user "Alice" with role "" + When user "Alice" copies folder "folder1" from space "Project1" to "folder1" inside space "Project2" using the WebDAV API + Then the HTTP status code should be "" + And for user "Alice" the space "Project2" contain these entries: + | folder1/demo.txt | + Examples: + | from_role | to_role | status-code | shouldOrNot | + | manager | manager | 201 | should | + | manager | editor | 201 | should | + | editor | manager | 201 | should | + | editor | editor | 201 | should | + | manager | viewer | 403 | should not | + | editor | viewer | 403 | should not | + | viewer | viewer | 403 | should not | + + + Scenario Outline: User copies a folder from space project with different role to space personal + Given the administrator has given "Brian" the role "Space Admin" using the settings api + And user "Brian" has created a space "Project" with the default quota using the GraphApi + And user "Brian" has created a folder "folder1" in space "Project" + And user "Brian" has uploaded a file inside space "Project" with content "some content" to "/folder1/demo.txt" + And user "Brian" has shared a space "Project" to user "Alice" with role "" + When user "Alice" copies file "folder1" from space "Project" to "folder1" inside space "Personal" using the WebDAV API + Then the HTTP status code should be "201" + And for user "Alice" the space "Personal" should contain these entries: + | folder1/demo.txt | + Examples: + | role | + | manager | + | editor | + | viewer | + + + Scenario Outline: User copies a folder from space project with different role to space shares jail with different role + Given the administrator has given "Brian" the role "Space Admin" using the settings api + And user "Brian" has created a space "Project" with the default quota using the GraphApi + And user "Brian" has created folder "/testshare" + And user "Brian" has created a folder "folder1" in space "Project" + And user "Brian" has uploaded a file inside space "Project" with content "some content" to "/folder1/demo.txt" + And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "" + And user "Alice" has accepted share "/testshare" offered by user "Brian" + When user "Alice" copies folder "folder1" from space "Project" to "/testshare/folder1" inside space "Shares Jail" using the WebDAV API + Then the HTTP status code should be "" + And for user "Alice" folder "testshare" of the space "Shares Jail" contain these files: + | folder1/demo.txt | + Examples: + | role | shouldOrNot | permissions | status-code | + | manager | should | 31 | 201 | + | editor | should | 31 | 201 | + | viewer | should | 31 | 201 | + | manager | should not | 17 | 403 | + | editor | should not | 17 | 403 | + | viewer | should not | 17 | 403 | + + + Scenario Outline: User copies a folder from space personal to space project with different role + Given the administrator has given "Brian" the role "Space Admin" using the settings api + And user "Brian" has created a space "Project" with the default quota using the GraphApi + And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Alice" has created folder "folder1" + And user "Alice" has uploaded file with content "some content" to "folder1/demo.txt" + When user "Alice" copies folder "folder1" from space "Personal" to "folder1" inside space "Project" using the WebDAV API + Then the HTTP status code should be "" + And for user "Alice" the space "Project" contain these entries: + | folder1/demo.txt | + Examples: + | role | shouldOrNot | status-code | + | manager | should | 201 | + | editor | should | 201 | + | viewer | should not | 403 | + + + Scenario Outline: User copies a folder from space personal to space shares jail with different permmissions + Given user "Brian" has created folder "/testshare" + And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "" + And user "Alice" has accepted share "/testshare" offered by user "Brian" + And user "Alice" has created folder "folder1" + And user "Alice" has uploaded file with content "some content" to "folder1/demo.txt" + When user "Alice" copies folder "folder1" from space "Personal" to "/testshare/folder1" inside space "Shares Jail" using the WebDAV API + Then the HTTP status code should be "" + And for user "Alice" folder "testshare" of the space "Shares Jail" contain these files: + | folder1/demo.txt | + Examples: + | permissions | shouldOrNot | status-code | + | 31 | should | 201 | + | 17 | should not | 403 | + + + Scenario Outline: User copies a folder from space shares jail with different role to space personal + Given the administrator has given "Brian" the role "Space Admin" using the settings api + And user "Brian" has created folder "/testshare" + And user "Brian" has uploaded file with content "testshare content" to "/testshare/testshare.txt" + And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "" + And user "Alice" has accepted share "/testshare" offered by user "Brian" + When user "Alice" copies file "/testshare/testshare.txt" from space "Shares Jail" to "testshare.txt" inside space "Personal" using the WebDAV API + Then the HTTP status code should be "201" + And for user "Alice" the space "Personal" should contain these entries: + | /testshare.txt | + And for user "Alice" the content of the file "/testshare.txt" of the space "Personal" should be "testshare content" + Examples: + | permissions | + | 31 | + | 17 | + + + Scenario Outline: User copies a folder from space shares jail with different role to space project with different role + Given the administrator has given "Brian" the role "Space Admin" using the settings api + And user "Brian" has created a space "Project" with the default quota using the GraphApi + And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has created folder "/testshare" + And user "Brian" has created folder "/testshare/folder1" + And user "Brian" has uploaded file with content "testshare content" to "/testshare/folder1/testshare.txt" + And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "" + And user "Alice" has accepted share "/testshare" offered by user "Brian" + When user "Alice" copies folder "/testshare/folder1" from space "Shares Jail" to "folder1" inside space "Project" using the WebDAV API + Then the HTTP status code should be "201" + And for user "Alice" the space "Project" should contain these entries: + | /folder1/testshare.txt | + Examples: + | role | permissions | + | manager | 31 | + | manager | 17 | + | editor | 31 | + | editor | 17 | + + + Scenario Outline: User copies a folder from space shares jail with different role to space project with role viewer + Given the administrator has given "Brian" the role "Space Admin" using the settings api + And user "Brian" has created a space "Project" with the default quota using the GraphApi + And user "Brian" has shared a space "Project" to user "Alice" with role "" + And user "Brian" has created folder "/testshare" + And user "Brian" has created folder "/testshare/folder1" + And user "Brian" has uploaded file with content "testshare content" to "/testshare/folder1/testshare.txt" + And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "" + And user "Alice" has accepted share "/testshare" offered by user "Brian" + When user "Alice" copies folder "/testshare/folder1" from space "Shares Jail" to "folder1" inside space "Project" using the WebDAV API + Then the HTTP status code should be "403" + And for user "Alice" the space "Project" should not contain these entries: + | /folder1/testshare.txt | + Examples: + | permissions | + | 31 | + | 17 | \ No newline at end of file diff --git a/tests/acceptance/features/apiSpaces/moveSpaces.feature b/tests/acceptance/features/apiSpaces/moveSpaces.feature index 70ceeadcf60..355dbe24353 100644 --- a/tests/acceptance/features/apiSpaces/moveSpaces.feature +++ b/tests/acceptance/features/apiSpaces/moveSpaces.feature @@ -154,8 +154,8 @@ Feature: move (rename) file Then the HTTP status code should be "502" And for user "Alice" the space "Personal" should not contain these entries: | testshare.txt | - And for user "Alice" the space "Shares Jail" should contain these entries: - | /testshare/testshare.txt | + And for user "Alice" folder "testshare" of the space "Shares Jail" should contain these entries: + | testshare.txt | Examples: | permissions | | 31 | @@ -174,8 +174,8 @@ Feature: move (rename) file Then the HTTP status code should be "502" And for user "Alice" the space "Project" should not contain these entries: | /testshare.txt | - And for user "Alice" the space "Shares Jail" should contain these entries: - | /testshare/testshare.txt | + And for user "Alice" folder "testshare" of the space "Shares Jail" should contain these entries: + | testshare.txt | Examples: | role | permissions | | manager | 31 | @@ -196,8 +196,8 @@ Feature: move (rename) file And user "Alice" has accepted share "/testshare2" offered by user "Brian" When user "Alice" moves file "/testshare1/testshare1.txt" from space "Shares Jail" to "/testshare2/testshare1.txt" inside space "Shares Jail" using the WebDAV API Then the HTTP status code should be "201" - And for user "Alice" the space "Shares Jail" should contain these entries: - | /testshare2/testshare1.txt | + And for user "Alice" folder "testshare2" of the space "Shares Jail" should contain these entries: + | testshare1.txt | And for user "Brian" the space "Personal" should contain these entries: | /testshare2/testshare1.txt | From 757fbcf9b5736e4091c0f9a6479479783c6c0b2b Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Mon, 8 Aug 2022 11:51:26 +0200 Subject: [PATCH 07/30] Bump protoc-gen-microweb to include latest fixes Closes #4276 --- .bingo/Variables.mk | 6 +- .bingo/protoc-gen-microweb.mod | 2 +- .bingo/protoc-gen-microweb.sum | 2 + .bingo/variables.env | 2 +- .../ocis/services/search/v0/search.pb.web.go | 19 +++- .../services/settings/v0/settings.pb.web.go | 91 ++++++++++++++++--- .../ocis/services/store/v0/store.pb.micro.go | 5 + 7 files changed, 104 insertions(+), 23 deletions(-) diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index 324175d295b..54a8f3c2f3f 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -89,11 +89,11 @@ $(PROTOC_GEN_MICRO): $(BINGO_DIR)/protoc-gen-micro.mod @echo "(re)installing $(GOBIN)/protoc-gen-micro-v1.0.0" @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-micro.mod -o=$(GOBIN)/protoc-gen-micro-v1.0.0 "github.com/go-micro/generator/cmd/protoc-gen-micro" -PROTOC_GEN_MICROWEB := $(GOBIN)/protoc-gen-microweb-v0.0.0-20220407065143-a4a3e07bbb7c +PROTOC_GEN_MICROWEB := $(GOBIN)/protoc-gen-microweb-v0.0.0-20220808092353-b5d6c3960e19 $(PROTOC_GEN_MICROWEB): $(BINGO_DIR)/protoc-gen-microweb.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. - @echo "(re)installing $(GOBIN)/protoc-gen-microweb-v0.0.0-20220407065143-a4a3e07bbb7c" - @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-microweb.mod -o=$(GOBIN)/protoc-gen-microweb-v0.0.0-20220407065143-a4a3e07bbb7c "github.com/owncloud/protoc-gen-microweb" + @echo "(re)installing $(GOBIN)/protoc-gen-microweb-v0.0.0-20220808092353-b5d6c3960e19" + @cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-microweb.mod -o=$(GOBIN)/protoc-gen-microweb-v0.0.0-20220808092353-b5d6c3960e19 "github.com/owncloud/protoc-gen-microweb" PROTOC_GEN_OPENAPIV2 := $(GOBIN)/protoc-gen-openapiv2-v2.10.0 $(PROTOC_GEN_OPENAPIV2): $(BINGO_DIR)/protoc-gen-openapiv2.mod diff --git a/.bingo/protoc-gen-microweb.mod b/.bingo/protoc-gen-microweb.mod index 0fbb47f4ad1..339b0e48580 100644 --- a/.bingo/protoc-gen-microweb.mod +++ b/.bingo/protoc-gen-microweb.mod @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT go 1.17 -require github.com/owncloud/protoc-gen-microweb v0.0.0-20220407065143-a4a3e07bbb7c +require github.com/owncloud/protoc-gen-microweb v0.0.0-20220808092353-b5d6c3960e19 diff --git a/.bingo/protoc-gen-microweb.sum b/.bingo/protoc-gen-microweb.sum index 476628c9b45..df4318c6bd7 100644 --- a/.bingo/protoc-gen-microweb.sum +++ b/.bingo/protoc-gen-microweb.sum @@ -261,6 +261,8 @@ github.com/owncloud/protoc-gen-microweb v0.0.0-20211219183901-997c02cae878 h1:rg github.com/owncloud/protoc-gen-microweb v0.0.0-20211219183901-997c02cae878/go.mod h1:FnVsgi9o7QljV0o82CEqgNzRu4FBtDbx0Fl1Bm39vWQ= github.com/owncloud/protoc-gen-microweb v0.0.0-20220407065143-a4a3e07bbb7c h1:zfcwaNIl2ULSwJguxR+IBp1SqJQHYYsQ3oB3ZSipgCg= github.com/owncloud/protoc-gen-microweb v0.0.0-20220407065143-a4a3e07bbb7c/go.mod h1:Tj4b1L5vKN7saayN2uqAKIchkm76R80HViLmZvZP2d0= +github.com/owncloud/protoc-gen-microweb v0.0.0-20220808092353-b5d6c3960e19 h1:ByaZQEfVxPAKlZAS+i0RsXqcLBGLFVu4dTp4lNOZDts= +github.com/owncloud/protoc-gen-microweb v0.0.0-20220808092353-b5d6c3960e19/go.mod h1:Tj4b1L5vKN7saayN2uqAKIchkm76R80HViLmZvZP2d0= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= diff --git a/.bingo/variables.env b/.bingo/variables.env index 507db71fdae..baa1809bbfc 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -32,7 +32,7 @@ PROTOC_GEN_GO="${GOBIN}/protoc-gen-go-v1.28.0" PROTOC_GEN_MICRO="${GOBIN}/protoc-gen-micro-v1.0.0" -PROTOC_GEN_MICROWEB="${GOBIN}/protoc-gen-microweb-v0.0.0-20220407065143-a4a3e07bbb7c" +PROTOC_GEN_MICROWEB="${GOBIN}/protoc-gen-microweb-v0.0.0-20220808092353-b5d6c3960e19" PROTOC_GEN_OPENAPIV2="${GOBIN}/protoc-gen-openapiv2-v2.10.0" diff --git a/protogen/gen/ocis/services/search/v0/search.pb.web.go b/protogen/gen/ocis/services/search/v0/search.pb.web.go index 427033152b2..a6a5842fec5 100644 --- a/protogen/gen/ocis/services/search/v0/search.pb.web.go +++ b/protogen/gen/ocis/services/search/v0/search.pb.web.go @@ -11,6 +11,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/render" "github.com/golang/protobuf/jsonpb" + merrors "go-micro.dev/v4/errors" ) type webSearchProviderHandler struct { @@ -36,7 +37,11 @@ func (h *webSearchProviderHandler) Search(w http.ResponseWriter, r *http.Request req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -58,7 +63,11 @@ func (h *webSearchProviderHandler) IndexSpace(w http.ResponseWriter, r *http.Req req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -99,7 +108,11 @@ func (h *webIndexProviderHandler) Search(w http.ResponseWriter, r *http.Request) req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } diff --git a/protogen/gen/ocis/services/settings/v0/settings.pb.web.go b/protogen/gen/ocis/services/settings/v0/settings.pb.web.go index bcad905cce4..ef8718f98f8 100644 --- a/protogen/gen/ocis/services/settings/v0/settings.pb.web.go +++ b/protogen/gen/ocis/services/settings/v0/settings.pb.web.go @@ -11,6 +11,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/render" "github.com/golang/protobuf/jsonpb" + merrors "go-micro.dev/v4/errors" ptypesempty "github.com/golang/protobuf/ptypes/empty" ) @@ -38,7 +39,11 @@ func (h *webBundleServiceHandler) SaveBundle(w http.ResponseWriter, r *http.Requ req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -60,7 +65,11 @@ func (h *webBundleServiceHandler) GetBundle(w http.ResponseWriter, r *http.Reque req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -82,7 +91,11 @@ func (h *webBundleServiceHandler) ListBundles(w http.ResponseWriter, r *http.Req req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -104,7 +117,11 @@ func (h *webBundleServiceHandler) AddSettingToBundle(w http.ResponseWriter, r *h req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -126,7 +143,11 @@ func (h *webBundleServiceHandler) RemoveSettingFromBundle(w http.ResponseWriter, req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -170,7 +191,11 @@ func (h *webValueServiceHandler) SaveValue(w http.ResponseWriter, r *http.Reques req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -192,7 +217,11 @@ func (h *webValueServiceHandler) GetValue(w http.ResponseWriter, r *http.Request req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -214,7 +243,11 @@ func (h *webValueServiceHandler) ListValues(w http.ResponseWriter, r *http.Reque req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -236,7 +269,11 @@ func (h *webValueServiceHandler) GetValueByUniqueIdentifiers(w http.ResponseWrit req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -279,7 +316,11 @@ func (h *webRoleServiceHandler) ListRoles(w http.ResponseWriter, r *http.Request req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -301,7 +342,11 @@ func (h *webRoleServiceHandler) ListRoleAssignments(w http.ResponseWriter, r *ht req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -323,7 +368,11 @@ func (h *webRoleServiceHandler) AssignRoleToUser(w http.ResponseWriter, r *http. req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -345,7 +394,11 @@ func (h *webRoleServiceHandler) RemoveRoleFromUser(w http.ResponseWriter, r *htt req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -388,7 +441,11 @@ func (h *webPermissionServiceHandler) ListPermissionsByResource(w http.ResponseW req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } @@ -410,7 +467,11 @@ func (h *webPermissionServiceHandler) GetPermissionByID(w http.ResponseWriter, r req, resp, ); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) + if merr, ok := merrors.As(err); ok && merr.Code == http.StatusNotFound { + http.Error(w, err.Error(), http.StatusNotFound) + } else { + http.Error(w, err.Error(), http.StatusBadRequest) + } return } diff --git a/protogen/gen/ocis/services/store/v0/store.pb.micro.go b/protogen/gen/ocis/services/store/v0/store.pb.micro.go index ed25b475640..53121345666 100644 --- a/protogen/gen/ocis/services/store/v0/store.pb.micro.go +++ b/protogen/gen/ocis/services/store/v0/store.pb.micro.go @@ -104,6 +104,7 @@ type Store_ListService interface { Context() context.Context SendMsg(interface{}) error RecvMsg(interface{}) error + CloseSend() error Close() error Recv() (*ListResponse, error) } @@ -112,6 +113,10 @@ type storeServiceList struct { stream client.Stream } +func (x *storeServiceList) CloseSend() error { + return x.stream.CloseSend() +} + func (x *storeServiceList) Close() error { return x.stream.Close() } From ed57a06d971517bea7ed68797b0386ece945930b Mon Sep 17 00:00:00 2001 From: amrita Date: Mon, 8 Aug 2022 12:15:02 +0545 Subject: [PATCH 08/30] Bump commit id and middleware version --- .drone.env | 4 ++-- .drone.star | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.env b/.drone.env index 3c3e50f89c6..fb638d1514f 100644 --- a/.drone.env +++ b/.drone.env @@ -1,7 +1,7 @@ # The test runner source for API tests -CORE_COMMITID=3eebf7b731759e71c76481fa2de1d5cdb308f21d +CORE_COMMITID=dc5c1f5ce58b63ba9cf799ad81fe5cc50421f6da CORE_BRANCH=master # The test runner source for UI tests -WEB_COMMITID=9882f20cdce1b5e699b6ff31057bce29189ab4c7 +WEB_COMMITID=52c0a3e8d0c0a2a8a342ed2656254afe03725260 WEB_BRANCH=master diff --git a/.drone.star b/.drone.star index 12d3fd1ef83..d3a02c4ffe4 100644 --- a/.drone.star +++ b/.drone.star @@ -18,7 +18,7 @@ OC_CI_PHP = "owncloudci/php:%s" OC_CI_WAIT_FOR = "owncloudci/wait-for:latest" OC_CS3_API_VALIDATOR = "owncloud/cs3api-validator:0.2.0" OC_LITMUS = "owncloud/litmus:latest" -OC_OC_TEST_MIDDLEWARE = "owncloud/owncloud-test-middleware:1.8.0" +OC_OC_TEST_MIDDLEWARE = "owncloud/owncloud-test-middleware:1.8.1" OC_SERVER = "owncloud/server:10" OC_UBUNTU = "owncloud/ubuntu:20.04" OSIXIA_OPEN_LDAP = "osixia/openldap:latest" From 249ed4efe50d11a5af2afe24280b476773f69c3a Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 8 Aug 2022 13:41:12 +0000 Subject: [PATCH 09/30] Automated changelog update [skip ci] --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6562113d58c..f724c84d31d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The following sections list the changes for unreleased. * Enhancement - Improve error log for "could not get user by claim" error: [#4227](https://github.com/owncloud/ocis/pull/4227) * Enhancement - Allow providing list of services NOT to start: [#4254](https://github.com/owncloud/ocis/pull/4254) * Enhancement - Introduce insecure flag for smtp email notifications: [#4279](https://github.com/owncloud/ocis/pull/4279) +* Enhancement - Fix behavior for foobar (in present tense): [#4346](https://github.com/owncloud/ocis/pull/4346) * Enhancement - Update reva to vx.x.x: [#4294](https://github.com/owncloud/ocis/pull/4294) * Enhancement - Update ownCloud Web to v5.7.0-rc.7: [#4314](https://github.com/owncloud/ocis/pull/4314) @@ -99,6 +100,21 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4279 +* Enhancement - Fix behavior for foobar (in present tense): [#4346](https://github.com/owncloud/ocis/pull/4346) + + We've added the configuration option `PROXY_OIDC_REWRITE_WELLKNOWN` to rewrite the + `/.well-known/openid-configuration` endpoint. If active, it serves the + `/.well-known/openid-configuration` response of the original IDP configured in + `OCIS_OIDC_ISSUER` / `PROXY_OIDC_ISSUER`. This is needed so that the Desktop Client, + Android Client and iOS Client can discover the OIDC identity provider. + + Previously this rewrite needed to be performed with an external proxy as NGINX or Traefik if an + external IDP was used. + + https://github.com/owncloud/ocis/issues/2819 + https://github.com/owncloud/ocis/issues/3280 + https://github.com/owncloud/ocis/pull/4346 + * Enhancement - Update reva to vx.x.x: [#4294](https://github.com/owncloud/ocis/pull/4294) Updated reva to version x.x.x. This update includes: From bde5d698399f3ca135bf813ec2834faf4fecc40d Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 8 Aug 2022 16:02:33 +0200 Subject: [PATCH 10/30] add storageID to the special items, improve code --- changelog/unreleased/special-items-improvements.md | 5 +++++ services/graph/pkg/service/v0/driveitems.go | 6 ++++-- services/graph/pkg/service/v0/drives.go | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 changelog/unreleased/special-items-improvements.md diff --git a/changelog/unreleased/special-items-improvements.md b/changelog/unreleased/special-items-improvements.md new file mode 100644 index 00000000000..4a402d45dbb --- /dev/null +++ b/changelog/unreleased/special-items-improvements.md @@ -0,0 +1,5 @@ +Enhancement: Use storageID when requesting special items + +We need to use the storageID when requesting the special items of a space to spare a registry lookup and improve the performance + +https://github.com/owncloud/ocis/pull/4356 diff --git a/services/graph/pkg/service/v0/driveitems.go b/services/graph/pkg/service/v0/driveitems.go index e49c3b832d9..a789e1accdc 100644 --- a/services/graph/pkg/service/v0/driveitems.go +++ b/services/graph/pkg/service/v0/driveitems.go @@ -227,6 +227,8 @@ func (g Graph) GetExtendedSpaceProperties(ctx context.Context, baseURL *url.URL, for _, itemName := range names { if itemID, ok := metadata[itemName]; ok { rid, _ := storagespace.ParseID(string(itemID.Value)) + // add the storageID of the space, all drive items of this space belong to the same storageID + rid.StorageId = space.GetRoot().GetStorageId() spaceItem := g.getSpecialDriveItem(ctx, rid, itemName, baseURL, space) if spaceItem != nil { spaceItems = append(spaceItems, *spaceItem) @@ -244,12 +246,12 @@ func (g Graph) getSpecialDriveItem(ctx context.Context, id storageprovider.Resou spaceItem, err := g.getDriveItem(ctx, id) if err != nil { - g.logger.Error().Err(err).Str("ID", id.OpaqueId).Msg("Could not get readme Item") + g.logger.Error().Err(err).Str("ID", id.OpaqueId).Str("name", itemName).Msg("Could not get item info") return nil } itemPath, err := g.getPathForResource(ctx, id) if err != nil { - g.logger.Error().Err(err).Str("ID", id.OpaqueId).Msg("Could not get readme path") + g.logger.Error().Err(err).Str("ID", id.OpaqueId).Str("name", itemName).Msg("Could not get item path") return nil } spaceItem.SpecialFolder = &libregraph.SpecialFolder{Name: libregraph.PtrString(itemName)} diff --git a/services/graph/pkg/service/v0/drives.go b/services/graph/pkg/service/v0/drives.go index dfe702240a7..ca823ac8ef0 100644 --- a/services/graph/pkg/service/v0/drives.go +++ b/services/graph/pkg/service/v0/drives.go @@ -434,8 +434,7 @@ func (g Graph) ListStorageSpacesWithFilters(ctx context.Context, filters []*stor if err != nil { return nil, err } - - res, err := client.ListStorageSpaces(ctx, &storageprovider.ListStorageSpacesRequest{ + lReq := &storageprovider.ListStorageSpacesRequest{ Opaque: &types.Opaque{Map: map[string]*types.OpaqueEntry{ "permissions": { Decoder: "json", @@ -447,7 +446,8 @@ func (g Graph) ListStorageSpacesWithFilters(ctx context.Context, filters []*stor }, }}, Filters: filters, - }) + } + res, err := client.ListStorageSpaces(ctx, lReq) return res, err } From 67b52bbd55a9baed98148bfb68bed68d672a66bb Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 8 Aug 2022 16:41:22 +0200 Subject: [PATCH 11/30] add expand query for personal drive --- changelog/unreleased/user-expand-drive.md | 5 +++++ go.mod | 2 +- go.sum | 2 ++ services/graph/pkg/service/v0/users.go | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 changelog/unreleased/user-expand-drive.md diff --git a/changelog/unreleased/user-expand-drive.md b/changelog/unreleased/user-expand-drive.md new file mode 100644 index 00000000000..ad1041d6b50 --- /dev/null +++ b/changelog/unreleased/user-expand-drive.md @@ -0,0 +1,5 @@ +Enhancement: Expand personal drive on the graph user + +We can now list the personal drive on the users endpoint via the graph API. A user can add an `$expand=drive` query to list the personal drive of the requested user. + +https://github.com/owncloud/ocis/pull/4357 diff --git a/go.mod b/go.mod index 6c7b7fc524e..65ddfd3ca02 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( github.com/onsi/ginkgo/v2 v2.1.4 github.com/onsi/gomega v1.20.0 github.com/orcaman/concurrent-map v1.0.0 - github.com/owncloud/libre-graph-api-go v0.14.3 + github.com/owncloud/libre-graph-api-go v0.16.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.2 github.com/rs/zerolog v1.27.0 diff --git a/go.sum b/go.sum index 058ec9fbbb3..652ae41deff 100644 --- a/go.sum +++ b/go.sum @@ -973,6 +973,8 @@ github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CF github.com/ovh/go-ovh v1.1.0/go.mod h1:AxitLZ5HBRPyUd+Zl60Ajaag+rNTdVXWIkzfrVuTXWA= github.com/owncloud/libre-graph-api-go v0.14.3 h1:+lkIkLHjrLfazANYfg2MYEhaJsMXzfOjtIY1hF3PbU4= github.com/owncloud/libre-graph-api-go v0.14.3/go.mod h1:579sFrPP7aP24LZXGPopLfvE+hAka/2DYHk0+Ij+w+U= +github.com/owncloud/libre-graph-api-go v0.16.0 h1:CyW69/lREyx+nkUrXYJnMyshBygwkfPVCjm0ngqjcYs= +github.com/owncloud/libre-graph-api-go v0.16.0/go.mod h1:579sFrPP7aP24LZXGPopLfvE+hAka/2DYHk0+Ij+w+U= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= diff --git a/services/graph/pkg/service/v0/users.go b/services/graph/pkg/service/v0/users.go index 8d7bd519128..d96007597ab 100644 --- a/services/graph/pkg/service/v0/users.go +++ b/services/graph/pkg/service/v0/users.go @@ -213,13 +213,13 @@ func (g Graph) GetUser(w http.ResponseWriter, r *http.Request) { d.Quota = quota if slices.Contains(sel, "drive") || slices.Contains(exp, "drive") { if *d.DriveType == "personal" { - drives = append(drives, *d) + user.Drive = d } } else { drives = append(drives, *d) + user.Drives = drives } } - user.Drives = drives } render.Status(r, http.StatusOK) From a9761381addaabcd7d0aa8c689882b75e3b659ee Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 8 Aug 2022 14:47:14 +0000 Subject: [PATCH 12/30] Automated changelog update [skip ci] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f724c84d31d..10b5cd80b84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The following sections list the changes for unreleased. * Enhancement - Allow providing list of services NOT to start: [#4254](https://github.com/owncloud/ocis/pull/4254) * Enhancement - Introduce insecure flag for smtp email notifications: [#4279](https://github.com/owncloud/ocis/pull/4279) * Enhancement - Fix behavior for foobar (in present tense): [#4346](https://github.com/owncloud/ocis/pull/4346) +* Enhancement - Use storageID when requesting special items: [#4356](https://github.com/owncloud/ocis/pull/4356) * Enhancement - Update reva to vx.x.x: [#4294](https://github.com/owncloud/ocis/pull/4294) * Enhancement - Update ownCloud Web to v5.7.0-rc.7: [#4314](https://github.com/owncloud/ocis/pull/4314) @@ -115,6 +116,13 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/issues/3280 https://github.com/owncloud/ocis/pull/4346 +* Enhancement - Use storageID when requesting special items: [#4356](https://github.com/owncloud/ocis/pull/4356) + + We need to use the storageID when requesting the special items of a space to spare a registry + lookup and improve the performance + + https://github.com/owncloud/ocis/pull/4356 + * Enhancement - Update reva to vx.x.x: [#4294](https://github.com/owncloud/ocis/pull/4294) Updated reva to version x.x.x. This update includes: From 974469346cd7c022e4bbccd07f7848879214f8f3 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Mon, 8 Aug 2022 17:24:24 +0200 Subject: [PATCH 13/30] chore: bump web to v5.7.0-rc.8 --- changelog/unreleased/update-web-beta.6.md | 11 ++++++++--- services/web/Makefile | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/changelog/unreleased/update-web-beta.6.md b/changelog/unreleased/update-web-beta.6.md index b928f69459e..8198af3b853 100644 --- a/changelog/unreleased/update-web-beta.6.md +++ b/changelog/unreleased/update-web-beta.6.md @@ -1,8 +1,8 @@ -Enhancement: Update ownCloud Web to v5.7.0-rc.7 +Enhancement: Update ownCloud Web to v5.7.0-rc.8 Tags: web -We updated ownCloud Web to v5.7.0-rc.7. Please refer to the changelog (linked) for details on the web release. +We updated ownCloud Web to v5.7.0-rc.8. Please refer to the changelog (linked) for details on the web release. * Bugfix [owncloud/web#7080](https://github.com/owncloud/web/issues/7080): Add Droparea again * Bugfix [owncloud/web#7357](https://github.com/owncloud/web/pull/7357): Batch deleting multiple files @@ -21,14 +21,19 @@ We updated ownCloud Web to v5.7.0-rc.7. Please refer to the changelog (linked) f * Bugfix [owncloud/web#7272](https://github.com/owncloud/web/issues/7272): Print backend version * Bugfix [owncloud/web#7379](https://github.com/owncloud/web/pull/7379): Rename shared space resource not possible * Bugfix [owncloud/web#7210](https://github.com/owncloud/web/pull/7210): Repair navigation highlighter +* Bugfix [owncloud/web#7393](https://github.com/owncloud/web/pull/7393): Selected item bottom glue * Bugfix [owncloud/web#7308](https://github.com/owncloud/web/pull/7308): "Shared with others" and "Shared via Link" resource links not working +* Bugfix [owncloud/web#7400](https://github.com/owncloud/web/issues/7400): Respect space quota permission * Bugfix [owncloud/web#7349](https://github.com/owncloud/web/pull/7349): Missing quick actions in spaces file list +* Bugfix [owncloud/web#7396](https://github.com/owncloud/web/pull/7396): Add storage ID when navigating to a shared parent directory +* Bugfix [owncloud/web#7394](https://github.com/owncloud/web/pull/7394): Suppress active panel error log * Bugfix [owncloud/web#7038](https://github.com/owncloud/web/issues/7038): File list render performance * Bugfix [owncloud/web#7240](https://github.com/owncloud/web/issues/7240): Access token renewal during upload * Bugfix [owncloud/web#7376](https://github.com/owncloud/web/pull/7376): Tooltips not shown on disabled create and upload button * Bugfix [owncloud/web#7297](https://github.com/owncloud/web/pull/7297): Upload overlay progress bar spacing * Bugfix [owncloud/web#7332](https://github.com/owncloud/web/pull/7332): Users list not loading if user has no role * Bugfix [owncloud/web#7313](https://github.com/owncloud/web/pull/7313): Versions of shared files not visible +* Enhancement [owncloud/web#7404](https://github.com/owncloud/web/pull/7404): Adjust helper texts * Enhancement [owncloud/web#7350](https://github.com/owncloud/web/pull/7350): Change file loading mechanism in `preview` app * Enhancement [owncloud/web#7356](https://github.com/owncloud/web/pull/7356): Declined shares are now easily accessible * Enhancement [owncloud/web#7365](https://github.com/owncloud/web/pull/7365): Drop menu styling in right sidebar @@ -40,4 +45,4 @@ We updated ownCloud Web to v5.7.0-rc.7. Please refer to the changelog (linked) f * Enhancement [owncloud/web#7375](https://github.com/owncloud/web/pull/7375): User management app saved dialog https://github.com/owncloud/ocis/pull/4314 -https://github.com/owncloud/web/releases/tag/v5.7.0-rc.7 +https://github.com/owncloud/web/releases/tag/v5.7.0-rc.8 diff --git a/services/web/Makefile b/services/web/Makefile index 0e8f5eb67b9..e42c485e134 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -1,6 +1,6 @@ SHELL := bash NAME := web -WEB_ASSETS_VERSION = v5.7.0-rc.7 +WEB_ASSETS_VERSION = v5.7.0-rc.8 include ../../.make/recursion.mk From 2d8d56d0077dbdccd649f81ee5abf7d7547ba4bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:29:33 +0000 Subject: [PATCH 14/30] Bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc Bumps [go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc](https://github.com/open-telemetry/opentelemetry-go-contrib) from 0.33.0 to 0.34.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.33.0...zpages/v0.34.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6c7b7fc524e..61a6e5ed78a 100644 --- a/go.mod +++ b/go.mod @@ -64,7 +64,7 @@ require ( github.com/xhit/go-simple-mail/v2 v2.11.0 go-micro.dev/v4 v4.8.0 go.opencensus.io v0.23.0 - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 go.opentelemetry.io/otel v1.9.0 go.opentelemetry.io/otel/exporters/jaeger v1.9.0 go.opentelemetry.io/otel/sdk v1.9.0 diff --git a/go.sum b/go.sum index 058ec9fbbb3..b5e2fe74622 100644 --- a/go.sum +++ b/go.sum @@ -1245,8 +1245,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 h1:z6rnla1Asjzn0FrhohzIbDi4bxbtc6EMmQ7f5ZPn+pA= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 h1:PNEMW4EvpNQ7SuoPFNkvbZqi1STkTPKq+8vfoMl/6AE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0/go.mod h1:fk1+icoN47ytLSgkoWHLJrtVTSQ+HgmkNgPTKrk/Nsc= go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel/exporters/jaeger v1.9.0 h1:gAEgEVGDWwFjcis9jJTOJqZNxDzoZfR12WNIxr7g9Ww= From 9cafe5a5a8ef5574e390e5b762d92b8ddbbe2191 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 8 Aug 2022 15:45:42 +0000 Subject: [PATCH 15/30] Automated changelog update [skip ci] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10b5cd80b84..4ca18b686c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The following sections list the changes for unreleased. * Enhancement - Use storageID when requesting special items: [#4356](https://github.com/owncloud/ocis/pull/4356) * Enhancement - Update reva to vx.x.x: [#4294](https://github.com/owncloud/ocis/pull/4294) * Enhancement - Update ownCloud Web to v5.7.0-rc.7: [#4314](https://github.com/owncloud/ocis/pull/4314) +* Enhancement - Expand personal drive on the graph user: [#4357](https://github.com/owncloud/ocis/pull/4357) ## Details @@ -179,6 +180,13 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4314 https://github.com/owncloud/web/releases/tag/v5.7.0-rc.7 + +* Enhancement - Expand personal drive on the graph user: [#4357](https://github.com/owncloud/ocis/pull/4357) + + We can now list the personal drive on the users endpoint via the graph API. A user can add an + `$expand=drive` query to list the personal drive of the requested user. + + https://github.com/owncloud/ocis/pull/4357 # Changelog for [2.0.0-beta.5] (2022-07-19) The following sections list the changes for 2.0.0-beta.5. From c3932abd9c93a4c6259c3b7138e891e47f6e42d5 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Mon, 8 Aug 2022 16:02:17 +0000 Subject: [PATCH 16/30] Automated changelog update [skip ci] --- CHANGELOG.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ca18b686c0..df5e909ecb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ The following sections list the changes for unreleased. * Enhancement - Fix behavior for foobar (in present tense): [#4346](https://github.com/owncloud/ocis/pull/4346) * Enhancement - Use storageID when requesting special items: [#4356](https://github.com/owncloud/ocis/pull/4356) * Enhancement - Update reva to vx.x.x: [#4294](https://github.com/owncloud/ocis/pull/4294) -* Enhancement - Update ownCloud Web to v5.7.0-rc.7: [#4314](https://github.com/owncloud/ocis/pull/4314) +* Enhancement - Update ownCloud Web to v5.7.0-rc.8: [#4314](https://github.com/owncloud/ocis/pull/4314) * Enhancement - Expand personal drive on the graph user: [#4357](https://github.com/owncloud/ocis/pull/4357) ## Details @@ -136,11 +136,11 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/pull/4294 https://github.com/owncloud/ocis/pull/4330 -* Enhancement - Update ownCloud Web to v5.7.0-rc.7: [#4314](https://github.com/owncloud/ocis/pull/4314) +* Enhancement - Update ownCloud Web to v5.7.0-rc.8: [#4314](https://github.com/owncloud/ocis/pull/4314) Tags: web - We updated ownCloud Web to v5.7.0-rc.7. Please refer to the changelog (linked) for details on + We updated ownCloud Web to v5.7.0-rc.8. Please refer to the changelog (linked) for details on the web release. * Bugfix [owncloud/web#7080](https://github.com/owncloud/web/issues/7080): Add Droparea again @@ -160,14 +160,19 @@ The following sections list the changes for unreleased. * Bugfix [owncloud/web#7272](https://github.com/owncloud/web/issues/7272): Print backend version * Bugfix [owncloud/web#7379](https://github.com/owncloud/web/pull/7379): Rename shared space resource not possible * Bugfix [owncloud/web#7210](https://github.com/owncloud/web/pull/7210): Repair navigation highlighter + * Bugfix [owncloud/web#7393](https://github.com/owncloud/web/pull/7393): Selected item bottom glue * Bugfix [owncloud/web#7308](https://github.com/owncloud/web/pull/7308): "Shared with others" and "Shared via Link" resource links not working + * Bugfix [owncloud/web#7400](https://github.com/owncloud/web/issues/7400): Respect space quota permission * Bugfix [owncloud/web#7349](https://github.com/owncloud/web/pull/7349): Missing quick actions in spaces file list + * Bugfix [owncloud/web#7396](https://github.com/owncloud/web/pull/7396): Add storage ID when navigating to a shared parent directory + * Bugfix [owncloud/web#7394](https://github.com/owncloud/web/pull/7394): Suppress active panel error log * Bugfix [owncloud/web#7038](https://github.com/owncloud/web/issues/7038): File list render performance * Bugfix [owncloud/web#7240](https://github.com/owncloud/web/issues/7240): Access token renewal during upload * Bugfix [owncloud/web#7376](https://github.com/owncloud/web/pull/7376): Tooltips not shown on disabled create and upload button * Bugfix [owncloud/web#7297](https://github.com/owncloud/web/pull/7297): Upload overlay progress bar spacing * Bugfix [owncloud/web#7332](https://github.com/owncloud/web/pull/7332): Users list not loading if user has no role * Bugfix [owncloud/web#7313](https://github.com/owncloud/web/pull/7313): Versions of shared files not visible + * Enhancement [owncloud/web#7404](https://github.com/owncloud/web/pull/7404): Adjust helper texts * Enhancement [owncloud/web#7350](https://github.com/owncloud/web/pull/7350): Change file loading mechanism in `preview` app * Enhancement [owncloud/web#7356](https://github.com/owncloud/web/pull/7356): Declined shares are now easily accessible * Enhancement [owncloud/web#7365](https://github.com/owncloud/web/pull/7365): Drop menu styling in right sidebar @@ -179,7 +184,7 @@ The following sections list the changes for unreleased. * Enhancement [owncloud/web#7375](https://github.com/owncloud/web/pull/7375): User management app saved dialog https://github.com/owncloud/ocis/pull/4314 - https://github.com/owncloud/web/releases/tag/v5.7.0-rc.7 + https://github.com/owncloud/web/releases/tag/v5.7.0-rc.8 * Enhancement - Expand personal drive on the graph user: [#4357](https://github.com/owncloud/ocis/pull/4357) From 9e8c0903a29b70c57f4cfd3c8529d50354126bc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 16:03:50 +0000 Subject: [PATCH 17/30] Bump github.com/prometheus/client_golang from 1.12.2 to 1.13.0 Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.2 to 1.13.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.12.2...v1.13.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 65ddfd3ca02..3cade5654e6 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,7 @@ require ( github.com/orcaman/concurrent-map v1.0.0 github.com/owncloud/libre-graph-api-go v0.16.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.12.2 + github.com/prometheus/client_golang v1.13.0 github.com/rs/zerolog v1.27.0 github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.5.0 @@ -64,7 +64,7 @@ require ( github.com/xhit/go-simple-mail/v2 v2.11.0 go-micro.dev/v4 v4.8.0 go.opencensus.io v0.23.0 - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 go.opentelemetry.io/otel v1.9.0 go.opentelemetry.io/otel/exporters/jaeger v1.9.0 go.opentelemetry.io/otel/sdk v1.9.0 @@ -231,8 +231,8 @@ require ( github.com/pquerna/cachecontrol v0.1.0 // indirect github.com/prometheus/alertmanager v0.24.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.32.1 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/prometheus/statsd_exporter v0.22.4 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/rs/cors v1.8.2 // indirect diff --git a/go.sum b/go.sum index 652ae41deff..81a679c66d4 100644 --- a/go.sum +++ b/go.sum @@ -971,8 +971,6 @@ github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35uk github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HDbW65HOY= github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/ovh/go-ovh v1.1.0/go.mod h1:AxitLZ5HBRPyUd+Zl60Ajaag+rNTdVXWIkzfrVuTXWA= -github.com/owncloud/libre-graph-api-go v0.14.3 h1:+lkIkLHjrLfazANYfg2MYEhaJsMXzfOjtIY1hF3PbU4= -github.com/owncloud/libre-graph-api-go v0.14.3/go.mod h1:579sFrPP7aP24LZXGPopLfvE+hAka/2DYHk0+Ij+w+U= github.com/owncloud/libre-graph-api-go v0.16.0 h1:CyW69/lREyx+nkUrXYJnMyshBygwkfPVCjm0ngqjcYs= github.com/owncloud/libre-graph-api-go v0.16.0/go.mod h1:579sFrPP7aP24LZXGPopLfvE+hAka/2DYHk0+Ij+w+U= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= @@ -1016,8 +1014,9 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1037,8 +1036,9 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9 github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/exporter-toolkit v0.7.1/go.mod h1:ZUBIj498ePooX9t/2xtDjeQYwvRpiPP2lh5u4iblj2g= github.com/prometheus/procfs v0.0.0-20170703101242-e645f4e5aaa8/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1050,8 +1050,9 @@ github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= github.com/prometheus/statsd_exporter v0.22.4 h1:bGhC0iI9DM8m9KIUlbcr3uzXnopagrajEKoP790256k= github.com/prometheus/statsd_exporter v0.22.4/go.mod h1:N4Z1+iSqc9rnxlT1N8Qn3l65Vzb5t4Uq0jpg8nxyhio= @@ -1247,8 +1248,8 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0 h1:z6rnla1Asjzn0FrhohzIbDi4bxbtc6EMmQ7f5ZPn+pA= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.33.0/go.mod h1:y/SlJpJQPd2UzfBCj0E9Flk9FDCtTyqUmaCB41qFrWI= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 h1:PNEMW4EvpNQ7SuoPFNkvbZqi1STkTPKq+8vfoMl/6AE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0/go.mod h1:fk1+icoN47ytLSgkoWHLJrtVTSQ+HgmkNgPTKrk/Nsc= go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= go.opentelemetry.io/otel/exporters/jaeger v1.9.0 h1:gAEgEVGDWwFjcis9jJTOJqZNxDzoZfR12WNIxr7g9Ww= From 9476a59d5777f8c448ba3a870e82e150258e6db7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 17:13:05 +0000 Subject: [PATCH 18/30] Bump github.com/grpc-ecosystem/grpc-gateway/v2 from 2.11.1 to 2.11.2 Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.11.1 to 2.11.2. - [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases) - [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/.goreleaser.yml) - [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v2.11.1...v2.11.2) --- updated-dependencies: - dependency-name: github.com/grpc-ecosystem/grpc-gateway/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 10 +++++----- go.sum | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 209f693a7db..4c8a52b5875 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,7 @@ require ( github.com/golang/protobuf v1.5.2 github.com/gookit/config/v2 v2.1.2 github.com/gorilla/mux v1.8.0 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.1 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.2 github.com/justinas/alice v1.2.0 github.com/libregraph/idm v0.3.1-0.20220718103124-c4f6613dce2b github.com/libregraph/lico v0.54.1-0.20220325072321-31efc3995d63 @@ -53,7 +53,7 @@ require ( github.com/orcaman/concurrent-map v1.0.0 github.com/owncloud/libre-graph-api-go v0.16.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.12.2 + github.com/prometheus/client_golang v1.13.0 github.com/rs/zerolog v1.27.0 github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.5.0 @@ -74,7 +74,7 @@ require ( golang.org/x/image v0.0.0-20220321031419-a8550c1d254a golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c - google.golang.org/genproto v0.0.0-20220728213248-dd149ef739b9 + google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 gopkg.in/yaml.v2 v2.4.0 @@ -231,8 +231,8 @@ require ( github.com/pquerna/cachecontrol v0.1.0 // indirect github.com/prometheus/alertmanager v0.24.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.32.1 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/prometheus/statsd_exporter v0.22.4 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/rs/cors v1.8.2 // indirect diff --git a/go.sum b/go.sum index cb492cdc3c9..67022a4c841 100644 --- a/go.sum +++ b/go.sum @@ -657,8 +657,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.1 h1:/sDbPb60SusIXjiJGYLUoS/rAQurQmvGWmwn2bBPM9c= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.1/go.mod h1:G+WkljZi4mflcqVxYSgvt8MNctRQHjEH8ubKtt1Ka3w= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.2 h1:BqHID5W5qnMkug0Z8UmL8tN0gAy4jQ+B4WFt8cCgluU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.2/go.mod h1:ZbS3MZTZq/apAfAEHGoB5HbsQQstoqP92SjAqtQ9zeg= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.11.0 h1:Hw/G8TtRvOElqxVIhBzXciiSTbapq8hZ2XKZsXk5ZCE= @@ -971,8 +971,6 @@ github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35uk github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HDbW65HOY= github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/ovh/go-ovh v1.1.0/go.mod h1:AxitLZ5HBRPyUd+Zl60Ajaag+rNTdVXWIkzfrVuTXWA= -github.com/owncloud/libre-graph-api-go v0.14.3 h1:+lkIkLHjrLfazANYfg2MYEhaJsMXzfOjtIY1hF3PbU4= -github.com/owncloud/libre-graph-api-go v0.14.3/go.mod h1:579sFrPP7aP24LZXGPopLfvE+hAka/2DYHk0+Ij+w+U= github.com/owncloud/libre-graph-api-go v0.16.0 h1:CyW69/lREyx+nkUrXYJnMyshBygwkfPVCjm0ngqjcYs= github.com/owncloud/libre-graph-api-go v0.16.0/go.mod h1:579sFrPP7aP24LZXGPopLfvE+hAka/2DYHk0+Ij+w+U= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= @@ -1016,8 +1014,9 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1037,8 +1036,9 @@ github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9 github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI= github.com/prometheus/exporter-toolkit v0.7.1/go.mod h1:ZUBIj498ePooX9t/2xtDjeQYwvRpiPP2lh5u4iblj2g= github.com/prometheus/procfs v0.0.0-20170703101242-e645f4e5aaa8/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1050,8 +1050,9 @@ github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= github.com/prometheus/statsd_exporter v0.22.4 h1:bGhC0iI9DM8m9KIUlbcr3uzXnopagrajEKoP790256k= github.com/prometheus/statsd_exporter v0.22.4/go.mod h1:N4Z1+iSqc9rnxlT1N8Qn3l65Vzb5t4Uq0jpg8nxyhio= @@ -1783,8 +1784,8 @@ google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220728213248-dd149ef739b9 h1:d3fKQZK+1rWQMg3xLKQbPMirUCo29I/NRdI2WarSzTg= -google.golang.org/genproto v0.0.0-20220728213248-dd149ef739b9/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 h1:sRT5xdTkj1Kbk30qbYC7VyMj73N5pZYsw6v+Nrzdhno= +google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= From bb9903515ff6ad11dd95b28dcfe9918e5e3d666a Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 8 Aug 2022 19:24:50 +0200 Subject: [PATCH 19/30] fix unrestricted quota --- changelog/unreleased/fix-unrestricted-quota.md | 5 +++++ services/graph/pkg/service/v0/drives.go | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/fix-unrestricted-quota.md diff --git a/changelog/unreleased/fix-unrestricted-quota.md b/changelog/unreleased/fix-unrestricted-quota.md new file mode 100644 index 00000000000..932a62b71d0 --- /dev/null +++ b/changelog/unreleased/fix-unrestricted-quota.md @@ -0,0 +1,5 @@ +Bugfix: Fix unrestricted quota on the graphAPI + +Unrestricted quota needs to show 0 on the API. It is not good for clients when the property is missing. + +https://github.com/owncloud/ocis/pull/4363 diff --git a/services/graph/pkg/service/v0/drives.go b/services/graph/pkg/service/v0/drives.go index ca823ac8ef0..a704c8ab038 100644 --- a/services/graph/pkg/service/v0/drives.go +++ b/services/graph/pkg/service/v0/drives.go @@ -640,16 +640,15 @@ func (g Graph) getDriveQuota(ctx context.Context, space *storageprovider.Storage } used := int64(res.UsedBytes) + total := int64(res.TotalBytes) qta := libregraph.Quota{ Remaining: &remaining, Used: &used, + Total: &total, } var t int64 - if total := int64(res.TotalBytes); total != 0 { - - // A quota was set - qta.Total = &total + if total != 0 { t = total } else { // Quota was not set From 1504aeb8912518425ce80ef7b2be1bdd2bc864ad Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 8 Aug 2022 19:02:16 +0000 Subject: [PATCH 20/30] Automated changelog update [skip ci] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df5e909ecb7..3f5521c7807 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The following sections list the changes for unreleased. * Bugfix - Fix handling of invalid LDAP users and groups: [#4274](https://github.com/owncloud/ocis/issues/4274) * Bugfix - Fix search in received shares: [#4308](https://github.com/owncloud/ocis/issues/4308) * Bugfix - Substring search for sharees: [#547](https://github.com/owncloud/ocis/issues/547) +* Bugfix - Fix unrestricted quota on the graphAPI: [#4363](https://github.com/owncloud/ocis/pull/4363) * Bugfix - Space Creators can hand over spaces: [#4244](https://github.com/owncloud/ocis/pull/4244) * Enhancement - Add drives field to users endpoint: [#4072](https://github.com/owncloud/ocis/pull/4072) * Enhancement - Improve validation of OIDC access tokens: [#3841](https://github.com/owncloud/ocis/issues/3841) @@ -51,6 +52,13 @@ The following sections list the changes for unreleased. https://github.com/owncloud/ocis/issues/547 +* Bugfix - Fix unrestricted quota on the graphAPI: [#4363](https://github.com/owncloud/ocis/pull/4363) + + Unrestricted quota needs to show 0 on the API. It is not good for clients when the property is + missing. + + https://github.com/owncloud/ocis/pull/4363 + * Bugfix - Space Creators can hand over spaces: [#4244](https://github.com/owncloud/ocis/pull/4244) Set no owner on non personal spaces to be able to pass the space manager role to a new user. From fa32f76f5dc8e6e8303ea424b4250f3c52e04da1 Mon Sep 17 00:00:00 2001 From: Kiran Parajuli Date: Mon, 1 Aug 2022 17:55:17 +0545 Subject: [PATCH 21/30] Use global cache for web and core repos usage Signed-off-by: Kiran Parajuli --- .drone.star | 309 +++++++++++++++---------- tests/config/drone/cache_core_repos.sh | 16 ++ tests/config/drone/cache_web.sh | 15 ++ tests/config/drone/clone_core_repos.sh | 25 ++ tests/config/drone/clone_web.sh | 18 ++ 5 files changed, 262 insertions(+), 121 deletions(-) create mode 100644 tests/config/drone/cache_core_repos.sh create mode 100644 tests/config/drone/cache_web.sh create mode 100644 tests/config/drone/clone_core_repos.sh create mode 100644 tests/config/drone/clone_web.sh diff --git a/.drone.star b/.drone.star index d3a02c4ffe4..f69f8d70186 100644 --- a/.drone.star +++ b/.drone.star @@ -41,9 +41,9 @@ DEFAULT_PHP_VERSION = "7.4" DEFAULT_NODEJS_VERSION = "14" dirs = { - # relative paths from /drone/src - "core": "oc10/testrunner", - "testing_app": "oc10/testing", + "core": "/drone/src/oc10/testrunner", + "testing_app": "/drone/src/oc10/testing", + "web": "/drone/src/webTestRunner", } # configuration @@ -158,6 +158,19 @@ pipelineVolumeGo = \ "temp": {}, } +# minio mc environment variables +MINIO_MC_ENV = { + "MC_HOST": { + "from_secret": "cache_s3_endpoint", + }, + "AWS_ACCESS_KEY_ID": { + "from_secret": "cache_s3_access_key", + }, + "AWS_SECRET_ACCESS_KEY": { + "from_secret": "cache_s3_secret_key", + }, +} + def pipelineDependsOn(pipeline, dependant_pipelines): if "depends_on" in pipeline.keys(): pipeline["depends_on"] = pipeline["depends_on"] + getPipelineNames(dependant_pipelines) @@ -200,7 +213,7 @@ def main(ctx): test_pipelines = \ cancelPreviousBuilds() + \ - buildCacheWeb(ctx) + \ + buildCacheWeb() + \ yarnCache(ctx) + \ [buildOcisBinaryForTesting(ctx)] + \ cacheCoreReposForTesting(ctx) + \ @@ -218,24 +231,18 @@ def main(ctx): docs(), ] + test_pipelines.append( + pipelineDependsOn( + purgeBuildArtifactCache(ctx, "tests-yarn"), + testPipelines(ctx), + ), + ) test_pipelines.append( pipelineDependsOn( purgeBuildArtifactCache(ctx, "ocis-binary-amd64"), testPipelines(ctx), ), ) - test_pipelines.append( - pipelineDependsOn( - purgeBuildArtifactCache(ctx, "testrunner"), - testPipelines(ctx), - ), - ) - test_pipelines.append( - pipelineDependsOn( - purgeBuildArtifactCache(ctx, "testing_app"), - testPipelines(ctx), - ), - ) pipelines = test_pipelines + build_release_pipelines + build_release_helpers @@ -263,14 +270,12 @@ def main(ctx): pipelineSanityChecks(ctx, pipelines) return pipelines -def buildCacheWeb(ctx): +def buildCacheWeb(): return [{ "kind": "pipeline", "type": "docker", "name": "cache-web", - "steps": skipIfUnchanged(ctx, "cache") + - installWebTestRunner() + - rebuildBuildArtifactCache(ctx, "web-dist", "webTestRunner"), + "steps": performWebCache(), "trigger": { "ref": [ "refs/heads/master", @@ -286,10 +291,10 @@ def yarnCache(ctx): "type": "docker", "name": "cache-yarn", "steps": skipIfUnchanged(ctx, "cache") + - restoreBuildArtifactCache(ctx, "web-dist", "webTestRunner") + + restoreWebCache() + yarnInstallUITests() + - rebuildBuildArtifactCache(ctx, "tests-yarn", "webTestRunner/tests/acceptance/.yarn"), - "depends_on": getPipelineNames(buildCacheWeb(ctx)), + rebuildBuildArtifactCache(ctx, "tests-yarn", "%s/tests/acceptance/.yarn" % dirs["web"]), + "depends_on": getPipelineNames(buildCacheWeb()), "trigger": { "ref": [ "refs/heads/master", @@ -298,23 +303,13 @@ def yarnCache(ctx): }, }] -def installWebTestRunner(): - return [{ - "name": "install-web-test-runner", - "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, - "commands": [ - ". /drone/src/.drone.env", - "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git webTestRunner", - ], - }] - def yarnInstallUITests(): return [{ "name": "yarn-install", "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, "commands": [ ". /drone/src/.drone.env", - "cd webTestRunner", + "cd %s" % dirs["web"], "git checkout $WEB_COMMITID", "cd tests/acceptance/", "retry -t 3 'yarn install --immutable'", @@ -493,10 +488,7 @@ def cacheCoreReposForTesting(ctx): "os": "linux", "arch": "amd64", }, - "steps": skipIfUnchanged(ctx, "acceptance-tests") + # skip for those pipelines where core repos are not needed - cloneCoreRepos() + - rebuildBuildArtifactCache(ctx, "testrunner", dirs["core"]) + - rebuildBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]), + "steps": performCoreReposCache(), "trigger": { "ref": [ "refs/heads/master", @@ -612,8 +604,8 @@ def localApiTests(ctx, storage, suite, accounts_hash_difficulty = 4): "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + ocisServer(storage, accounts_hash_difficulty) + - restoreBuildArtifactCache(ctx, "testrunner", dirs["core"]) + - restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + + restoreCoreCache() + + restoreTestingAppCache() + [ { "name": "localApiTests-%s-%s" % (suite, storage), @@ -621,10 +613,10 @@ def localApiTests(ctx, storage, suite, accounts_hash_difficulty = 4): "environment": { "TEST_WITH_GRAPH_API": "true", "PATH_TO_OCIS": "/drone/src", - "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], + "PATH_TO_CORE": dirs["core"], "TEST_SERVER_URL": "https://ocis-server:9200", "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), - "SKELETON_DIR": "%s/data/apiSkeleton" % dirs["testing_app"], + "SKELETON_DIR": dirs["testing_app"], "OCIS_SKELETON_STRATEGY": "%s" % ("copy" if storage == "owncloud" else "upload"), "TEST_OCIS": "true", "SEND_SCENARIO_LINE_REFERENCES": "true", @@ -663,17 +655,20 @@ def cs3ApiTests(ctx, storage, accounts_hash_difficulty = 4): "os": "linux", "arch": "amd64", }, - "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + - ocisServer(storage, accounts_hash_difficulty, []) + [ - { - "name": "cs3ApiTests-%s" % (storage), - "image": OC_CS3_API_VALIDATOR, - "environment": {}, - "commands": [ - "/usr/bin/cs3api-validator /var/lib/cs3api-validator --endpoint=ocis-server:9142", - ], - }, - ] + failEarly(ctx, early_fail), + "steps": skipIfUnchanged(ctx, "acceptance-tests") + + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + + ocisServer(storage, accounts_hash_difficulty, []) + + [ + { + "name": "cs3ApiTests-%s" % (storage), + "image": OC_CS3_API_VALIDATOR, + "environment": {}, + "commands": [ + "/usr/bin/cs3api-validator /var/lib/cs3api-validator --endpoint=ocis-server:9142", + ], + }, + ] + + failEarly(ctx, early_fail), "depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]), "trigger": { "ref": [ @@ -699,8 +694,8 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + ocisServer(storage, accounts_hash_difficulty) + - restoreBuildArtifactCache(ctx, "testrunner", dirs["core"]) + - restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + + restoreCoreCache() + + restoreTestingAppCache() + [ { "name": "oC10ApiTests-%s-storage-%s" % (storage, part_number), @@ -708,10 +703,10 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "environment": { "TEST_WITH_GRAPH_API": "true", "PATH_TO_OCIS": "/drone/src", - "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], + "PATH_TO_CORE": dirs["core"], "TEST_SERVER_URL": "https://ocis-server:9200", "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), - "SKELETON_DIR": "/drone/src/%s/data/apiSkeleton" % dirs["testing_app"], + "SKELETON_DIR": "%s/data/apiSkeleton" % dirs["testing_app"], "OCIS_SKELETON_STRATEGY": "%s" % ("copy" if storage == "owncloud" else "upload"), "TEST_OCIS": "true", "SEND_SCENARIO_LINE_REFERENCES": "true", @@ -723,7 +718,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "UPLOAD_DELETE_WAIT_TIME": "1" if storage == "owncloud" else 0, }, "commands": [ - "make -C /drone/src/%s test-acceptance-api" % dirs["core"], + "make -C %s test-acceptance-api" % dirs["core"], ], }, ] + failEarly(ctx, early_fail), @@ -811,10 +806,14 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "os": "linux", "arch": "amd64", }, - "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + restoreBuildArtifactCache(ctx, "web-dist", "webTestRunner") + - restoreBuildArtifactCache(ctx, "tests-yarn", "webTestRunner/tests/acceptance/.yarn") + yarnInstallUITests() + - ocisServer(storage, accounts_hash_difficulty) + waitForSeleniumService() + waitForMiddlewareService() + - restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + + "steps": skipIfUnchanged(ctx, "acceptance-tests") + + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + + restoreWebCache() + + restoreBuildArtifactCache(ctx, "tests-yarn", "%s/tests/acceptance/.yarn" % dirs["web"]) + + yarnInstallUITests() + + ocisServer(storage, accounts_hash_difficulty) + + waitForSeleniumService() + waitForMiddlewareService() + + restoreTestingAppCache() + [ { "name": "webUITests", @@ -824,7 +823,7 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "BACKEND_HOST": "https://ocis-server:9200", "RUN_ON_OCIS": "true", "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/owncloud/data", - "TESTING_DATA_DIR": "/drone/src/%s" % dirs["testing_app"], + "TESTING_DATA_DIR": dirs["testing_app"], "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", "TEST_TAGS": finalFilterTags, "LOCAL_UPLOAD_DIR": "/uploads", @@ -835,7 +834,7 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "MIDDLEWARE_HOST": "http://middleware:3000", }, "commands": [ - "cd webTestRunner/tests/acceptance", + "cd %s/tests/acceptance" % dirs["web"], "./run.sh", ], }, @@ -993,42 +992,46 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4): "os": "linux", "arch": "amd64", }, - "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + - ocisServer(storage, accounts_hash_difficulty) + waitForSeleniumService() + waitForMiddlewareService() + [ - { - "name": "WebUIAcceptanceTests", - "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, - "environment": { - "SERVER_HOST": "https://ocis-server:9200", - "BACKEND_HOST": "https://ocis-server:9200", - "RUN_ON_OCIS": "true", - "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/owncloud/data", - "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", - "TEST_TAGS": "not @skipOnOCIS and not @skip", - "LOCAL_UPLOAD_DIR": "/uploads", - "NODE_TLS_REJECT_UNAUTHORIZED": 0, - "WEB_PATH": "/srv/app/web", - "FEATURE_PATH": "/drone/src/services/settings/ui/tests/acceptance/features", - "MIDDLEWARE_HOST": "http://middleware:3000", - }, - "commands": [ - ". /drone/src/.drone.env", - # we need to have Web around for some general step definitions (eg. how to log in) - "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git /srv/app/web", - "cd /srv/app/web", - "git checkout $WEB_COMMITID", - # TODO: settings/package.json has all the acceptance test dependencies - # they shouldn't be needed since we could also use them from web:/tests/acceptance/package.json - "cd /drone/src/services/settings", - "retry -t 3 'yarn install --immutable'", - "make test-acceptance-webui", - ], - "volumes": [{ - "name": "uploads", - "path": "/uploads", - }], - }, - ] + failEarly(ctx, early_fail), + "steps": skipIfUnchanged(ctx, "acceptance-tests") + + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + + ocisServer(storage, accounts_hash_difficulty) + + waitForSeleniumService() + + waitForMiddlewareService() + + [ + { + "name": "WebUIAcceptanceTests", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "environment": { + "SERVER_HOST": "https://ocis-server:9200", + "BACKEND_HOST": "https://ocis-server:9200", + "RUN_ON_OCIS": "true", + "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/owncloud/data", + "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", + "TEST_TAGS": "not @skipOnOCIS and not @skip", + "LOCAL_UPLOAD_DIR": "/uploads", + "NODE_TLS_REJECT_UNAUTHORIZED": 0, + "WEB_PATH": "/srv/app/web", + "FEATURE_PATH": "/drone/src/services/settings/ui/tests/acceptance/features", + "MIDDLEWARE_HOST": "http://middleware:3000", + }, + "commands": [ + ". /drone/src/.drone.env", + # we need to have Web around for some general step definitions (eg. how to log in) + "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git /srv/app/web", + "cd /srv/app/web", + "git checkout $WEB_COMMITID", + # TODO: settings/package.json has all the acceptance test dependencies + # they shouldn't be needed since we could also use them from web:/tests/acceptance/package.json + "cd /drone/src/services/settings", + "retry -t 3 'yarn install --immutable'", + "make test-acceptance-webui", + ], + "volumes": [{ + "name": "uploads", + "path": "/uploads", + }], + }, + ] + failEarly(ctx, early_fail), "services": [ { "name": "redis", @@ -1949,23 +1952,6 @@ def waitForMiddlewareService(): ], }] -def cloneCoreRepos(): - return [ - { - "name": "clone-core-repos", - "image": OC_CI_ALPINE, - "commands": [ - "source .drone.env", - "git clone -b master --depth=1 https://github.com/owncloud/testing.git %s" % dirs["testing_app"], - "ls -la %s" % dirs["testing_app"], - "git clone -b $CORE_BRANCH --single-branch --no-tags https://github.com/owncloud/core.git %s" % dirs["core"], - "ls -la %s" % dirs["core"], - "cd %s" % dirs["core"], - "git checkout $CORE_COMMITID", - ], - }, - ] - def redis(): return [ { @@ -2443,8 +2429,8 @@ def parallelDeployAcceptancePipeline(ctx): }, "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + - restoreBuildArtifactCache(ctx, "testrunner", dirs["core"]) + - restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + + restoreCoreCache() + + restoreTestingAppCache() + copyConfigs() + parallelDeploymentOC10Server() + owncloudLog() + @@ -2496,8 +2482,8 @@ def parallelAcceptance(env): "REVA_LDAP_BASE_DN": "dc=owncloud,dc=com", "REVA_LDAP_HOSTNAME": "openldap", "REVA_LDAP_BIND_DN": "cn=admin,dc=owncloud,dc=com", - "SKELETON_DIR": "/drone/src/%s/data/apiSkeleton" % dirs["testing_app"], - "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], + "SKELETON_DIR": "%s/data/apiSkeleton" % dirs["testing_app"], + "PATH_TO_CORE": dirs["core"], "OCIS_REVA_DATA_ROOT": "/mnt/data/", "EXPECTED_FAILURES_FILE": "/drone/src/tests/parallelDeployAcceptance/expected-failures-API.md", "OCIS_SKELETON_STRATEGY": "copy", @@ -2799,3 +2785,84 @@ def setupForLitmus(): "cat .env", ], }] + +def performWebCache(): + return [ + { + "name": "clone-web", + "image": OC_UBUNTU, + "commands": [ + "bash -x ./tests/config/drone/clone_web.sh", + ], + }, + { + "name": "cache-web", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "bash -x ./tests/config/drone/cache_web.sh", + ], + "depends_on": ["clone-web"], + }, + ] + +def performCoreReposCache(): + return [ + { + "name": "clone-core-repos", + "image": OC_UBUNTU, + "commands": [ + "bash -x ./tests/config/drone/clone_core_repos.sh", + ], + }, + { + "name": "cache-core-repos", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "bash -x ./tests/config/drone/cache_core_repos.sh", + ], + "depends_on": [ + "clone-core-repos", + ], + }, + ] + +def restoreCoreCache(): + return [{ + "name": "retore-oc10-test-runner-cache", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror s3/owncloud/ocis/oc10-test-runner/$CORE_COMMITID %s" % dirs["core"], + "ls -la %s" % dirs["core"], + ], + }] + +def restoreTestingAppCache(): + return [{ + "name": "retore-oc10-testing-app-cache", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror s3/owncloud/ocis/oc10-test-runner/testingApp %s" % dirs["testing_app"], + "ls -la %s" % dirs["testing_app"], + ], + }] + +def restoreWebCache(): + return [{ + "name": "retore-web-cache", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror s3/owncloud/ocis/web-test-runner/$WEB_COMMITID %s" % dirs["web"], + "ls -la %s" % dirs["web"], + ], + }] diff --git a/tests/config/drone/cache_core_repos.sh b/tests/config/drone/cache_core_repos.sh new file mode 100644 index 00000000000..f34cfb085a1 --- /dev/null +++ b/tests/config/drone/cache_core_repos.sh @@ -0,0 +1,16 @@ +#!/bin/bash +source .drone.env + +echo "Checking core version - $CORE_COMMITID in cache" + +URL="https://cache.owncloud.com/owncloud/ocis/oc10-test-runner/$CORE_COMMITID" + +if curl --output /dev/null --silent --head --fail "$URL"; then + echo "Web cache for ${CORE_COMMITID} already available in cache" + exit 0 +else + # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) + mc alias set s3 "${MC_HOST}" "${AWS_ACCESS_KEY_ID}" "${AWS_SECRET_ACCESS_KEY}" + mc mirror --overwrite --remove --debug oc10TestRunner "s3/owncloud/ocis/oc10-test-runner/""${CORE_COMMITID}" + mc mirror --overwrite --remove --debug testingApp s3/owncloud/ocis/oc10-testing-app +fi diff --git a/tests/config/drone/cache_web.sh b/tests/config/drone/cache_web.sh new file mode 100644 index 00000000000..2ca76acb42c --- /dev/null +++ b/tests/config/drone/cache_web.sh @@ -0,0 +1,15 @@ +#!/bin/bash +source .drone.env + +echo "Checking web version - $WEB_COMMITID in cache" + +URL="https://cache.owncloud.com/owncloud/ocis/web-test-runner/$WEB_COMMITID" + +if curl --output /dev/null --silent --head --fail "$URL"; then + echo "web cache for $WEB_COMMITID already available in cache" + exit 0 +else + # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) + mc alias set s3 "${MC_HOST}" "${AWS_ACCESS_KEY_ID}" "${AWS_SECRET_ACCESS_KEY}" + mc mirror --overwrite --remove --debug webTestRunner "s3/owncloud/ocis/web-test-runner/""${WEB_COMMITID}" +fi diff --git a/tests/config/drone/clone_core_repos.sh b/tests/config/drone/clone_core_repos.sh new file mode 100644 index 00000000000..d1f92be6c21 --- /dev/null +++ b/tests/config/drone/clone_core_repos.sh @@ -0,0 +1,25 @@ +#!/bin/bash +source .drone.env + +echo "Checking core version - $CORE_COMMITID in cache" + +URL="https://cache.owncloud.com/owncloud/ocis/oc10-test-runner/$CORE_COMMITID" + +if curl --output /dev/null --silent --head --fail "$URL"; then + echo "Core cache for $CORE_COMMITID already available in cache" + exit 0 +else + echo "Cache for $CORE_COMMITID not available in cache, cloning..." + + # clone the core repository + git clone -b "${CORE_BRANCH}" --single-branch --no-tags https://github.com/owncloud/core.git oc10TestRunner + + cd oc10TestRunner && git checkout "${CORE_COMMITID}" + ls -la . + cd .. + + # clone the testing app repository + git clone -b master --single-branch --no-tags https://github.com/owncloud/testing.git testingApp + + ls -la testingApp +fi diff --git a/tests/config/drone/clone_web.sh b/tests/config/drone/clone_web.sh new file mode 100644 index 00000000000..5cf74454e5f --- /dev/null +++ b/tests/config/drone/clone_web.sh @@ -0,0 +1,18 @@ +#!/bin/bash +source .drone.env + +echo "Checking web version - $WEB_COMMITID in cache" + +URL="https://cache.owncloud.com/owncloud/ocis/web-test-runner/$WEB_COMMITID" + +if curl --output /dev/null --silent --head --fail "$URL"; then + echo "web cache for $WEB_COMMITID already available in cache" + exit 0 +else + echo "Cache for $WEB_COMMITID not available in cache, cloning..." + # clone the "owncloud/web" repository + git clone -b "${WEB_BRANCH}" --single-branch --no-tags https://github.com/owncloud/web.git webTestRunner + cd webTestRunner && git checkout "${WEB_COMMITID}" + + ls -la . +fi From f3e47ea5daa556a8f6675f9f1815bb8a15070a70 Mon Sep 17 00:00:00 2001 From: Kiran Parajuli Date: Wed, 3 Aug 2022 17:58:30 +0545 Subject: [PATCH 22/30] Refactor functions and wrapup Signed-off-by: Kiran Parajuli --- .drone.star | 281 ++++++++++++++----------- tests/config/drone/cache_core_repos.sh | 16 -- tests/config/drone/cache_web.sh | 15 -- tests/config/drone/check_web_cache.sh | 18 ++ tests/config/drone/clone_core_repos.sh | 25 --- tests/config/drone/clone_web.sh | 18 -- 6 files changed, 178 insertions(+), 195 deletions(-) delete mode 100644 tests/config/drone/cache_core_repos.sh delete mode 100644 tests/config/drone/cache_web.sh create mode 100644 tests/config/drone/check_web_cache.sh delete mode 100644 tests/config/drone/clone_core_repos.sh delete mode 100644 tests/config/drone/clone_web.sh diff --git a/.drone.star b/.drone.star index f69f8d70186..5e78635bad5 100644 --- a/.drone.star +++ b/.drone.star @@ -41,9 +41,11 @@ DEFAULT_PHP_VERSION = "7.4" DEFAULT_NODEJS_VERSION = "14" dirs = { - "core": "/drone/src/oc10/testrunner", - "testing_app": "/drone/src/oc10/testing", + "base": "/drone/src", "web": "/drone/src/webTestRunner", + # relative paths from /drone/src + "core": "oc10/testrunner", + "testing_app": "oc10/testing", } # configuration @@ -160,6 +162,9 @@ pipelineVolumeGo = \ # minio mc environment variables MINIO_MC_ENV = { + "CACHE_BUCKET": { + "from_secret": "cache_public_s3_bucket", + }, "MC_HOST": { "from_secret": "cache_s3_endpoint", }, @@ -213,8 +218,7 @@ def main(ctx): test_pipelines = \ cancelPreviousBuilds() + \ - buildCacheWeb() + \ - yarnCache(ctx) + \ + buildCacheWeb(ctx) + \ [buildOcisBinaryForTesting(ctx)] + \ cacheCoreReposForTesting(ctx) + \ testOcisModules(ctx) + \ @@ -233,13 +237,19 @@ def main(ctx): test_pipelines.append( pipelineDependsOn( - purgeBuildArtifactCache(ctx, "tests-yarn"), + purgeBuildArtifactCache(ctx, "ocis-binary-amd64"), testPipelines(ctx), ), ) test_pipelines.append( pipelineDependsOn( - purgeBuildArtifactCache(ctx, "ocis-binary-amd64"), + purgeBuildArtifactCache(ctx, "testrunner"), + testPipelines(ctx), + ), + ) + test_pipelines.append( + pipelineDependsOn( + purgeBuildArtifactCache(ctx, "testing_app"), testPipelines(ctx), ), ) @@ -270,12 +280,15 @@ def main(ctx): pipelineSanityChecks(ctx, pipelines) return pipelines -def buildCacheWeb(): +def buildCacheWeb(ctx): return [{ "kind": "pipeline", "type": "docker", "name": "cache-web", - "steps": performWebCache(), + "clone": { + "disable": True, + }, + "steps": performWebCache(ctx), "trigger": { "ref": [ "refs/heads/master", @@ -285,49 +298,6 @@ def buildCacheWeb(): }, }] -def yarnCache(ctx): - return [{ - "kind": "pipeline", - "type": "docker", - "name": "cache-yarn", - "steps": skipIfUnchanged(ctx, "cache") + - restoreWebCache() + - yarnInstallUITests() + - rebuildBuildArtifactCache(ctx, "tests-yarn", "%s/tests/acceptance/.yarn" % dirs["web"]), - "depends_on": getPipelineNames(buildCacheWeb()), - "trigger": { - "ref": [ - "refs/heads/master", - "refs/pull/**", - ], - }, - }] - -def yarnInstallUITests(): - return [{ - "name": "yarn-install", - "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, - "commands": [ - ". /drone/src/.drone.env", - "cd %s" % dirs["web"], - "git checkout $WEB_COMMITID", - "cd tests/acceptance/", - "retry -t 3 'yarn install --immutable'", - ], - }] - -def yarnInstallE2eTests(): - return [{ - "name": "yarn-install-e2e", - "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, - "commands": [ - ". /drone/src/.drone.env", - "cd webTestRunner", - "git checkout $WEB_COMMITID", - "retry -t 3 'yarn install --immutable'", - ], - }] - def testOcisModules(ctx): pipelines = [] for module in config["modules"]: @@ -488,7 +458,10 @@ def cacheCoreReposForTesting(ctx): "os": "linux", "arch": "amd64", }, - "steps": performCoreReposCache(), + "steps": skipIfUnchanged(ctx, "acceptance-tests") + # skip for those pipelines where core repos are not needed + cloneCoreRepos() + + rebuildBuildArtifactCache(ctx, "testrunner", dirs["core"]) + + rebuildBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]), "trigger": { "ref": [ "refs/heads/master", @@ -604,8 +577,8 @@ def localApiTests(ctx, storage, suite, accounts_hash_difficulty = 4): "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + ocisServer(storage, accounts_hash_difficulty) + - restoreCoreCache() + - restoreTestingAppCache() + + restoreBuildArtifactCache(ctx, "testrunner", dirs["core"]) + + restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + [ { "name": "localApiTests-%s-%s" % (suite, storage), @@ -613,10 +586,10 @@ def localApiTests(ctx, storage, suite, accounts_hash_difficulty = 4): "environment": { "TEST_WITH_GRAPH_API": "true", "PATH_TO_OCIS": "/drone/src", - "PATH_TO_CORE": dirs["core"], + "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], "TEST_SERVER_URL": "https://ocis-server:9200", "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), - "SKELETON_DIR": dirs["testing_app"], + "SKELETON_DIR": "/drone/src/%s/data/apiSkeleton" % dirs["testing_app"], "OCIS_SKELETON_STRATEGY": "%s" % ("copy" if storage == "owncloud" else "upload"), "TEST_OCIS": "true", "SEND_SCENARIO_LINE_REFERENCES": "true", @@ -694,8 +667,8 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + ocisServer(storage, accounts_hash_difficulty) + - restoreCoreCache() + - restoreTestingAppCache() + + restoreBuildArtifactCache(ctx, "testrunner", dirs["core"]) + + restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + [ { "name": "oC10ApiTests-%s-storage-%s" % (storage, part_number), @@ -703,10 +676,10 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "environment": { "TEST_WITH_GRAPH_API": "true", "PATH_TO_OCIS": "/drone/src", - "PATH_TO_CORE": dirs["core"], + "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], "TEST_SERVER_URL": "https://ocis-server:9200", "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), - "SKELETON_DIR": "%s/data/apiSkeleton" % dirs["testing_app"], + "SKELETON_DIR": "/drone/src/%s/data/apiSkeleton" % dirs["testing_app"], "OCIS_SKELETON_STRATEGY": "%s" % ("copy" if storage == "owncloud" else "upload"), "TEST_OCIS": "true", "SEND_SCENARIO_LINE_REFERENCES": "true", @@ -718,7 +691,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "UPLOAD_DELETE_WAIT_TIME": "1" if storage == "owncloud" else 0, }, "commands": [ - "make -C %s test-acceptance-api" % dirs["core"], + "make -C /drone/src/%s test-acceptance-api" % dirs["core"], ], }, ] + failEarly(ctx, early_fail), @@ -809,11 +782,10 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + restoreWebCache() + - restoreBuildArtifactCache(ctx, "tests-yarn", "%s/tests/acceptance/.yarn" % dirs["web"]) + - yarnInstallUITests() + + restoreWebAcceptanceYarnCache() + ocisServer(storage, accounts_hash_difficulty) + waitForSeleniumService() + waitForMiddlewareService() + - restoreTestingAppCache() + + restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + [ { "name": "webUITests", @@ -823,7 +795,7 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "BACKEND_HOST": "https://ocis-server:9200", "RUN_ON_OCIS": "true", "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/owncloud/data", - "TESTING_DATA_DIR": dirs["testing_app"], + "TESTING_DATA_DIR": "/drone/src/%s" % dirs["testing_app"], "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", "TEST_TAGS": finalFilterTags, "LOCAL_UPLOAD_DIR": "/uploads", @@ -893,8 +865,8 @@ def e2eTests(ctx): e2eTestsSteps = \ skipIfUnchanged(ctx, "e2e-tests") + \ restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin/ocis") + \ - restoreBuildArtifactCache(ctx, "web-dist", "webTestRunner") + \ - yarnInstallE2eTests() + \ + restoreWebCache() + \ + restoreWebE2EYarnCache() + \ ocisServer("ocis", 4, []) + \ e2e_test_ocis + \ uploadTracingResult(ctx) + \ @@ -997,6 +969,8 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4): ocisServer(storage, accounts_hash_difficulty) + waitForSeleniumService() + waitForMiddlewareService() + + restoreWebCache() + + restoreWebAcceptanceYarnCache() + [ { "name": "WebUIAcceptanceTests", @@ -1010,16 +984,11 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4): "TEST_TAGS": "not @skipOnOCIS and not @skip", "LOCAL_UPLOAD_DIR": "/uploads", "NODE_TLS_REJECT_UNAUTHORIZED": 0, - "WEB_PATH": "/srv/app/web", + "WEB_PATH": dirs["web"], "FEATURE_PATH": "/drone/src/services/settings/ui/tests/acceptance/features", "MIDDLEWARE_HOST": "http://middleware:3000", }, "commands": [ - ". /drone/src/.drone.env", - # we need to have Web around for some general step definitions (eg. how to log in) - "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git /srv/app/web", - "cd /srv/app/web", - "git checkout $WEB_COMMITID", # TODO: settings/package.json has all the acceptance test dependencies # they shouldn't be needed since we could also use them from web:/tests/acceptance/package.json "cd /drone/src/services/settings", @@ -1952,6 +1921,23 @@ def waitForMiddlewareService(): ], }] +def cloneCoreRepos(): + return [ + { + "name": "clone-core-repos", + "image": OC_CI_ALPINE, + "commands": [ + "source .drone.env", + "git clone -b master --depth=1 https://github.com/owncloud/testing.git %s" % dirs["testing_app"], + "ls -la %s" % dirs["testing_app"], + "git clone -b $CORE_BRANCH --single-branch --no-tags https://github.com/owncloud/core.git %s" % dirs["core"], + "ls -la %s" % dirs["core"], + "cd %s" % dirs["core"], + "git checkout $CORE_COMMITID", + ], + }, + ] + def redis(): return [ { @@ -2429,8 +2415,8 @@ def parallelDeployAcceptancePipeline(ctx): }, "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + - restoreCoreCache() + - restoreTestingAppCache() + + restoreBuildArtifactCache(ctx, "testrunner", dirs["core"]) + + restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + copyConfigs() + parallelDeploymentOC10Server() + owncloudLog() + @@ -2482,8 +2468,8 @@ def parallelAcceptance(env): "REVA_LDAP_BASE_DN": "dc=owncloud,dc=com", "REVA_LDAP_HOSTNAME": "openldap", "REVA_LDAP_BIND_DN": "cn=admin,dc=owncloud,dc=com", - "SKELETON_DIR": "%s/data/apiSkeleton" % dirs["testing_app"], - "PATH_TO_CORE": dirs["core"], + "SKELETON_DIR": "/drone/src/%s/data/apiSkeleton" % dirs["testing_app"], + "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], "OCIS_REVA_DATA_ROOT": "/mnt/data/", "EXPECTED_FAILURES_FILE": "/drone/src/tests/parallelDeployAcceptance/expected-failures-API.md", "OCIS_SKELETON_STRATEGY": "copy", @@ -2786,13 +2772,47 @@ def setupForLitmus(): ], }] -def performWebCache(): +def performWebCache(ctx): + ocis_git_base_url = "https://raw.githubusercontent.com/owncloud/ocis" + path_to_drone_env = "%s/%s/.drone.env" % (ocis_git_base_url, ctx.build.commit) + path_to_check_script = "%s/%s/tests/config/drone/check_web_cache.sh" % (ocis_git_base_url, ctx.build.commit) + return [ { - "name": "clone-web", + "name": "get-drone-env-and-check-script", "image": OC_UBUNTU, "commands": [ - "bash -x ./tests/config/drone/clone_web.sh", + "curl -s -o .drone.env %s" % path_to_drone_env, + "cat .drone.env", + "curl -s -o check_web_cache.sh %s" % path_to_check_script, + "chmod +x check_web_cache.sh", + "cat check_web_cache.sh", + ], + }, + { + "name": "check-for-web-cache", + "image": OC_UBUNTU, + "environment": { + "CACHE_ENDPOINT": { + "from_secret": "cache_public_s3_server", + }, + "CACHE_BUCKET": { + "from_secret": "cache_public_s3_bucket", + }, + }, + "commands": [ + "bash check_web_cache.sh", + ], + }, + { + "name": "clone-web", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + ". ./.drone.env", + "rm -rf /drone/src/webTestRunner", + "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git webTestRunner", + "cd webTestRunner && git checkout $WEB_COMMITID", + "ls -la", ], }, { @@ -2800,60 +2820,36 @@ def performWebCache(): "image": MINIO_MC, "environment": MINIO_MC_ENV, "commands": [ - "bash -x ./tests/config/drone/cache_web.sh", + "source ./.drone.env", + # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror --overwrite --remove webTestRunner s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID", ], - "depends_on": ["clone-web"], }, - ] - -def performCoreReposCache(): - return [ { - "name": "clone-core-repos", - "image": OC_UBUNTU, + "name": "install-yarn", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, "commands": [ - "bash -x ./tests/config/drone/clone_core_repos.sh", + "cd %s/webTestRunner" % dirs["base"], + "retry -t 3 'yarn install --immutable --frozen-lockfile'", + "cd %s/webTestRunner/tests/acceptance" % dirs["base"], + "retry -t 3 'yarn install --immutable --frozen-lockfile'", ], }, { - "name": "cache-core-repos", + "name": "cache-yarn", "image": MINIO_MC, "environment": MINIO_MC_ENV, "commands": [ - "bash -x ./tests/config/drone/cache_core_repos.sh", - ], - "depends_on": [ - "clone-core-repos", + "source ./.drone.env", + # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror --overwrite --remove webTestRunner/.yarn s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-e2e-$WEB_COMMITID", + "mc mirror --overwrite --remove webTestRunner/tests/acceptance/.yarn s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-acceptance-$WEB_COMMITID", ], }, ] -def restoreCoreCache(): - return [{ - "name": "retore-oc10-test-runner-cache", - "image": MINIO_MC, - "environment": MINIO_MC_ENV, - "commands": [ - "source ./.drone.env", - "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc mirror s3/owncloud/ocis/oc10-test-runner/$CORE_COMMITID %s" % dirs["core"], - "ls -la %s" % dirs["core"], - ], - }] - -def restoreTestingAppCache(): - return [{ - "name": "retore-oc10-testing-app-cache", - "image": MINIO_MC, - "environment": MINIO_MC_ENV, - "commands": [ - "source ./.drone.env", - "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc mirror s3/owncloud/ocis/oc10-test-runner/testingApp %s" % dirs["testing_app"], - "ls -la %s" % dirs["testing_app"], - ], - }] - def restoreWebCache(): return [{ "name": "retore-web-cache", @@ -2862,7 +2858,50 @@ def restoreWebCache(): "commands": [ "source ./.drone.env", "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc mirror s3/owncloud/ocis/web-test-runner/$WEB_COMMITID %s" % dirs["web"], + "mc mirror s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID %s" % dirs["web"], "ls -la %s" % dirs["web"], + "chmod +x %s/tests/acceptance/*.sh" % dirs["web"], + ], + }] + +def restoreWebE2EYarnCache(): + return [{ + "name": "retore-web-e2e-yarn-cache", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-e2e-$WEB_COMMITID %s/.yarn" % dirs["web"], + "ls -la %s/.yarn" % dirs["web"], + ], + }, { + # we need to install again becase the node_modules are not cached + "name": "install-yarn-e2e", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + "cd %s" % dirs["web"], + "retry -t 3 'yarn install --immutable'", + ], + }] + +def restoreWebAcceptanceYarnCache(): + return [{ + "name": "retore-web-acceptance-yarn-cache", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-acceptance-$WEB_COMMITID %s/tests/acceptance/.yarn" % dirs["web"], + "ls -la %s/tests/acceptance/.yarn" % dirs["web"], + ], + }, { + # we need to install again becase the node_modules are not cached + "name": "install-yarn-acceptance", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + "cd %s/tests/acceptance" % dirs["web"], + "retry -t 3 'yarn install --immutable'", ], }] diff --git a/tests/config/drone/cache_core_repos.sh b/tests/config/drone/cache_core_repos.sh deleted file mode 100644 index f34cfb085a1..00000000000 --- a/tests/config/drone/cache_core_repos.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -source .drone.env - -echo "Checking core version - $CORE_COMMITID in cache" - -URL="https://cache.owncloud.com/owncloud/ocis/oc10-test-runner/$CORE_COMMITID" - -if curl --output /dev/null --silent --head --fail "$URL"; then - echo "Web cache for ${CORE_COMMITID} already available in cache" - exit 0 -else - # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) - mc alias set s3 "${MC_HOST}" "${AWS_ACCESS_KEY_ID}" "${AWS_SECRET_ACCESS_KEY}" - mc mirror --overwrite --remove --debug oc10TestRunner "s3/owncloud/ocis/oc10-test-runner/""${CORE_COMMITID}" - mc mirror --overwrite --remove --debug testingApp s3/owncloud/ocis/oc10-testing-app -fi diff --git a/tests/config/drone/cache_web.sh b/tests/config/drone/cache_web.sh deleted file mode 100644 index 2ca76acb42c..00000000000 --- a/tests/config/drone/cache_web.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -source .drone.env - -echo "Checking web version - $WEB_COMMITID in cache" - -URL="https://cache.owncloud.com/owncloud/ocis/web-test-runner/$WEB_COMMITID" - -if curl --output /dev/null --silent --head --fail "$URL"; then - echo "web cache for $WEB_COMMITID already available in cache" - exit 0 -else - # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) - mc alias set s3 "${MC_HOST}" "${AWS_ACCESS_KEY_ID}" "${AWS_SECRET_ACCESS_KEY}" - mc mirror --overwrite --remove --debug webTestRunner "s3/owncloud/ocis/web-test-runner/""${WEB_COMMITID}" -fi diff --git a/tests/config/drone/check_web_cache.sh b/tests/config/drone/check_web_cache.sh new file mode 100644 index 00000000000..6ef83fa5533 --- /dev/null +++ b/tests/config/drone/check_web_cache.sh @@ -0,0 +1,18 @@ +#!/bin/bash +source .drone.env + +echo "Checking web version - $WEB_COMMITID in cache" + +URL="$CACHE_ENDPOINT/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID/README.md" + +echo "Checking for the web cache at '$URL'." + +if curl --output /dev/null --silent --head --fail "$URL" +then + echo "Web with commit id $WEB_COMMITID already available in cache" + # https://discourse.drone.io/t/how-to-exit-a-pipeline-early-without-failing/3951 + # exit a Pipeline early without failing + exit 78 +else + echo "Web with $WEB_COMMITID not available in cache" +fi diff --git a/tests/config/drone/clone_core_repos.sh b/tests/config/drone/clone_core_repos.sh deleted file mode 100644 index d1f92be6c21..00000000000 --- a/tests/config/drone/clone_core_repos.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -source .drone.env - -echo "Checking core version - $CORE_COMMITID in cache" - -URL="https://cache.owncloud.com/owncloud/ocis/oc10-test-runner/$CORE_COMMITID" - -if curl --output /dev/null --silent --head --fail "$URL"; then - echo "Core cache for $CORE_COMMITID already available in cache" - exit 0 -else - echo "Cache for $CORE_COMMITID not available in cache, cloning..." - - # clone the core repository - git clone -b "${CORE_BRANCH}" --single-branch --no-tags https://github.com/owncloud/core.git oc10TestRunner - - cd oc10TestRunner && git checkout "${CORE_COMMITID}" - ls -la . - cd .. - - # clone the testing app repository - git clone -b master --single-branch --no-tags https://github.com/owncloud/testing.git testingApp - - ls -la testingApp -fi diff --git a/tests/config/drone/clone_web.sh b/tests/config/drone/clone_web.sh deleted file mode 100644 index 5cf74454e5f..00000000000 --- a/tests/config/drone/clone_web.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -source .drone.env - -echo "Checking web version - $WEB_COMMITID in cache" - -URL="https://cache.owncloud.com/owncloud/ocis/web-test-runner/$WEB_COMMITID" - -if curl --output /dev/null --silent --head --fail "$URL"; then - echo "web cache for $WEB_COMMITID already available in cache" - exit 0 -else - echo "Cache for $WEB_COMMITID not available in cache, cloning..." - # clone the "owncloud/web" repository - git clone -b "${WEB_BRANCH}" --single-branch --no-tags https://github.com/owncloud/web.git webTestRunner - cd webTestRunner && git checkout "${WEB_COMMITID}" - - ls -la . -fi From 1647cc7d9c88e90e96b0d5c5844296d4f14cc45b Mon Sep 17 00:00:00 2001 From: Kiran Parajuli Date: Fri, 5 Aug 2022 14:38:59 +0545 Subject: [PATCH 23/30] Address reviews Signed-off-by: Kiran Parajuli --- .drone.star | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.drone.star b/.drone.star index 5e78635bad5..49ad60b9395 100644 --- a/.drone.star +++ b/.drone.star @@ -2783,10 +2783,8 @@ def performWebCache(ctx): "image": OC_UBUNTU, "commands": [ "curl -s -o .drone.env %s" % path_to_drone_env, - "cat .drone.env", "curl -s -o check_web_cache.sh %s" % path_to_check_script, "chmod +x check_web_cache.sh", - "cat check_web_cache.sh", ], }, { @@ -2852,7 +2850,7 @@ def performWebCache(ctx): def restoreWebCache(): return [{ - "name": "retore-web-cache", + "name": "restore-web-cache", "image": MINIO_MC, "environment": MINIO_MC_ENV, "commands": [ @@ -2866,7 +2864,7 @@ def restoreWebCache(): def restoreWebE2EYarnCache(): return [{ - "name": "retore-web-e2e-yarn-cache", + "name": "restore-web-e2e-yarn-cache", "image": MINIO_MC, "environment": MINIO_MC_ENV, "commands": [ @@ -2887,7 +2885,7 @@ def restoreWebE2EYarnCache(): def restoreWebAcceptanceYarnCache(): return [{ - "name": "retore-web-acceptance-yarn-cache", + "name": "restore-web-acceptance-yarn-cache", "image": MINIO_MC, "environment": MINIO_MC_ENV, "commands": [ From 81f0e480b6f897aa0e1020f579ea92f48b38cb51 Mon Sep 17 00:00:00 2001 From: Kiran Parajuli Date: Tue, 9 Aug 2022 14:12:29 +0545 Subject: [PATCH 24/30] Address more reviews Signed-off-by: Kiran Parajuli --- .drone.star | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.star b/.drone.star index 49ad60b9395..33e0303a559 100644 --- a/.drone.star +++ b/.drone.star @@ -288,7 +288,7 @@ def buildCacheWeb(ctx): "clone": { "disable": True, }, - "steps": performWebCache(ctx), + "steps": generateWebCache(ctx), "trigger": { "ref": [ "refs/heads/master", @@ -784,7 +784,8 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, restoreWebCache() + restoreWebAcceptanceYarnCache() + ocisServer(storage, accounts_hash_difficulty) + - waitForSeleniumService() + waitForMiddlewareService() + + waitForSeleniumService() + + waitForMiddlewareService() + restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + [ { @@ -2772,7 +2773,7 @@ def setupForLitmus(): ], }] -def performWebCache(ctx): +def generateWebCache(ctx): ocis_git_base_url = "https://raw.githubusercontent.com/owncloud/ocis" path_to_drone_env = "%s/%s/.drone.env" % (ocis_git_base_url, ctx.build.commit) path_to_check_script = "%s/%s/tests/config/drone/check_web_cache.sh" % (ocis_git_base_url, ctx.build.commit) @@ -2784,7 +2785,6 @@ def performWebCache(ctx): "commands": [ "curl -s -o .drone.env %s" % path_to_drone_env, "curl -s -o check_web_cache.sh %s" % path_to_check_script, - "chmod +x check_web_cache.sh", ], }, { From 5ec10fe17f11d7f51d3c1308f33a8ef005042498 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Tue, 9 Aug 2022 10:07:37 +0000 Subject: [PATCH 25/30] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f5521c7807..2e837186c89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1371,7 +1371,7 @@ The following sections list the changes for 2.0.0-beta.5. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 ## Summary @@ -1539,28 +1539,11 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 ## Summary @@ -1729,6 +1712,23 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 59b582c669c59b2f3382b42ea1bebccbad841303 Mon Sep 17 00:00:00 2001 From: Kiran Parajuli Date: Tue, 9 Aug 2022 17:06:43 +0545 Subject: [PATCH 26/30] Address dirs review Signed-off-by: Kiran Parajuli --- .drone.star | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/.drone.star b/.drone.star index 33e0303a559..ec6434a523c 100644 --- a/.drone.star +++ b/.drone.star @@ -43,7 +43,9 @@ DEFAULT_NODEJS_VERSION = "14" dirs = { "base": "/drone/src", "web": "/drone/src/webTestRunner", - # relative paths from /drone/src + # relate path from the base directory, i.e. "/drone/src" + # this is because the PLUGINS_S3_CACHE does not support absolute paths + # PLUGINS_S3_CACHE is used to cache the core and testing app "core": "oc10/testrunner", "testing_app": "oc10/testing", } @@ -460,6 +462,8 @@ def cacheCoreReposForTesting(ctx): }, "steps": skipIfUnchanged(ctx, "acceptance-tests") + # skip for those pipelines where core repos are not needed cloneCoreRepos() + + # this does not support the absolute path to the target directory + # so we need to use a relative path :( rebuildBuildArtifactCache(ctx, "testrunner", dirs["core"]) + rebuildBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]), "trigger": { @@ -585,11 +589,11 @@ def localApiTests(ctx, storage, suite, accounts_hash_difficulty = 4): "image": OC_CI_PHP % DEFAULT_PHP_VERSION, "environment": { "TEST_WITH_GRAPH_API": "true", - "PATH_TO_OCIS": "/drone/src", - "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], + "PATH_TO_OCIS": dirs["base"], + "PATH_TO_CORE": "%s/%s" % (dirs["base"], dirs["core"]), "TEST_SERVER_URL": "https://ocis-server:9200", "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), - "SKELETON_DIR": "/drone/src/%s/data/apiSkeleton" % dirs["testing_app"], + "SKELETON_DIR": "%s/%s/data/apiSkeleton" % (dirs["base"], dirs["testing_app"]), "OCIS_SKELETON_STRATEGY": "%s" % ("copy" if storage == "owncloud" else "upload"), "TEST_OCIS": "true", "SEND_SCENARIO_LINE_REFERENCES": "true", @@ -679,7 +683,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], "TEST_SERVER_URL": "https://ocis-server:9200", "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), - "SKELETON_DIR": "/drone/src/%s/data/apiSkeleton" % dirs["testing_app"], + "SKELETON_DIR": "%s/%s/data/apiSkeleton" % (dirs["base"], dirs["testing_app"]), "OCIS_SKELETON_STRATEGY": "%s" % ("copy" if storage == "owncloud" else "upload"), "TEST_OCIS": "true", "SEND_SCENARIO_LINE_REFERENCES": "true", @@ -796,14 +800,14 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "BACKEND_HOST": "https://ocis-server:9200", "RUN_ON_OCIS": "true", "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/owncloud/data", - "TESTING_DATA_DIR": "/drone/src/%s" % dirs["testing_app"], + "TESTING_DATA_DIR": "%s/%s" % (dirs["base"], dirs["testing_app"]), "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", "TEST_TAGS": finalFilterTags, "LOCAL_UPLOAD_DIR": "/uploads", "NODE_TLS_REJECT_UNAUTHORIZED": 0, "RUN_PART": runPart, "DIVIDE_INTO_NUM_PARTS": numberOfParts, - "EXPECTED_FAILURES_FILE": "/drone/src/tests/acceptance/expected-failures-webUI-on-%s-storage%s.md" % (storage.upper(), expectedFailuresFileFilterTags), + "EXPECTED_FAILURES_FILE": "/%s/tests/acceptance/expected-failures-webUI-on-%s-storage%s.md" % (dirs["base"], storage.upper(), expectedFailuresFileFilterTags), "MIDDLEWARE_HOST": "http://middleware:3000", }, "commands": [ @@ -2469,8 +2473,8 @@ def parallelAcceptance(env): "REVA_LDAP_BASE_DN": "dc=owncloud,dc=com", "REVA_LDAP_HOSTNAME": "openldap", "REVA_LDAP_BIND_DN": "cn=admin,dc=owncloud,dc=com", - "SKELETON_DIR": "/drone/src/%s/data/apiSkeleton" % dirs["testing_app"], - "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], + "SKELETON_DIR": "/%s/%s/data/apiSkeleton" % (dirs["base"], dirs["testing_app"]), + "PATH_TO_CORE": "/%s/%s" % (dirs["base"], dirs["core"]), "OCIS_REVA_DATA_ROOT": "/mnt/data/", "EXPECTED_FAILURES_FILE": "/drone/src/tests/parallelDeployAcceptance/expected-failures-API.md", "OCIS_SKELETON_STRATEGY": "copy", @@ -2807,9 +2811,9 @@ def generateWebCache(ctx): "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, "commands": [ ". ./.drone.env", - "rm -rf /drone/src/webTestRunner", - "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git webTestRunner", - "cd webTestRunner && git checkout $WEB_COMMITID", + "rm -rf %s" % dirs["web"], + "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git %s" % dirs["web"], + "cd %s && git checkout $WEB_COMMITID" % dirs["web"], "ls -la", ], }, @@ -2821,16 +2825,16 @@ def generateWebCache(ctx): "source ./.drone.env", # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc mirror --overwrite --remove webTestRunner s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID", + "mc mirror --overwrite --remove %s s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID" % dirs["web"], ], }, { "name": "install-yarn", "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, "commands": [ - "cd %s/webTestRunner" % dirs["base"], + "cd %s" % dirs["web"], "retry -t 3 'yarn install --immutable --frozen-lockfile'", - "cd %s/webTestRunner/tests/acceptance" % dirs["base"], + "cd %s/tests/acceptance" % dirs["web"], "retry -t 3 'yarn install --immutable --frozen-lockfile'", ], }, @@ -2842,8 +2846,8 @@ def generateWebCache(ctx): "source ./.drone.env", # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", - "mc mirror --overwrite --remove webTestRunner/.yarn s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-e2e-$WEB_COMMITID", - "mc mirror --overwrite --remove webTestRunner/tests/acceptance/.yarn s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-acceptance-$WEB_COMMITID", + "mc mirror --overwrite --remove %s/.yarn s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-e2e-$WEB_COMMITID" % dirs["web"], + "mc mirror --overwrite --remove %s/tests/acceptance/.yarn s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-acceptance-$WEB_COMMITID" % dirs["web"], ], }, ] From bdb3fc4ecdbf0576c2b7875ca305b34a4430f9fc Mon Sep 17 00:00:00 2001 From: Christian Richter <1058116+dragonchaser@users.noreply.github.com> Date: Tue, 9 Aug 2022 11:53:10 +0000 Subject: [PATCH 27/30] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e837186c89..3f5521c7807 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1371,7 +1371,7 @@ The following sections list the changes for 2.0.0-beta.5. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 ## Summary @@ -1539,11 +1539,28 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 ## Summary @@ -1712,23 +1729,6 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 76d00e195e8ac6daef5769f02b190a65b31cef2b Mon Sep 17 00:00:00 2001 From: PKiran <39373750+kiranparajuli589@users.noreply.github.com> Date: Wed, 10 Aug 2022 13:25:23 +0545 Subject: [PATCH 28/30] [full-ci][tests-only] use global cache for web and core repos usage (#4309) --- .drone.star | 346 +++++++++++++++++--------- tests/config/drone/check_web_cache.sh | 18 ++ 2 files changed, 245 insertions(+), 119 deletions(-) create mode 100644 tests/config/drone/check_web_cache.sh diff --git a/.drone.star b/.drone.star index d3a02c4ffe4..ec6434a523c 100644 --- a/.drone.star +++ b/.drone.star @@ -41,7 +41,11 @@ DEFAULT_PHP_VERSION = "7.4" DEFAULT_NODEJS_VERSION = "14" dirs = { - # relative paths from /drone/src + "base": "/drone/src", + "web": "/drone/src/webTestRunner", + # relate path from the base directory, i.e. "/drone/src" + # this is because the PLUGINS_S3_CACHE does not support absolute paths + # PLUGINS_S3_CACHE is used to cache the core and testing app "core": "oc10/testrunner", "testing_app": "oc10/testing", } @@ -158,6 +162,22 @@ pipelineVolumeGo = \ "temp": {}, } +# minio mc environment variables +MINIO_MC_ENV = { + "CACHE_BUCKET": { + "from_secret": "cache_public_s3_bucket", + }, + "MC_HOST": { + "from_secret": "cache_s3_endpoint", + }, + "AWS_ACCESS_KEY_ID": { + "from_secret": "cache_s3_access_key", + }, + "AWS_SECRET_ACCESS_KEY": { + "from_secret": "cache_s3_secret_key", + }, +} + def pipelineDependsOn(pipeline, dependant_pipelines): if "depends_on" in pipeline.keys(): pipeline["depends_on"] = pipeline["depends_on"] + getPipelineNames(dependant_pipelines) @@ -201,7 +221,6 @@ def main(ctx): test_pipelines = \ cancelPreviousBuilds() + \ buildCacheWeb(ctx) + \ - yarnCache(ctx) + \ [buildOcisBinaryForTesting(ctx)] + \ cacheCoreReposForTesting(ctx) + \ testOcisModules(ctx) + \ @@ -268,9 +287,10 @@ def buildCacheWeb(ctx): "kind": "pipeline", "type": "docker", "name": "cache-web", - "steps": skipIfUnchanged(ctx, "cache") + - installWebTestRunner() + - rebuildBuildArtifactCache(ctx, "web-dist", "webTestRunner"), + "clone": { + "disable": True, + }, + "steps": generateWebCache(ctx), "trigger": { "ref": [ "refs/heads/master", @@ -280,59 +300,6 @@ def buildCacheWeb(ctx): }, }] -def yarnCache(ctx): - return [{ - "kind": "pipeline", - "type": "docker", - "name": "cache-yarn", - "steps": skipIfUnchanged(ctx, "cache") + - restoreBuildArtifactCache(ctx, "web-dist", "webTestRunner") + - yarnInstallUITests() + - rebuildBuildArtifactCache(ctx, "tests-yarn", "webTestRunner/tests/acceptance/.yarn"), - "depends_on": getPipelineNames(buildCacheWeb(ctx)), - "trigger": { - "ref": [ - "refs/heads/master", - "refs/pull/**", - ], - }, - }] - -def installWebTestRunner(): - return [{ - "name": "install-web-test-runner", - "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, - "commands": [ - ". /drone/src/.drone.env", - "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git webTestRunner", - ], - }] - -def yarnInstallUITests(): - return [{ - "name": "yarn-install", - "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, - "commands": [ - ". /drone/src/.drone.env", - "cd webTestRunner", - "git checkout $WEB_COMMITID", - "cd tests/acceptance/", - "retry -t 3 'yarn install --immutable'", - ], - }] - -def yarnInstallE2eTests(): - return [{ - "name": "yarn-install-e2e", - "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, - "commands": [ - ". /drone/src/.drone.env", - "cd webTestRunner", - "git checkout $WEB_COMMITID", - "retry -t 3 'yarn install --immutable'", - ], - }] - def testOcisModules(ctx): pipelines = [] for module in config["modules"]: @@ -495,6 +462,8 @@ def cacheCoreReposForTesting(ctx): }, "steps": skipIfUnchanged(ctx, "acceptance-tests") + # skip for those pipelines where core repos are not needed cloneCoreRepos() + + # this does not support the absolute path to the target directory + # so we need to use a relative path :( rebuildBuildArtifactCache(ctx, "testrunner", dirs["core"]) + rebuildBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]), "trigger": { @@ -620,11 +589,11 @@ def localApiTests(ctx, storage, suite, accounts_hash_difficulty = 4): "image": OC_CI_PHP % DEFAULT_PHP_VERSION, "environment": { "TEST_WITH_GRAPH_API": "true", - "PATH_TO_OCIS": "/drone/src", - "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], + "PATH_TO_OCIS": dirs["base"], + "PATH_TO_CORE": "%s/%s" % (dirs["base"], dirs["core"]), "TEST_SERVER_URL": "https://ocis-server:9200", "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), - "SKELETON_DIR": "%s/data/apiSkeleton" % dirs["testing_app"], + "SKELETON_DIR": "%s/%s/data/apiSkeleton" % (dirs["base"], dirs["testing_app"]), "OCIS_SKELETON_STRATEGY": "%s" % ("copy" if storage == "owncloud" else "upload"), "TEST_OCIS": "true", "SEND_SCENARIO_LINE_REFERENCES": "true", @@ -663,17 +632,20 @@ def cs3ApiTests(ctx, storage, accounts_hash_difficulty = 4): "os": "linux", "arch": "amd64", }, - "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + - ocisServer(storage, accounts_hash_difficulty, []) + [ - { - "name": "cs3ApiTests-%s" % (storage), - "image": OC_CS3_API_VALIDATOR, - "environment": {}, - "commands": [ - "/usr/bin/cs3api-validator /var/lib/cs3api-validator --endpoint=ocis-server:9142", - ], - }, - ] + failEarly(ctx, early_fail), + "steps": skipIfUnchanged(ctx, "acceptance-tests") + + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + + ocisServer(storage, accounts_hash_difficulty, []) + + [ + { + "name": "cs3ApiTests-%s" % (storage), + "image": OC_CS3_API_VALIDATOR, + "environment": {}, + "commands": [ + "/usr/bin/cs3api-validator /var/lib/cs3api-validator --endpoint=ocis-server:9142", + ], + }, + ] + + failEarly(ctx, early_fail), "depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]), "trigger": { "ref": [ @@ -711,7 +683,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], "TEST_SERVER_URL": "https://ocis-server:9200", "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), - "SKELETON_DIR": "/drone/src/%s/data/apiSkeleton" % dirs["testing_app"], + "SKELETON_DIR": "%s/%s/data/apiSkeleton" % (dirs["base"], dirs["testing_app"]), "OCIS_SKELETON_STRATEGY": "%s" % ("copy" if storage == "owncloud" else "upload"), "TEST_OCIS": "true", "SEND_SCENARIO_LINE_REFERENCES": "true", @@ -811,9 +783,13 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "os": "linux", "arch": "amd64", }, - "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + restoreBuildArtifactCache(ctx, "web-dist", "webTestRunner") + - restoreBuildArtifactCache(ctx, "tests-yarn", "webTestRunner/tests/acceptance/.yarn") + yarnInstallUITests() + - ocisServer(storage, accounts_hash_difficulty) + waitForSeleniumService() + waitForMiddlewareService() + + "steps": skipIfUnchanged(ctx, "acceptance-tests") + + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + + restoreWebCache() + + restoreWebAcceptanceYarnCache() + + ocisServer(storage, accounts_hash_difficulty) + + waitForSeleniumService() + + waitForMiddlewareService() + restoreBuildArtifactCache(ctx, "testing_app", dirs["testing_app"]) + [ { @@ -824,18 +800,18 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "BACKEND_HOST": "https://ocis-server:9200", "RUN_ON_OCIS": "true", "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/owncloud/data", - "TESTING_DATA_DIR": "/drone/src/%s" % dirs["testing_app"], + "TESTING_DATA_DIR": "%s/%s" % (dirs["base"], dirs["testing_app"]), "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", "TEST_TAGS": finalFilterTags, "LOCAL_UPLOAD_DIR": "/uploads", "NODE_TLS_REJECT_UNAUTHORIZED": 0, "RUN_PART": runPart, "DIVIDE_INTO_NUM_PARTS": numberOfParts, - "EXPECTED_FAILURES_FILE": "/drone/src/tests/acceptance/expected-failures-webUI-on-%s-storage%s.md" % (storage.upper(), expectedFailuresFileFilterTags), + "EXPECTED_FAILURES_FILE": "/%s/tests/acceptance/expected-failures-webUI-on-%s-storage%s.md" % (dirs["base"], storage.upper(), expectedFailuresFileFilterTags), "MIDDLEWARE_HOST": "http://middleware:3000", }, "commands": [ - "cd webTestRunner/tests/acceptance", + "cd %s/tests/acceptance" % dirs["web"], "./run.sh", ], }, @@ -894,8 +870,8 @@ def e2eTests(ctx): e2eTestsSteps = \ skipIfUnchanged(ctx, "e2e-tests") + \ restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin/ocis") + \ - restoreBuildArtifactCache(ctx, "web-dist", "webTestRunner") + \ - yarnInstallE2eTests() + \ + restoreWebCache() + \ + restoreWebE2EYarnCache() + \ ocisServer("ocis", 4, []) + \ e2e_test_ocis + \ uploadTracingResult(ctx) + \ @@ -993,42 +969,43 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4): "os": "linux", "arch": "amd64", }, - "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + - ocisServer(storage, accounts_hash_difficulty) + waitForSeleniumService() + waitForMiddlewareService() + [ - { - "name": "WebUIAcceptanceTests", - "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, - "environment": { - "SERVER_HOST": "https://ocis-server:9200", - "BACKEND_HOST": "https://ocis-server:9200", - "RUN_ON_OCIS": "true", - "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/owncloud/data", - "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", - "TEST_TAGS": "not @skipOnOCIS and not @skip", - "LOCAL_UPLOAD_DIR": "/uploads", - "NODE_TLS_REJECT_UNAUTHORIZED": 0, - "WEB_PATH": "/srv/app/web", - "FEATURE_PATH": "/drone/src/services/settings/ui/tests/acceptance/features", - "MIDDLEWARE_HOST": "http://middleware:3000", - }, - "commands": [ - ". /drone/src/.drone.env", - # we need to have Web around for some general step definitions (eg. how to log in) - "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git /srv/app/web", - "cd /srv/app/web", - "git checkout $WEB_COMMITID", - # TODO: settings/package.json has all the acceptance test dependencies - # they shouldn't be needed since we could also use them from web:/tests/acceptance/package.json - "cd /drone/src/services/settings", - "retry -t 3 'yarn install --immutable'", - "make test-acceptance-webui", - ], - "volumes": [{ - "name": "uploads", - "path": "/uploads", - }], - }, - ] + failEarly(ctx, early_fail), + "steps": skipIfUnchanged(ctx, "acceptance-tests") + + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + + ocisServer(storage, accounts_hash_difficulty) + + waitForSeleniumService() + + waitForMiddlewareService() + + restoreWebCache() + + restoreWebAcceptanceYarnCache() + + [ + { + "name": "WebUIAcceptanceTests", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "environment": { + "SERVER_HOST": "https://ocis-server:9200", + "BACKEND_HOST": "https://ocis-server:9200", + "RUN_ON_OCIS": "true", + "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/owncloud/data", + "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", + "TEST_TAGS": "not @skipOnOCIS and not @skip", + "LOCAL_UPLOAD_DIR": "/uploads", + "NODE_TLS_REJECT_UNAUTHORIZED": 0, + "WEB_PATH": dirs["web"], + "FEATURE_PATH": "/drone/src/services/settings/ui/tests/acceptance/features", + "MIDDLEWARE_HOST": "http://middleware:3000", + }, + "commands": [ + # TODO: settings/package.json has all the acceptance test dependencies + # they shouldn't be needed since we could also use them from web:/tests/acceptance/package.json + "cd /drone/src/services/settings", + "retry -t 3 'yarn install --immutable'", + "make test-acceptance-webui", + ], + "volumes": [{ + "name": "uploads", + "path": "/uploads", + }], + }, + ] + failEarly(ctx, early_fail), "services": [ { "name": "redis", @@ -2496,8 +2473,8 @@ def parallelAcceptance(env): "REVA_LDAP_BASE_DN": "dc=owncloud,dc=com", "REVA_LDAP_HOSTNAME": "openldap", "REVA_LDAP_BIND_DN": "cn=admin,dc=owncloud,dc=com", - "SKELETON_DIR": "/drone/src/%s/data/apiSkeleton" % dirs["testing_app"], - "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], + "SKELETON_DIR": "/%s/%s/data/apiSkeleton" % (dirs["base"], dirs["testing_app"]), + "PATH_TO_CORE": "/%s/%s" % (dirs["base"], dirs["core"]), "OCIS_REVA_DATA_ROOT": "/mnt/data/", "EXPECTED_FAILURES_FILE": "/drone/src/tests/parallelDeployAcceptance/expected-failures-API.md", "OCIS_SKELETON_STRATEGY": "copy", @@ -2799,3 +2776,134 @@ def setupForLitmus(): "cat .env", ], }] + +def generateWebCache(ctx): + ocis_git_base_url = "https://raw.githubusercontent.com/owncloud/ocis" + path_to_drone_env = "%s/%s/.drone.env" % (ocis_git_base_url, ctx.build.commit) + path_to_check_script = "%s/%s/tests/config/drone/check_web_cache.sh" % (ocis_git_base_url, ctx.build.commit) + + return [ + { + "name": "get-drone-env-and-check-script", + "image": OC_UBUNTU, + "commands": [ + "curl -s -o .drone.env %s" % path_to_drone_env, + "curl -s -o check_web_cache.sh %s" % path_to_check_script, + ], + }, + { + "name": "check-for-web-cache", + "image": OC_UBUNTU, + "environment": { + "CACHE_ENDPOINT": { + "from_secret": "cache_public_s3_server", + }, + "CACHE_BUCKET": { + "from_secret": "cache_public_s3_bucket", + }, + }, + "commands": [ + "bash check_web_cache.sh", + ], + }, + { + "name": "clone-web", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + ". ./.drone.env", + "rm -rf %s" % dirs["web"], + "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git %s" % dirs["web"], + "cd %s && git checkout $WEB_COMMITID" % dirs["web"], + "ls -la", + ], + }, + { + "name": "cache-web", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror --overwrite --remove %s s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID" % dirs["web"], + ], + }, + { + "name": "install-yarn", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + "cd %s" % dirs["web"], + "retry -t 3 'yarn install --immutable --frozen-lockfile'", + "cd %s/tests/acceptance" % dirs["web"], + "retry -t 3 'yarn install --immutable --frozen-lockfile'", + ], + }, + { + "name": "cache-yarn", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + # cache using the minio/mc client to the 'owncloud' bucket (long term bucket) + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror --overwrite --remove %s/.yarn s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-e2e-$WEB_COMMITID" % dirs["web"], + "mc mirror --overwrite --remove %s/tests/acceptance/.yarn s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-acceptance-$WEB_COMMITID" % dirs["web"], + ], + }, + ] + +def restoreWebCache(): + return [{ + "name": "restore-web-cache", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror s3/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID %s" % dirs["web"], + "ls -la %s" % dirs["web"], + "chmod +x %s/tests/acceptance/*.sh" % dirs["web"], + ], + }] + +def restoreWebE2EYarnCache(): + return [{ + "name": "restore-web-e2e-yarn-cache", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-e2e-$WEB_COMMITID %s/.yarn" % dirs["web"], + "ls -la %s/.yarn" % dirs["web"], + ], + }, { + # we need to install again becase the node_modules are not cached + "name": "install-yarn-e2e", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + "cd %s" % dirs["web"], + "retry -t 3 'yarn install --immutable'", + ], + }] + +def restoreWebAcceptanceYarnCache(): + return [{ + "name": "restore-web-acceptance-yarn-cache", + "image": MINIO_MC, + "environment": MINIO_MC_ENV, + "commands": [ + "source ./.drone.env", + "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", + "mc mirror s3/$CACHE_BUCKET/ocis/web-test-runner/yarn-acceptance-$WEB_COMMITID %s/tests/acceptance/.yarn" % dirs["web"], + "ls -la %s/tests/acceptance/.yarn" % dirs["web"], + ], + }, { + # we need to install again becase the node_modules are not cached + "name": "install-yarn-acceptance", + "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, + "commands": [ + "cd %s/tests/acceptance" % dirs["web"], + "retry -t 3 'yarn install --immutable'", + ], + }] diff --git a/tests/config/drone/check_web_cache.sh b/tests/config/drone/check_web_cache.sh new file mode 100644 index 00000000000..6ef83fa5533 --- /dev/null +++ b/tests/config/drone/check_web_cache.sh @@ -0,0 +1,18 @@ +#!/bin/bash +source .drone.env + +echo "Checking web version - $WEB_COMMITID in cache" + +URL="$CACHE_ENDPOINT/$CACHE_BUCKET/ocis/web-test-runner/$WEB_COMMITID/README.md" + +echo "Checking for the web cache at '$URL'." + +if curl --output /dev/null --silent --head --fail "$URL" +then + echo "Web with commit id $WEB_COMMITID already available in cache" + # https://discourse.drone.io/t/how-to-exit-a-pipeline-early-without-failing/3951 + # exit a Pipeline early without failing + exit 78 +else + echo "Web with $WEB_COMMITID not available in cache" +fi From fdaad7e38d3156f3c6c392716be0f970dd75866b Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 10 Aug 2022 08:02:26 +0000 Subject: [PATCH 29/30] Automated changelog update [skip ci] --- CHANGELOG.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f5521c7807..2e837186c89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1371,7 +1371,7 @@ The following sections list the changes for 2.0.0-beta.5. The following sections list the changes for 1.20.0. -[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0 +[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0 ## Summary @@ -1539,28 +1539,11 @@ The following sections list the changes for 1.20.0. Group member remove https://github.com/owncloud/ocis/pull/3467 -# Changelog for [1.19.1] (2022-03-29) - -The following sections list the changes for 1.19.1. - -[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1 - -## Summary - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - -## Details - -* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) - - URLs for Special items (space image, readme) were broken. - - https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.19.0] (2022-03-29) The following sections list the changes for 1.19.0. -[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0 +[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0 ## Summary @@ -1729,6 +1712,23 @@ The following sections list the changes for 1.19.0. https://github.com/owncloud/ocis/pull/3291 https://github.com/owncloud/ocis/pull/3375 https://github.com/owncloud/web/releases/tag/v5.3.0 +# Changelog for [1.19.1] (2022-03-29) + +The following sections list the changes for 1.19.1. + +[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1 + +## Summary + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + +## Details + +* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419) + + URLs for Special items (space image, readme) were broken. + + https://github.com/owncloud/ocis/pull/3419 # Changelog for [1.18.0] (2022-03-03) The following sections list the changes for 1.18.0. From 21d3de67bf96ce9db32784078c63f48f9deb9122 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 10 Aug 2022 13:57:09 +0545 Subject: [PATCH 30/30] Refactor .drone.star to use 'dirs' array more --- .drone.star | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.drone.star b/.drone.star index ec6434a523c..c0638c2fd7e 100644 --- a/.drone.star +++ b/.drone.star @@ -43,7 +43,7 @@ DEFAULT_NODEJS_VERSION = "14" dirs = { "base": "/drone/src", "web": "/drone/src/webTestRunner", - # relate path from the base directory, i.e. "/drone/src" + # relative path from the base directory dirs["base"] # this is because the PLUGINS_S3_CACHE does not support absolute paths # PLUGINS_S3_CACHE is used to cache the core and testing app "core": "oc10/testrunner", @@ -600,7 +600,7 @@ def localApiTests(ctx, storage, suite, accounts_hash_difficulty = 4): "STORAGE_DRIVER": storage, "BEHAT_SUITE": suite, "BEHAT_FILTER_TAGS": "~@skip&&~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS"), - "EXPECTED_FAILURES_FILE": "/drone/src/tests/acceptance/expected-failures-localAPI-on-%s-storage.md" % (storage.upper()), + "EXPECTED_FAILURES_FILE": "%s/tests/acceptance/expected-failures-localAPI-on-%s-storage.md" % (dirs["base"], storage.upper()), "UPLOAD_DELETE_WAIT_TIME": "1" if storage == "owncloud" else 0, }, "commands": [ @@ -658,7 +658,7 @@ def cs3ApiTests(ctx, storage, accounts_hash_difficulty = 4): def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", accounts_hash_difficulty = 4): early_fail = config["apiTests"]["earlyFail"] if "earlyFail" in config["apiTests"] else False filterTags = "~@skipOnGraph&&~@skipOnOcis&&~@notToImplementOnOCIS&&~@toImplementOnOCIS&&~comments-app-required&&~@federation-app-required&&~@notifications-app-required&&~systemtags-app-required&&~@local_storage&&~@skipOnOcis-%s-Storage&&~@caldav&&~@carddav" % ("OC" if storage == "owncloud" else "OCIS") - expectedFailuresFile = "/drone/src/tests/acceptance/expected-failures-API-on-%s-storage.md" % (storage.upper()) + expectedFailuresFile = "%s/tests/acceptance/expected-failures-API-on-%s-storage.md" % (dirs["base"], storage.upper()) return { "kind": "pipeline", @@ -679,8 +679,8 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "image": OC_CI_PHP % DEFAULT_PHP_VERSION, "environment": { "TEST_WITH_GRAPH_API": "true", - "PATH_TO_OCIS": "/drone/src", - "PATH_TO_CORE": "/drone/src/%s" % dirs["core"], + "PATH_TO_OCIS": "%s" % dirs["base"], + "PATH_TO_CORE": "%s/%s" % (dirs["base"], dirs["core"]), "TEST_SERVER_URL": "https://ocis-server:9200", "OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""), "SKELETON_DIR": "%s/%s/data/apiSkeleton" % (dirs["base"], dirs["testing_app"]), @@ -695,7 +695,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "UPLOAD_DELETE_WAIT_TIME": "1" if storage == "owncloud" else 0, }, "commands": [ - "make -C /drone/src/%s test-acceptance-api" % dirs["core"], + "make -C %s/%s test-acceptance-api" % (dirs["base"], dirs["core"]), ], }, ] + failEarly(ctx, early_fail), @@ -801,7 +801,7 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1, "RUN_ON_OCIS": "true", "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/owncloud/data", "TESTING_DATA_DIR": "%s/%s" % (dirs["base"], dirs["testing_app"]), - "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", + "WEB_UI_CONFIG": "%s/tests/config/drone/ocis-config.json" % dirs["base"], "TEST_TAGS": finalFilterTags, "LOCAL_UPLOAD_DIR": "/uploads", "NODE_TLS_REJECT_UNAUTHORIZED": 0, @@ -858,11 +858,11 @@ def e2eTests(ctx): "HEADLESS": "true", "OCIS": "true", "RETRY": "1", - "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", + "WEB_UI_CONFIG": "%s/tests/config/drone/ocis-config.json" % dirs["base"], "LOCAL_UPLOAD_DIR": "/uploads", }, "commands": [ - "cd webTestRunner", + "cd %s" % dirs["web"], "sleep 10 && yarn test:e2e:cucumber tests/e2e/cucumber/**/*[!.oc10].feature", ], }] @@ -932,7 +932,7 @@ def publishTracingResult(ctx, suite): "name": "publish-tracing-result", "image": OC_UBUNTU, "commands": [ - "cd webTestRunner/reports/e2e/playwright/tracing/", + "cd %s/reports/e2e/playwright/tracing/" % dirs["web"], 'echo "
:boom: To see the trace, please open the link in the console ...\\n\\n

\\n\\n" >> comments.file', 'for f in *.zip; do echo "#### npx playwright show-trace $CACHE_ENDPOINT/$CACHE_BUCKET/${DRONE_BUILD_NUMBER}/tracing/$f \n" >> comments.file; done', 'echo "\n

" >> comments.file', @@ -985,18 +985,18 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4): "BACKEND_HOST": "https://ocis-server:9200", "RUN_ON_OCIS": "true", "OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/owncloud/data", - "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", + "WEB_UI_CONFIG": "%s/tests/config/drone/ocis-config.json" % dirs["base"], "TEST_TAGS": "not @skipOnOCIS and not @skip", "LOCAL_UPLOAD_DIR": "/uploads", "NODE_TLS_REJECT_UNAUTHORIZED": 0, "WEB_PATH": dirs["web"], - "FEATURE_PATH": "/drone/src/services/settings/ui/tests/acceptance/features", + "FEATURE_PATH": "%s/services/settings/ui/tests/acceptance/features" % dirs["base"], "MIDDLEWARE_HOST": "http://middleware:3000", }, "commands": [ # TODO: settings/package.json has all the acceptance test dependencies # they shouldn't be needed since we could also use them from web:/tests/acceptance/package.json - "cd /drone/src/services/settings", + "cd %s/services/settings" % dirs["base"], "retry -t 3 'yarn install --immutable'", "make test-acceptance-webui", ], @@ -1792,7 +1792,7 @@ def ocisServer(storage, accounts_hash_difficulty = 4, volumes = [], depends_on = "STORAGE_SYSTEM_DRIVER_OCIS_ROOT": "/srv/app/tmp/ocis/storage/metadata", "SHARING_USER_JSON_FILE": "/srv/app/tmp/ocis/shares.json", "PROXY_ENABLE_BASIC_AUTH": True, - "WEB_UI_CONFIG": "/drone/src/tests/config/drone/ocis-config.json", + "WEB_UI_CONFIG": "%s/tests/config/drone/ocis-config.json" % dirs["base"], "OCIS_LOG_LEVEL": "error", "SETTINGS_DATA_PATH": "/srv/app/tmp/ocis/settings", "IDM_CREATE_DEMO_USERS": True, @@ -2325,7 +2325,7 @@ def pipelineSanityChecks(ctx, pipelines): OCIS_URL = "https://ocis-server:9200" OCIS_DOMAIN = "ocis-server:9200" OC10_URL = "http://oc10:8080" -PARALLEL_DEPLOY_CONFIG_PATH = "/drone/src/tests/parallelDeployAcceptance/drone" +PARALLEL_DEPLOY_CONFIG_PATH = "%s/tests/parallelDeployAcceptance/drone" % dirs["base"] # step volumes stepVolumeOC10Templates = \ @@ -2476,7 +2476,7 @@ def parallelAcceptance(env): "SKELETON_DIR": "/%s/%s/data/apiSkeleton" % (dirs["base"], dirs["testing_app"]), "PATH_TO_CORE": "/%s/%s" % (dirs["base"], dirs["core"]), "OCIS_REVA_DATA_ROOT": "/mnt/data/", - "EXPECTED_FAILURES_FILE": "/drone/src/tests/parallelDeployAcceptance/expected-failures-API.md", + "EXPECTED_FAILURES_FILE": "%s/tests/parallelDeployAcceptance/expected-failures-API.md" % dirs["base"], "OCIS_SKELETON_STRATEGY": "copy", "SEND_SCENARIO_LINE_REFERENCES": "true", "UPLOAD_DELETE_WAIT_TIME": "1",