warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21.23k stars 367 forks source link

Adding launch configuration programmatically doesn't work #3780

Open Will-Mann-16 opened 1 year ago

Will-Mann-16 commented 1 year ago

Discord username (optional)

techn0will

Describe the bug

I'm trying to write a tool to allow my team members to run the local environment for a project we're working on. The idea is we have a script to replace the __LOCAL_ENV__ with the cwd absolute path name (yes, this works as expected), and copy the file into the ~/.warp/launch_configurations/local-env.yaml. However, I cannot see the new configuration file in the launch configurations tab, nor launch from raycast, nor use the uri scheme to open. This does work with a test launch config saved from inside the Warp app, in all use cases stated above. I was wondering if my configuration wasn't correct, or if this feature isn't supported yet?

To reproduce

Copy this into ~/.warp/launch_configurations/local-env.yaml

---
name: local-env launch configuration
windows:
  - tabs:
      - title: docker
        layout:
          cwd: __LOCAL_ENV__
          commands:
            - docker compose up

      - title: config-fairy
        layout:
          cwd: __LOCAL_ENV__
          commands:
            - task config-fairy:run

      - title: event-api
        layout:
          cwd: __LOCAL_ENV__
          commands:
            - task event-api:run

      - title: processors
        layout:
          cwd: __LOCAL_ENV__
          commands:
            - task processors:run

      - title: scrapers
        layout:
          cwd: __LOCAL_ENV__
          commands:
            - echo "to use the scrapers, run `task scrapers:run`"

Replace __LOCAL_ENV__ with an absolute path in your directory.

Expected behavior

4 new tab windows to open (I know the scripts won't work on your testing machines). At the moment none of them work.

Screenshots

CleanShot 2023-10-15 at 18 47 02@2x CleanShot 2023-10-15 at 18 47 17@2x

Operating system

MacOS

Operating system and version

13.0.1 (22A400)

Shell Version

zsh 5.8.1 (x86_64-apple-darwin22.0)

Current Warp version

v0.2023.10.10.08.06.stable_02

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

No

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

N/A, the issue only applies to a Warp specific feature. (i.e. Warp AI, Workflows)

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

None

dannyneira commented 1 year ago

Hey @Will-Mann-16 Sorry about this, we could do better at surfacing issues within the launch config yaml files. That being said, I did look through your file and it looks like you were missing the - exec: in your commands: area. Please see an example in our docs: https://docs.warp.dev/features/sessions/launch-configurations#commands Also, I believe you may no be able to use env variables for the cwd:. I hope this helps with your debugging.

---
name: local-env launch configuration
windows:
  - tabs:
      - title: docker
        layout:
          cwd: __LOCAL_ENV__
          commands:
            - exec: docker compose up

      - title: config-fairy
        layout:
          cwd: __LOCAL_ENV__
          commands:
            - exec: task config-fairy:run

      - title: event-api
        layout:
          cwd: __LOCAL_ENV__
          commands:
            - exec: task event-api:run

      - title: processors
        layout:
          cwd: __LOCAL_ENV__
          commands:
            - exec: task processors:run

      - title: scrapers
        layout:
          cwd: __LOCAL_ENV__
          commands:
            - exec: echo "to use the scrapers, run `task scrapers:run`"
Will-Mann-16 commented 12 months ago

Figured out the issues here, you're correct the CWD path was incorrect and i needed the exec - but that raises a good point. Would you consider some form of validation utility? Or error indicating in the app? As I couldn't see it unless it was right

dannyneira commented 12 months ago

Thanks for confirming, I'll bring this up with the team as a room for improvement.

dkadrios commented 9 months ago

I for one would love to see a built-in launch config editor. Even bare-bones would be great, so long as it highlights schema issues within our yaml.