ci: automate upgrade testing#1019
Conversation
b714a55 to
48467b1
Compare
48467b1 to
2771035
Compare
PHP Code CoverageCoverage after merging upgrade-testing-local-setup into release/2.11 will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
e7f22dd to
c696b82
Compare
| PREVIOUS_APP_VERSION: 2.9.2 | ||
| UPGRADE_APP_VERSION: 2.10.0 |
There was a problem hiding this comment.
we should install the current compatible app version without specifying the version.
The app version to upgrade should be greater than the current version.
There was a problem hiding this comment.
I have recently update this PR where the current version is no longer required to be specified. Only the update version needs to be specified.
Should I also make the updated version not needed?
If I make this change, should it be good to make a greater a patch, minor, or major version? Which would be the good?
| - name: Build nextcloud project | ||
| run: | | ||
| export DEBIAN_FRONTEND=noninteractive |
There was a problem hiding this comment.
can we start nextcloud in the service section?
There was a problem hiding this comment.
Possibly, but why do you think so?
| - name: Setup System dependencies for appstore | ||
| run: | | ||
| sudo apt install -y \ | ||
| python3-venv \ | ||
| python3-wheel \ | ||
| libxslt-dev \ | ||
| libxml2-dev \ | ||
| libz-dev \ | ||
| libpq-dev \ | ||
| build-essential \ | ||
| python3-dev \ | ||
| python3-setuptools \ | ||
| gettext \ | ||
| libssl-dev \ | ||
| libffi-dev \ | ||
| nodejs \ | ||
| yarn | ||
|
|
||
| - name: Checkout appstore | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | ||
| with: | ||
| repository: nextcloud/appstore | ||
| path: appstore | ||
|
|
||
| - name: Install Appstore | ||
| run: | | ||
| cd appstore | ||
| python3 -m venv venv | ||
| source venv/bin/activate | ||
| pip install poetry==1.8.2 | ||
| make dev-setup | ||
| python manage.py runserver & |
There was a problem hiding this comment.
hmm, maybe we should create custom minimal REST server as appstore
There was a problem hiding this comment.
but can be next improvement
| with: | ||
| path: integration_openproject | ||
| fetch-tags: true | ||
| ref: v${{ env.UPGRADE_APP_VERSION }} |
There was a problem hiding this comment.
not sure about it. simply checkout the current source
There was a problem hiding this comment.
I have updated my PR as per your recommendation. Could you please take another look?
| coverage: xdebug | ||
| tools: php-cs-fixer, phpunit |
There was a problem hiding this comment.
do we need xdebug and the other tools?
There was a problem hiding this comment.
No, xdebug not needed.
I’ have removed it and also the tools since they’re no needed.
|
|
||
| env: | ||
| DJANGO_SETTINGS_MODULE: nextcloudappstore.settings.development | ||
| PREVIOUS_APP_VERSION: 2.9.2 |
There was a problem hiding this comment.
that version should be found automatically. Just take the last released stable version.
Otherwise, there is one more place to remember to change version numbers.
There was a problem hiding this comment.
I have recently updated this PR where the current version is no longer required to be specified. The current version automatically gets found. Only the updated version needs to be specified.
individual-it
left a comment
There was a problem hiding this comment.
in the log output of the test run I see
Error response from daemon: No such container: nextcloud
what is that about? Kind of confusing to see this error.
| wget https://raw.githubusercontent.com/nextcloud/integration_openproject/${{github.head_ref}}/.github/scripts/self-hosted-app-store.sh | ||
| bash ./self-hosted-app-store.sh | ||
|
|
||
| - name: Enable other apps from official app store |
There was a problem hiding this comment.
this is not entirely true, because at least activity is cloned further up by git
There was a problem hiding this comment.
The Activity app is not available in the App Store. It is a core app of Nextcloud. It is not included when the Nextcloud source is from Git.
There was a problem hiding this comment.
then maybe call the step enable other required apps
There was a problem hiding this comment.
Done ✅
made separate steps for activity Setup and enable dependent apps
| env: | ||
| APP_VERSION: ${{ env.UPGRADE_APP_VERSION }} | ||
| run: | | ||
| bash ./self-hosted-app-store.sh |
There was a problem hiding this comment.
the name of that bash file is confusing. It sounds as if it starts the app-store, but that is not true.
There was a problem hiding this comment.
Renamed it to register-and-publish-app-to-self-hosted-appstore.sh. Does that sound good?
| cd ~/html/nextcloud | ||
| # latest data didn't get fetched properly, so we need to clear the appstore cache | ||
| echo "" > ~/html/nextcloud/data/appdata_*/appstore/apps.json | ||
| php occ app:update --allow-unstable integration_openproject |
There was a problem hiding this comment.
we should check whether the upgrade to the new version really happened
There was a problem hiding this comment.
I have updated the PR to verify whether the app version has been updated or not with the help of the OCC command (i.e. occ app:list).
| --admin-user admin \ | ||
| --admin-pass admin | ||
| php occ maintenance:mode --off | ||
| sudo php -S localhost:80 -t ~/html/nextcloud & |
There was a problem hiding this comment.
it would be better to run NC with a real web-server like apache, but for now this should be fine
| - name: Check for Appstore | ||
| run: | | ||
| cd appstore | ||
| status=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:8000) |
There was a problem hiding this comment.
that appstore URL could go into a variable, because it is used in a lot of places
There was a problem hiding this comment.
I have made changes so that the App Store is no longer needed.
| echo "FAILED (status: $status)" | ||
| fi | ||
|
|
||
| - name: Register and publish integration_openproject apps |
There was a problem hiding this comment.
the previous app version can be installed from the official app store. Just take the latest published stable version
There was a problem hiding this comment.
Done as per your requirement.
There is user cleanup code where it tries to clean up users in Docker container in CI. But in this PR we are not running Nextcloud inside Docker, so the cleanup step is still executing and Docker is reporting that the container nextcloud is not found. |
|
Can we skip the docker cleanup step somehow? It's really hard to keep on remembering that error message to ignore |
ee34a21 to
17e1375
Compare
I recently updated the tests so that if the Nextcloud Docker container is not found, user clean up part will be skipped. |
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
e073e98 to
01e113f
Compare
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
01e113f to
30a20e8
Compare
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Description
This PR adds an upgrade testing workflow.
It validates the full upgrade path by:
Tests run across multiple Nextcloud and PHP version combinations.
Available env:
NEXTCLOUD_VERSIONS: Nextcloud versions to test.
PHP_VERSIONS: PHP versions to test.
TAG: The next version of app that should be updated during the upgrade testing
For now, this workflow runs on every pull request.
The open question is:
Related Issue or Workpackage
Screenshots (if appropriate):
Types of changes
Checklist:
CHANGELOG.mdfile