Repository navigation
test(appstore): cover the release Nextcloud setup and validate the unsigned package - #9063
Open
maia-andre wants to merge 4 commits into
Open
maia-andre wants to merge 4 commits into
maia-andre wants to merge 4 commits into
Conversation
The Nextcloud initialization that signs a release lived inside the
appstore recipe, so nothing could exercise it without running the whole
package and signing flow. That is how the ${GITHUB_ACTIONS:-} expansion
skipped the setup silently.
Move the block unchanged into _appstore-nextcloud-setup, called by
appstore at the same point, and read the Nextcloud location from
nextcloud_directory (default unchanged: ../nextcloud). The target is
internal and stays out of make help.
The Bats tests run the real target with occ, curl and openssl stubbed:
setup on GitHub Actions with the key, skip without GITHUB_ACTIONS or
without the key, stop when occ fails, and appstore reaching the setup
before signing.
Refs: LibreSign#8845
Signed-off-by: André Maia <andrefnkmm@gmail.com>
verify-appstore-package only looked at the staging directory. It now also reads the tarball and fails when it cannot be read, when an entry sits outside the app directory, when a required path is missing or when a development path is shipped. The lists mirror package.required_paths and package.forbidden_paths in .nextcloud-release.yml. tests/php/fixtures/pdfs/small_valid.pdf is left out of the required list: appstore packages it as tests/php/fixtures/small_valid.pdf, as in the published v15.0.8 archive, so requiring the configured path would fail every release. Refs: LibreSign#8845 Signed-off-by: André Maia <andrefnkmm@gmail.com>
Release metadata runs the Bats tests in tests/ci, and also runs when only those tests or the workflow change. The Playwright job already installs the composer and npm dependencies and the 3rdparty submodule, so it now builds the real unsigned package with make appstore verify-appstore-package right after the frontend build. The image has no make, so it is installed with the other system packages, and the job also runs when the Makefile or .nextcloud-release.yml change. Refs: LibreSign#8845 Signed-off-by: André Maia <andrefnkmm@gmail.com>
Refs: LibreSign#8845 Signed-off-by: André Maia <andrefnkmm@gmail.com>
Open
7 of 8 tasks
YvesCesar
requested changes
Oct 14, 2026
YvesCesar
left a comment
Member
There was a problem hiding this comment.
Thanks again @maia-andre !
I commented on a review. Could you take a look at it?
| # Makefile into it, so packaging runs without touching the repository. Prints | ||
| # the app directory. | ||
| make_app_fixture() { | ||
| local app="$BATS_TEST_TMPDIR/work/$APP_NAME" |
Member
There was a problem hiding this comment.
The tests fail when the repository or the temp directory is reached through a symlink. make stores the physical path in $(CURDIR). REPO_ROOT (line 9) uses pwd, which returns the logical path, and make_app_fixture (line 71) builds its path from BATS_TEST_TMPDIR without resolving it. So the readlink asserts compare two different paths:
- repository reached through a symlink: test 1 fails (
readlink ... = "$REPO_ROOT") TMPDIRbehind a symlink, which is the default on macOS (/var->/private/var): test 5 fails (readlink ... = "$app")
Suggestion: resolve the physical path in both places.
REPO_ROOT="$(cd "$BATS_TEST_DIRNAME/../.." && pwd -P)"
local app
app="$(cd "$BATS_TEST_TMPDIR" && pwd -P)/work/$APP_NAME"With this change, all 8 tests pass in both cases.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #8845
📝 Summary
Adds a small, tested boundary around the release packaging, following the direction in #8845 (comment).
appstoreinto the internal target_appstore-nextcloud-setup, whichappstorecalls at the same point. The Nextcloud location is nownextcloud_directory(default unchanged,../nextcloud). The target is not listed inmake help. The signing block, the staging and the tarball stay inappstore.verify-appstore-packagealso checks the archive itself: it must be readable, contain onlylibresign/, contain every required path and none of the forbidden ones. The lists mirrorpackage.required_paths/package.forbidden_pathsin.nextcloud-release.yml. This also applies to nightly and official releases, which already run this target.tests/ci/run the real targets withocc,curlandopensslstubbed, in a temporary directory. No network, no Nextcloud, no real key, nothing written in the repository.release-metadata.ymlruns the Bats tests and now also triggers ontests/ci/**and on its own file. The Playwright job, which already installs composer and npm dependencies and the submodule, builds the real unsigned package withmake appstore verify-appstore-packageright after the frontend build.make appstore,make verify-appstore-package,build/artifacts/libresign.tar.gz, the signing order, the nightly template, its patch and the publishing action are unchanged.Composition: Makefile +43/−20 (most of it the moved block), tests +212 (3 files), workflows +23/−1, docs +16. Suggested reading order:
Makefile,tests/ci/helpers.bash, the two.batsfiles, workflows.🧪 How to test
bats tests/ci GITHUB_ACTIONS= make appstore verify-appstore-package # real unsigned packageValidation evidence
bats tests/ci, 8/8 locally (Bats 1.11.1, GNU Make 4.4.1), also withGITHUB_ACTIONS=trueandMAKEFLAGSexported and from another working directory.GITHUB_ACTIONS=true→maintenance:install,--version,app:enable --force libresign, data dir and app link createdGITHUB_ACTIONSunset → skipped, no command runGITHUB_ACTIONS=true→ skippedocc maintenance:installfails → non-zero exit,app:enablenever runsmake appstore→ setup runs beforelibresign:installandintegrity:sign-app6–8. unsigned package accepted; a package with
src/or withouttemplates/rejected[ "${GITHUB_ACTIONS:-}" = "true" ]restored temporarily, tests 1, 4 and 5 fail; with the current expression they pass. Removing the_appstore-nextcloud-setupcall fromappstoremakes test 5 fail. Neither change is committed.verify-appstore-package; its top-level layout is identical to the publishedlibresign-v15.0.8.tar.gz.shellcheck -s bashontests/ci,reuse lint.⚙️ API / Back-end changes
tests/README.md)Notes
appstorepackagestests/php/fixtures/small_valid.pdf(also in the published v15.0.8 archive), butDevelopControllerreadstests/php/fixtures/pdfs/small_valid.pdfand.nextcloud-release.ymllists that path as required. I left that file out of the required list inverify-appstore-packageso releases keep passing. Happy to open a separate issue.Makefileor.nextcloud-release.ymlnow runs the e2e job. It is the only existing job with all packaging inputs installed; the alternative would be a new dependency setup, which the issue asked to avoid.✅ Checklist
🤖 AI (if applicable)