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

Refactor from env vars to defaults.yaml #257

Merged
merged 19 commits into from
Jun 26, 2023

Conversation

1000TurquoisePogs
Copy link
Member

@1000TurquoisePogs 1000TurquoisePogs commented May 23, 2023

This PR moves the server from depending heavily on a confusing list of environment variable decision making for configuration, to instead having a configuration based almost entirely on YAML files, and includes its own defaults.yaml file to refer to and build upon.

This will support both dev and prod. In prod, the defaults file will be used in combination with the user's yaml file, allowing that to be brief but yet make visible how you can customize the server further.

In dev, the defaults.yaml will be copied to ~/.zowe/zowe.yaml if it doesnt exist, which will give you a starting point for customization. From then on, the server would by default load both that file and the defaults.yaml file.

The defaults.yaml file is found within defaults/serverConfig/defaults.yaml
It uses configmgr-like templating in the format of ${{ }} with some tweaks:

  • you can use os. and process. calls because it's getting executed in nodejs, not configmgr.
  • the server doesnt do schema validation, because zwe does, but that means dev has no schema validation.
  • the functions within templates seem not to be able to be arrow functions, thus you will see the pattern of function a() {thing}; a() a bit, to accomplish the same thing.

This PR addresses Issue: zowe/zlux#914

This PR depends upon the following PRs: zowe/zlux-server-framework#473

Type of change

Please delete options that are not relevant.

  • Refactor the code

PR Checklist

Please delete options that are not relevant.

  • If the changes in this PR are meant for the next release / mainline, this PR targets the "staging" branch.
  • My code follows the style guidelines of this project (see: Contributing guideline)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes
  • Relevant update to CHANGELOG.md
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works, or describe a test method below

Testing

This PR should [ass existing automation for dev and prod. use it as you would normal zowe. additionally, you can find tests of yaml files within https://github.com/zowe/zlux-server-framework/pull/473

…ge defaults.yaml. simplify zlux args to align with zlux server changes

Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Default to saf when possible

Signed-off-by: 1000TurquoisePogs <[email protected]>
bin/start.sh Outdated Show resolved Hide resolved
new argParser.CLIArgument('allowInvalidTLSProxy', null,
argParser.constants.ARG_TYPE_VALUE),
new argParser.CLIArgument('mlUser', 'mu', argParser.constants.ARG_TYPE_VALUE),
new argParser.CLIArgument('mlPass', 'mp', argParser.constants.ARG_TYPE_VALUE)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alert automation that we'll be breaking them here.

Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
@1000TurquoisePogs 1000TurquoisePogs marked this pull request as ready for review June 5, 2023 19:59
…eature/v2/defaults-yaml

Signed-off-by: 1000TurquoisePogs <[email protected]>
Add zss agent section to app-server section

Signed-off-by: 1000TurquoisePogs <[email protected]>
Signed-off-by: 1000TurquoisePogs <[email protected]>
@1000TurquoisePogs 1000TurquoisePogs merged commit 086ccc8 into v2.x/staging Jun 26, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants