Skip to content

rich parameters: add /prompt API #7099

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

Closed
mtojek opened this issue Apr 12, 2023 · 4 comments
Closed

rich parameters: add /prompt API #7099

mtojek opened this issue Apr 12, 2023 · 4 comments
Labels
needs-rfc Issues that needs an RFC due to an expansive scope and unclear implementation path.

Comments

@mtojek
Copy link
Member

mtojek commented Apr 12, 2023

The goal of this issue is to research (and possibly implement) a new "prompt" API endpoint that determines parameter fields that coder UI/CLI must prompt for. Currently, we have the same logic rules encoded in UI and CLI, so there is a risk of having a mismatch.

There are different conditions under which specific fields should be displayed:

  • new workspace/consecutive workspace build/workspace update
  • immutables vs. mutables
  • default values vs. required
  • prompt_user (will be added in the nearest future), one-time parameter values
  • inheriting parameters from previous builds

There is also some coupling with legacy parameters, so ideally we should wait with implementation of this task until legacy params are removed


Slack thread:

Bruno Quaresma
Honestly, I would like to have this logic in the BE somehow.
GET /workspaces/parameters/prompt?templateversion=latest

[
 { name: "githuburl", display_name: "Github", default_value: "something" },
 { name: "otherfied", display_name: "Other field", default_value: null}
]

Bruno Quaresma
so the FE and CLI are going to use the same logic to know what fields ask the user when the users are updating or starting a workspace based in the template version. (edited)
@matifali
Copy link
Member

matifali commented Jul 7, 2023

Hi, @mtojek I believe this is now possible with the new ephemeral field for coder parameters.

@mtojek
Copy link
Member Author

mtojek commented Jul 7, 2023

Ephemeral fields are not related to this initiative.

The goal of this issue is to move logic to determine parameters for a template from FE to BE. This simplifies FE and makes it less error-prone. Let's keep it.

@github-actions github-actions bot added the stale This issue is like stale bread. label Jan 4, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2024
@mtojek
Copy link
Member Author

mtojek commented Jan 15, 2024

We still need this issue. Otherwise we leak business logic to site/frontend and CLI.

@bpmct
Copy link
Member

bpmct commented Apr 26, 2024

Is anyone interested in writing an RFC for this?

@matifali matifali added the needs-rfc Issues that needs an RFC due to an expansive scope and unclear implementation path. label Apr 26, 2024
@bpmct bpmct closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rfc Issues that needs an RFC due to an expansive scope and unclear implementation path.
Projects
None yet
Development

No branches or pull requests

3 participants