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

work-dir does not work as a replacement for --cwd #966

Open
malnor opened this issue Jun 19, 2023 · 1 comment · May be fixed by pulumi/pulumi#13333
Open

work-dir does not work as a replacement for --cwd #966

malnor opened this issue Jun 19, 2023 · 1 comment · May be fixed by pulumi/pulumi#13333
Labels
area/cicd kind/bug Some behavior is incorrect or out of spec

Comments

@malnor
Copy link

malnor commented Jun 19, 2023

What happened?

Running a pipeline trying to use work-dir isn't working as expected. The work-dir directory becomes

##[debug]Working directory resolved at /home/runner/work/aaa.infra/aaa.infra/xxx

Which then fails with

Error: code: -2
 stdout: 
 stderr: Command failed with exit code 255: pulumi stack select --stack xxx.labs --non-interactive

This should happen because it cannot find the stack because it is the wrong folder.

If we set workdir to .../xxx we get

##[debug]Working directory resolved at /home/runner/work/aaa.infra/xxx

And the error is

Error: code: -2
 stdout: 
 stderr: Command failed with ENOENT: pulumi version --non-interactive
spawn pulumi ENOENT

Looks like it cannot find pulumi at all?

pulumi --cwd xxx --stack xxx.test works just find locally

Expected Behavior

work-dir should (from our understanding) work the same way as --cwd in the pulumi-cli

Steps to reproduce

Monorepo with folders for each project

Should work?

 - uses: pulumi/actions@v3
        name: Pulumi preview
        with:
          command: preview
          work-dir: xxx
          stack-name: xxx.test
          comment-on-pr: true
          pulumi-version: 3.70.0

Shouldn't work but gives a different error?

 - uses: pulumi/actions@v3
        name: Pulumi preview
        with:
          command: preview
          work-dir: ../xxx
          stack-name: xxx.test
          comment-on-pr: true
          pulumi-version: 3.70.0

Output of pulumi about

We cannot run it in the action (it is not an allowed command) - so we assume that you mean locally

Running locally from the root (which is not what we really want), we always use --cwd

❯ pulumi about
CLI          
Version      3.71.0
Go Version   go1.20.5
Go Compiler  gc

Host     
OS       darwin
Version  13.4
Arch     x86_64

Backend        
Name           localhost.local
URL            azblob://shared
User           malin
Organizations  

Pulumi locates its logs in /var/folders/rh/f4qnwl1n55sb9wb0dlb92f_80000gn/T/ by default
warning: Failed to read project: no Pulumi.yaml project file found (searching upwards from /Users/malin/repo/kubility.pulumi.infra). If you have not created a project yet, use `pulumi new` to do so: no project file found
warning: Failed to get information about the current stack: no Pulumi.yaml project file found (searching upwards from /Users/malin/repo/kubility.pulumi.infra). If you have not created a project yet, use `pulumi new` to do so: no project file found

   $ brew update && brew upgrade pulumi
or visit https://pulumi.com/docs/install/ for manual instructions and release notes.

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@malnor malnor added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jun 19, 2023
@dixler dixler added area/cicd and removed needs-triage Needs attention from the triage team labels Jun 26, 2023
@dixler dixler self-assigned this Jun 29, 2023
@lunaris
Copy link
Contributor

lunaris commented Jul 24, 2024

Hey @malnor, sorry that this issue appears to have gone stale. Is this still affecting you? I'm curious to get more information since with work-dir being a required configuration parameter, it feels like we'd be breaking more setups if it were fundamentally not working. Thanks for any information you can provide 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cicd kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants