Commit c94b1a7
authored
feat: plugin bundling, catalog, installation and versioning (#31)
* chore: provde better examples for PluginPackageInfo constructor
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: add PluginVersionInfo and PluginVersionRegistry models w/unit tests
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: unit tests and fixtures for plugin isolation via venv.
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: refactored the invoke_hook method in cpex/framework/isolated/client.py to run async
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: updated unit test test_worker to get coverage to 97%.
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: The optimization eliminates the overhead of:
Forking a new Python process (~1.2ms per fork_exec)
Initializing the Python interpreter
Loading modules and dependencies
Setting up the subprocess communication pipes
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: fail early plugin_path do not exist, computer .venv path automatically, update cli to support creating an isolated plugin.
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: use the system config file (PLUGINS_CONFIG_FILE) for syspath update (Consistent with how the PluginManager works).
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: Validate plugin_dirs entries against an allowlist
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: remove hardcoded reference to plugins/config in the cpex/framework/isolated/client.py and update tests. remove methods_to_exclude from validator.
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: Add a maximum line length check before parsing. Add model tests for PluginPackageInfo and PluginVersionRegistry
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: model updates for PluginManifest, InstalledPluginInfo, and InstalledPluginRegistry
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: example values for git monorepo installation
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: add ConfigSaver class to ConfigLoader
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: plugin installation catalog
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: add support to enable installation of a plugin using the cli from a git monorepo, or pypi.
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: doc string fix
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: remove duplicate code
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: test coverage improvements, remove duplicate code
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: replace cargo with search for pyproject.
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fixes
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: use pygithub apis rather than github rest apis, as they provide automatic backoff when github response with too many requests.
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: add support for uninstall of plugin
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint-fix
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: use the manifest from the local catalog to pull the kind value of the package to be removed and use that to remove all matching kind entries from plugins/config.yaml unless kind is external or isolated_venv in which case check if the plugin name is a substring of the plugin name.
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: when installing a plugin via mono-repo or pipi, the cache_root will not exist under the plugins dir, create the directory if it does not exist on plugin startup for venv plugins.
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: enable package install from both pypi and test-pypi, fix: properly resolve location of requirements.txt while performing pypi installs.
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: stub for local installation
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* doc: add README for tools
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: use cached repo object
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: use rich emoji
Signed-off-by: habeck <habeck@us.ibm.com>
* ptf: workaround for version mis-match of cpex dependency in plugin
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: download install targets to a temp folder to avoid installing to incorrect venv.
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: pass the plugin install path to the update method, as isolated_venv plugins are not installed in the current venv.
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: the catalog now returns the install path for isolated_venv plugins
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: unit test updates
Signed-off-by: habeck <habeck@us.ibm.com>
* misc: type fix
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: the plugin self installs into the isolated_venv via requirements.txt
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: increase coverage above 90%
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: update min_max_framework_version
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: isolated venv cookiecutter update for install flow
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: catalog now properly persists all plugin-manifest*.yaml files
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: upgrade pip before installing requirements
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: allow the developer provided version registry values to persist, overriding only if they are not present. Improved install path resolution for isolated_venv plugins
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: only update the catalog when not installing from test-pypi or pypi. Correctly determine the install path for the plugin registry for monorepo installs and isolated_venv plugins.
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: refactor to reduce duplicate code, fix uninstall for isolated_venv, add install support for type local,
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: properly format info
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: update README.md
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: Add a, "before you begin" section detailing the required .env variable.
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: P0 fix — tarfile/zip path traversal
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: add remove_venv method to IsolatedVenvPlugin for uninstall cleanup.
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: priority 1 items
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: p2 item 17 search() case-insensitive match broken
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: add tests for _ver method.
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: version registry update cleanup
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: add missing doc string, and tests for _ver method.
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: review p2 moderate 21 - list function now uses console.print
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: fix failing unit test, address non-atomic registry write.
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: claude can't tell the difference between if "rc is False" and "if rc".
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: cpex/framework/models.py — register_plugin (line 2392): replaced the unconditional append with a filter-then-append. Any existing entry with the same
name is removed before the new one is added, so a reinstall upgrades the entry rather than creating a duplicate. One save() call, same atomicity as
before.
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: P2 Issue 20 Implementation Complete: Exit Code Handling
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: list function shadows built-in
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: logic tweak
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: p2 issue 23
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: P2 issue 19 error handling for corrupted JSON registry
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: P2 issue 24 - Registry file path triplicated
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint-fix
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: P2 issue 25
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: update worker to call cpex.framework.utils.import_module rather than importlib.import_module directly.
Signed-off-by: habeck <habeck@us.ibm.com>
* enh: add package integrity verification
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: missed commit
Signed-off-by: habeck <habeck@us.ibm.com>
* fix: if the plugins/config.yaml plugins array is empty, initialize it with the appropriate default from catalog settings.
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: lint fix
Signed-off-by: habeck <habeck@us.ibm.com>
* chore: version to '0.1.0 minimum'
Signed-off-by: habeck <habeck@us.ibm.com>
---------
Signed-off-by: habeck <habeck@us.ibm.com>1 parent af53214 commit c94b1a7
24 files changed
Lines changed: 10198 additions & 123 deletions
File tree
- cpex
- framework
- isolated
- loader
- templates/isolated/{{cookiecutter.plugin_slug}}
- tools
- docs/content/docs
- tests/unit/cpex
- framework/isolated
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
12 | 28 | | |
13 | 29 | | |
14 | 30 | | |
| |||
148 | 164 | | |
149 | 165 | | |
150 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
47 | | - | |
| 47 | + | |
| 48 | + | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 221 | + | |
| 222 | + | |
228 | 223 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
235 | 232 | | |
236 | 233 | | |
237 | 234 | | |
| |||
339 | 336 | | |
340 | 337 | | |
341 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
| |||
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
209 | 212 | | |
210 | 213 | | |
211 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
0 commit comments