Skip to content

Test that the most recent app version is loaded for multi app dir config - #28271

Merged
PVince81 merged 1 commit into
masterfrom
test-for-e2018
Jul 4, 2017
Merged

PVince81 merged 1 commit into
masterfrom
test-for-e2018

Conversation

@VicDeo

@VicDeo VicDeo commented Jun 30, 2017 •

Copy link
Copy Markdown
Contributor

Attention:

The fix was merged into 10.0.2 #28002
This PR contains integration test to detect future regressions

Description

App version was loaded incorrectly

Motivation and Context

When there are several app directories the app is always loaded from the very first due to the bug in logic

How Has This Been Tested?

config.php

  "apps_paths" =>  [
    0 => 
   [
      'path' => '/1001/apps/',
      'url' => '/apps',
      'writable' => false,
   ],
    1 => 
   [
      'path' => '/1001/apps2/',
      'url' => '/apps2',
      'writable' => true,
    ],
  ],
  1. Put the same app into /1001/apps/ and /1001/apps2/
  2. Increase version of the app in /1001/apps2/

Expected: the change is detected and the app is updated
Actual: it's not

  1. Apply patch - everything works as expected
  2. Keep the patch and increase version of the app in /1001/apps/ just to be sure it doesn't break anything

Expected & Actual: the change is detected and the app is updated

Types of changes

  • Integration test
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@VicDeo VicDeo added this to the development milestone Jun 30, 2017
@VicDeo

VicDeo commented Jun 30, 2017

Copy link
Copy Markdown
Contributor Author

What we are testing here:

having multiple app directories is an OC feature.

Let's assume that we have two app directories: apps and apps2
apps isn't allowed to change by the webserver user
and apps2 is allowed to change by the webserver user
to notify oC about that we add the following lines into the config.php:

"apps_paths" => [
0 =>
[
'path' => '/path/to/owncloud/apps/',
'url' => '/apps',
'writable' => false,
],
1 =>
[
'path' => '/path/to/owncloud/apps2/',
'url' => '/apps2',
'writable' => true,
],
],
where /path/to/owncloud is a full path to oC instance
as documented in config.sample.php : https://github.com/owncloud/core/blob/master/config/config.sample.php#L724

Now we copy the same app code both into /path/to/owncloud/apps/ and /path/to/owncloud/apps2/
and enable it
e.g. via CLI command: php occ app:enable appid

Now we increase version for this app by changing /path/to/owncloud/apps2/appid/appinfo/info.xml

We expect that oC will detect that our app needs an upgrade. But it is not.

if there are several instances of the same app oC always loads this app from the very first app directory instead of searching the most recent version across all copies of the app.
That''s the bug.

@VicDeo

VicDeo commented Jul 4, 2017

Copy link
Copy Markdown
Contributor Author

Moved from #27989 that always fails on Jenkins for unknown reasons

@PVince81
PVince81 merged commit 3318e47 into master Jul 4, 2017
@PVince81
PVince81 deleted the test-for-e2018 branch July 4, 2017 07:55
@PVince81

PVince81 commented Jul 4, 2017

Copy link
Copy Markdown
Contributor

@VicDeo please backport

@VicDeo

VicDeo commented Jul 4, 2017 •

Copy link
Copy Markdown
Contributor Author

Stable10: #28221
Stable9.1: Part of #28222 - Integration tests are not backportable

@PVince81

Copy link
Copy Markdown
Contributor

More trouble ahead, seems there are other cases: #29628

@lock

lock Bot commented Aug 1, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants