-
-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(deb): keep plugin_packages in-tree so admin-installed plugins can resolve ep_etherpad-lite #7750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
fix(deb): keep plugin_packages in-tree so admin-installed plugins can resolve ep_etherpad-lite #7750
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
50d467d
fix(deb): keep plugin_packages in-tree to fix admin-installed plugins
JohnMcLear 7475491
ci(deb): update assertions for in-tree plugin_packages + cover migration
JohnMcLear 79856e8
ci(deb): add ep_layout_trip_wire fixture to gate plugin_packages layout
JohnMcLear c84f75d
fix(deb): clean up runtime plugin artifacts on purge
JohnMcLear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # ep_layout_trip_wire | ||
|
|
||
| Test fixture for the Debian package CI. Not published, not loaded by | ||
| any production Etherpad install. | ||
|
|
||
| Exists to catch regressions in the packaging layout. When the `.deb` | ||
| postinstall symlinked `/opt/etherpad/src/plugin_packages` outside the | ||
| etherpad tree, Node.js resolved the symlink to its realpath before | ||
| walking `node_modules` and every `require('ep_etherpad-lite/...')` in | ||
| admin-installed plugins threw `MODULE_NOT_FOUND` (see | ||
| [ether/ep_comments_page#416](https://github.com/ether/ep_comments_page/issues/416)). | ||
|
|
||
| `packaging/test-local.sh` and `.github/workflows/deb-package.yml` stage | ||
| this plugin into `/opt/etherpad/src/plugin_packages/.versions/...`, | ||
| start etherpad, and grep `journalctl` for the marker emitted from | ||
| `expressCreateServer`. If any of the `require('ep_etherpad-lite/...')` | ||
| calls in `index.js` fail, the marker never appears and the test fails. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "parts": [ | ||
| { | ||
| "name": "trip_wire", | ||
| "hooks": { | ||
| "expressCreateServer": "ep_layout_trip_wire/index" | ||
| } | ||
| } | ||
| ] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| 'use strict'; | ||
|
|
||
| // Each of these require()s would throw MODULE_NOT_FOUND if | ||
| // /opt/etherpad/src/plugin_packages were symlinked outside the etherpad | ||
| // tree -- Node resolves the symlink to its realpath before walking | ||
| // node_modules and never reaches the bundled ep_etherpad-lite under | ||
| // /opt/etherpad/node_modules. See ether/ep_comments_page#416. | ||
| const eejs = require('ep_etherpad-lite/node/eejs/'); | ||
| const settings = require('ep_etherpad-lite/node/utils/Settings'); | ||
| const log4js = require('ep_etherpad-lite/node_modules/log4js'); | ||
| const {randomString} = require('ep_etherpad-lite/static/js/pad_utils'); | ||
|
|
||
| const logger = log4js.getLogger('ep_layout_trip_wire'); | ||
|
|
||
| // CI greps the journal for this exact line. | ||
| const MARKER = 'ep_layout_trip_wire: plugin_packages layout OK'; | ||
|
|
||
| exports.expressCreateServer = (hookName, ctx, cb) => { | ||
| // Touch each binding so a future "require but never use" lint can't | ||
| // dead-code-eliminate them and silently weaken the test. | ||
| void eejs.require; | ||
| void settings.title; | ||
| void randomString; | ||
| logger.info(MARKER); | ||
| return cb(); | ||
| }; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "name": "ep_layout_trip_wire", | ||
| "version": "1.0.0", | ||
| "description": "Test fixture - exercises require('ep_etherpad-lite/...') from a deb-installed location. Do not publish.", | ||
| "main": "index.js", | ||
| "license": "Apache-2.0", | ||
| "private": true | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.