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

odo init interactive mode does not prompt for Devfile personalization when running from empty directory #6313

Closed
rm3l opened this issue Nov 16, 2022 · 1 comment · Fixed by #6351
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@rm3l
Copy link
Member

rm3l commented Nov 16, 2022

/kind bug

What versions of software are you using?

Operating System:
Fedora 37

Output of odo version:

$ odo version
odo v3.2.0 (ce42ce435)

Server: https://10.10.10.105:6443
Kubernetes: v1.25.3

ce42ce4

How did you run odo exactly?

# Start from an empty directory
mkdir -p /tmp/test-odo-init-from-empty-dir
cd /tmp/test-odo-init-from-empty-dir

# Run odo init interactively till the end.
odo init

Actual behavior

Devfile is downloaded as expected, but we are not prompting users to personalize its configuration (by updating endpoints or environment variables).

$ odo init
  __
 /  \__     Initializing a new component
 \__/  \    Files: No source code detected, a starter project will be created in the current directory
 /  \__/    odo version: v3.2.0
 \__/

Interactive mode enabled, please answer the following questions:
? Select language: Java
? Select project type: Quarkus Java
 ✓  Downloading devfile "java-quarkus" from registry "DefaultDevfileRegistry" [1s]
? Which starter project do you want to use? redhat-product
? Enter component name: test-odo-init-from-empty-dir
 ✓  Downloading starter project "redhat-product" [2s]

Port configuration using flag is currently not supported  

You can automate this command by executing:
   odo init --name test-odo-init-from-empty-dir --devfile java-quarkus --devfile-registry DefaultDevfileRegistry --starter redhat-product


Your new component 'test-odo-init-from-empty-dir' is ready in the current directory.
To start editing your component, use 'odo dev' and open this folder in your favorite IDE.
Changes will be directly reflected on the cluster.

Expected behavior

The current behavior seems inconsistent, depending on whether the directory has source code or not.

When there is source code, odo prompts for Devfile personalization, as we can confirm below:

$ git clone https://github.com/gothinkster/node-express-realworld-example-app && cd node-express-realworld-example-app

$ odo init
  __
 /  \__     Initializing a new component
 \__/  \    Files: Source code detected, a Devfile will be determined based upon source code autodetection
 /  \__/    odo version: v3.2.0
 \__/

Interactive mode enabled, please answer the following questions:
Based on the files in the current directory odo detected
Language: JavaScript
Project type: Node.js
The devfile "nodejs" from the registry "DefaultDevfileRegistry" will be downloaded.
? Is this correct? Yes
 ✓  Downloading devfile "nodejs" from registry "DefaultDevfileRegistry" [1s]

↪ Container Configuration "runtime":
  OPEN PORTS:
    - 3000
    - 5858
  ENVIRONMENT VARIABLES:
    - DEBUG_PORT = 5858

? Select container for which you want to change configuration? NONE - configuration is correct
? Enter component name: conduit-node

Port configuration using flag is currently not supported  

You can automate this command by executing:
   odo init --name conduit-node --devfile nodejs --devfile-registry DefaultDevfileRegistry


Your new component 'conduit-node' is ready in the current directory.
To start editing your component, use 'odo dev' and open this folder in your favorite IDE.
Changes will be directly reflected on the cluster.

I think we should do the same thing even if there is no source code, because users may have an idea of how their application could look like in the end (regardless of whether they select a starter project or not).

Any logs, error output, etc?

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 16, 2022
@rm3l rm3l added this to odo Project Nov 16, 2022
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Nov 16, 2022
@rm3l rm3l removed the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Nov 16, 2022
@anandrkskd
Copy link
Contributor

@rm3l I think current behavior should be the expected behavior,
According to current workflow, first we are downloading the devfile, and then we ask/download the starter project associated to it, does it make sense to update/edit the devfile if we will use the starter project?

@rm3l rm3l added this to the v3.4.0 🚀 milestone Nov 23, 2022
@anandrkskd anandrkskd moved this to In Progress 🚧 in odo Project Nov 28, 2022
@anandrkskd anandrkskd moved this from In Progress 🚧 to In Review 👀 in odo Project Nov 28, 2022
Repository owner moved this from In Review 👀 to Done ✅ in odo Project Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants