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

Parse Server option cannot be set via environment for interfaces #7151

Open
4 of 6 tasks
mtrezza opened this issue Jan 30, 2021 · 1 comment
Open
4 of 6 tasks

Parse Server option cannot be set via environment for interfaces #7151

mtrezza opened this issue Jan 30, 2021 · 1 comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@mtrezza
Copy link
Member

mtrezza commented Jan 30, 2021

New Issue Checklist

Issue Description

A Parse Server option cannot be set via environment variable if it is part of an interface. The reason seems to be that buildConfigDefinitions.js generates Definitions.js and adds the definitions for each interface into a separate module export. These definitions are then not part of module.exports.ParseServerOptions which seems to be the only export the Parse Server CLI considers.

Side note, that logic seems to be the reason why older Parse Server are all on the same root level and not grouped in nested objects, which is to consider for #7069.

Steps to reproduce

For example, idempotencyOptions has these sub keys:

idempotencyOptions: {
  paths: ...,
  ttl: ...,
}

The Definitions.js file only contains the root key PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_OPTIONS in module.exports.ParseServerOptions. The CLI runner only imports module.exports.ParseServerOptions therefore, setting environment variable PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_PATHS has no effect when initializing Parse Server.

Actual Outcome

All interfaces should be configurable via environment variables.

Expected Outcome

Only root key is configurable via environment variable.

Workaround

E.g. for idempotencyOptions the root key value can be set to an encoded object:

"PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_OPTIONS": "{\"paths\":[\"functions/.*\"]}",

Failing Test Case / Pull Request

  • 🤩 I submitted a PR with a fix and a test case.
  • 🧐 I submitted a PR with a failing test case.

Environment

Server

  • Parse Server version: 4.5.0
  • Operating system: irrelevant
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): irrelevant

Database

  • System (MongoDB or Postgres): irrelevant
  • Database version: irrelevant
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): irrelevant

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): irrelevant
  • SDK version: irrelevant

Logs

@mtrezza mtrezza added type:bug Impaired feature or lacking behavior that is likely assumed S4 labels Jan 30, 2021
@mtrezza
Copy link
Member Author

mtrezza commented Jan 30, 2021

I classified this issue as bug with severity S4:

  • Workaround: setting the root key as environment variable to a value that encodes an object
  • Fix: adapt CLI runner to consider all module exports or add all keys to main module export ParseServerOptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

1 participant