Repository navigation
Conversation
The remote builder wrote the Press app name to apps.txt. `bench get-app` installs an app under the package name from pyproject.toml, setup.cfg or setup.py, and this name can be different. For example, the Press app `sheets_sync` installs as `sheets` at some commits. Frappe imports each app in apps.txt when it loads all the apps of a bench. On such a bench, `bench console`, `bench backup` and other commands failed with `ModuleNotFoundError`. Read the package name in the same order as bench, and write it to apps.txt. Press did this before the builds moved to the agent.
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
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.
Summary
The remote builder writes the Press app name to
sites/apps.txt.bench get-appinstalls an app under its package name, and this name can be different. Frappe imports each app inapps.txtwhen it loads all the apps of a bench. On such a bench,bench console,bench backup,bench set-maintenance-modeand other commands fail withModuleNotFoundError. Site updates, backups and site migrations from the bench fail.Example: the Press app
sheets_sync(gavindsouza/sheets) has the package namesheetsat older commits.bench get-appinstalls it inapps/sheets, butapps.txtlistssheets_sync:Before the builds moved to the agent, Press wrote
apps.txtwith the package name (_get_app_name, removed in frappe/press@b1e00f345).Changes
ContextManager._get_app_namereads the package name frompyproject.toml, thensetup.cfg, thensetup.py. This is the same order as bench. It parsessetup.pywithast, the same way as bench. If no file gives a name, it uses the Press app name.prepare_build_contextwrites these names toapps.txt.Not in this PR
Other steps still use the Press app name for paths inside the image: patch builds (
_pull_app,_reinstall_app_deps),_bench_build_app,upload_app_assets,get_cached_app.pyand thepullable_releaseblock of the Press Dockerfile. They can fail for an app whose package name is different.Testing
TestAppsTxtinagent/tests/test_builder.pycovers pyproject.toml, setup.cfg, setup.py and the fallback. It fails without the change.python -m unittest agent.tests.test_builder: 13 tests pass.pre-commitpasses on the changed files.