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

[3.35.0 regression] Precondition scripts no longer working #1522

Closed
ReillyBrogan opened this issue Mar 1, 2024 · 2 comments · Fixed by #1523
Closed

[3.35.0 regression] Precondition scripts no longer working #1522

ReillyBrogan opened this issue Mar 1, 2024 · 2 comments · Fixed by #1523
Labels
area: variables Changes related to variables.

Comments

@ReillyBrogan
Copy link
Contributor

  • Task version: 3.35.0
  • Operating system: Linux (Solus)
  • Experiments enabled: N/A

I was updating the Solus go-task package to v3.35.0, and while testing it I noticed that there was a regression in that a script that we had as a precondition of a task stopped working. This worked on v3.34.1, so this is a regression specific to v3.35.0

We have a task for publishing packages that looks like the following:

  publish:
    desc: Tag and publish a release
    dir: '{{ .USER_WORKING_DIR }}'
    preconditions:
      - sh: test $(git symbolic-ref HEAD 2>/dev/null) = "refs/heads/main"
        msg: Not on main branch
      - sh: "{{ .TASKFILE_DIR }}/common/Scripts/package-publish-safety-catches.sh"
        msg: Failed to pass safety catches
    deps:
      - package-file
    cmds:
      - git push
      - task: push

The package-publish-safety-catches.sh script is available here.

When this task is called it now always errors out with the following error:

task: Failed to pass safety catches
task: precondition not met

When the script is ran directly it runs without issue and exits with a 0 status code (IE, indicating that none of the conditions that it's designed to detect are present). I tested both Fish shell and Bash to see if it made a difference and both had the same error. In case it matters we are building with golang 1.22.0. I also tested the official v3.35.0 binaries from Github and they exhibit the same behavior.

Bisecting this reveals that the bad commit is bb9d582.

@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Mar 1, 2024
@pd93
Copy link
Member

pd93 commented Mar 1, 2024

Hi @ReillyBrogan. Thanks for reporting. I see that you're using dir: '{{ .USER_WORKING_DIR }}'. Are you running Task from a directory other than the directory containing the Taskfile? It would help me to understand what directory you're running the command from and where the Taskfile is relative to this. Thanks

@pd93 pd93 added type: bug Something not working as intended. area: variables Changes related to variables. and removed state: needs triage Waiting to be triaged by a maintainer. labels Mar 1, 2024
@ReillyBrogan
Copy link
Contributor Author

Hi @ReillyBrogan. Thanks for reporting. I see that you're using dir: '{{ .USER_WORKING_DIR }}'. Are you running Task from a directory other than the directory containing the Taskfile? It would help me to understand what directory you're running the command from and where the Taskfile is relative to this. Thanks

Yes, our Taskfile lives in the root of our repo. For the task with the issue we would indeed call go-task in a sub-directory.

@pd93 pd93 closed this as completed in #1523 Mar 3, 2024
@pd93 pd93 removed the type: bug Something not working as intended. label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: variables Changes related to variables.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants