Skip to content
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

App server does not update default plugins upon ROOT_DIR change #1245

Closed
1000TurquoisePogs opened this issue Apr 7, 2020 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@1000TurquoisePogs
Copy link
Member

If an instance's ROOT_DIR value is changed in instance.env, most commonly done in development & test, the Zowe instance should effectively be upgraded or downgraded to the behavior of whatever Zowe is in ROOT_DIR. However, upon initialization, the app-server component sets up references to plugins. While it does checks to see that the references still exist on startup, it does not do checks to see if they are within ROOT_DIR.
This means that if you change ROOT_DIR, the plugins will be from a different version of Zowe, currently.

To Reproduce

  1. Install 2 Zowe versions, such as 1.8 and 1.9
  2. Set up an instance in 1.8
  3. Change that instance to point to 1.9 ROOT_DIR
  4. Notice that the plugins still point to 1.8. You can see this in the log files in the logs folder.

Expected behavior
When the ROOT_DIR is changed, the plugins that reside in a ROOT_DIR have the references updated in the instance, so that the instance points to the right version.

Potential problem: plugins can be side-loaded, that is, installed from outside ROOT_DIR for any reason. For default plugins, this could be done as a form of patching. So, you may want to "pin" the plugin to that patched version, rather than always having it come from ROOT_DIR

Potential solution: pick a plugin, or set of plugins which are either unlikely to be sideloaded, or unlikely to ALL be sideloaded, especially from the same directory. Check the instance references to those plugins and if they are not in ROOT_DIR, then it is very likely that they come from an old ROOT_DIR and should have the references updated.

@1000TurquoisePogs 1000TurquoisePogs added the bug Something isn't working label Apr 7, 2020
@1000TurquoisePogs
Copy link
Member Author

The proposed solution is to add an attribute to the plugin JSON files to make it possible that plugin paths can be relative to the ROOT_DIR, no matter what it is.

For example, currently:

{
"identifier": "a",
"location":"/zowe1.11/components/app-server/share/a"
}

Could become:

{
"identifier": "a",
"location":"components/app-server/share/a",
"relativeTo":"ROOT_DIR"
}

In this way, because the location would be relative to the env var ROOT_DIR, the file would not need modification upon ROOT_DIR change.

@1000TurquoisePogs
Copy link
Member Author

Complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant