question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add previewURL support in Devfile format

See original GitHub issue

Is your enhancement related to a problem? Please describe.

Extend current devfile spec to be allow users to specify a previewURL for a given command

Describe the solution you’d like

 commands:
   - name: run
     previewUrl:
       port: <a port>
       path: <a subpath>
     actions:
       - type: exec
         component: mysql
         command: mvn clean
         workdir: /projects/spring-petclinic

Implementation

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:47 (47 by maintainers)

github_iconTop GitHub Comments

2reactions
metloscommented, Sep 30, 2019

Since we already have something that almost does the job - dockerimage endpoint (or rather the server in the old workspace config model), I’m struggling to see the real benefit of having a previewUrl placed on a command.

The intention seems to be that when the user invokes the command, Theia will know what URL to open to show the web ui of the application the command has supposedly started. Or at least that’s how I understood it.

But this completely ignores the usecase of invoking the application using the terminal or some other means (like would we be smart enough if previewUrl was placed on a command specifying launch configuration? how would that even work if the referenced launch.json contained more configs?).

IMHO, we’d be much better served with adding endpoint support to other component types and adding the path (and maybe even protocol) to the endpoint configuration. In such arrangement, we’d support all invocation modes.

If we wanted to add the support for automatically opening URL for commands, I think we could do it using a command attribute referencing the endpoint, e.g.:

components:
- name: nodejs
  type: dockerimage
  ...
  endpoints:
  - name: web-app
    port: 4040
    path: /app
commands:
- name: start
  actions:
  - type: exec
    component: nodejs
    previewEndpoint: web-app

WDYT @skabashnyuk @sleshchenko @l0rd ?

(I updated the example to use the previewEndpoint wording @sleshchenko suggested. I like it better than my original opensEndpoint).

1reaction
sparkoocommented, Oct 15, 2019

I’ve created an issue for Theia support of previewurl by proposed solution #14892

cc: @RomanNikitenko @l0rd

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 4. Authoring devfiles - Red Hat Customer Portal
The workspace name will be in the <generateName>YYYYY format, for example, devfile-sample-2y7kp , where Y is a random [a-z0-9] character. Adding a generated ......
Read more >
Devfile object Schema | Introduction to Devfile - GitHub Pages
Workspaces created from devfile, will use it as base and append random suffix. It's used when name is not defined. generateName. is optional;...
Read more >
What is a devfile
With devfiles, you record the instructions for configuring and running your build environment as a YAML-formatted text file. Then, optionally, you can ...
Read more >
Previewing running applications in the AWS Cloud9 ...
To test this behavior, add the following JavaScript code to a file that's named ... To return the content in a different format,...
Read more >
Devfile v2 and IDE plug-ins in Eclipse Che - Medium
Devfile v2 support in Eclipse Che is done through milestones enhancements. ... redhat/java VS Code extension in the Eclipse Che workspace.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found