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

[BUG] Viash 0.9 doesn't output the resource parent #654

Closed
2 tasks done
rcannood opened this issue Feb 24, 2024 · 1 comment
Closed
2 tasks done

[BUG] Viash 0.9 doesn't output the resource parent #654

rcannood opened this issue Feb 24, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@rcannood
Copy link
Member

rcannood commented Feb 24, 2024

What happened?

Viash 0.9 no longer outputs the parent of a resource when running viash config view

Steps to reproduce

Create a config src/foo/config.vsh.yaml with contents:

name: foo
resources:
  - type: bash_script
    path: script.sh
  - path: /project_relative.txt
  - path: ../relative.txt

Run viash config view:

name: "foo"
resources:
- type: "bash_script"
  path: "script.sh"
  is_executable: true
- type: "file"
  path: "project_relative.txt"
- type: "file"
  path: "relative.txt"

According to the resulting viash config view, it appears as if the README.md is relative to the foo component, which is not the case.

With Viash < 0.9, the output of viash config view is the following:

functionality:
  name: "foo"
  resources:
    - type: "bash_script"
      path: "script.sh"
      is_executable: true
      parent: "file:/home/rcannood/workspace/biobase/src/foo/"
    - type: "file"
      path: "project_relative.txt"
      parent: "file:///home/rcannood/workspace/biobase/"
    - type: "file"
      path: "relative.txt"
      parent: "file:/home/rcannood/workspace/biobase/src/"

I understand and agree that the parent attribute is not something that we want to output.

Expected behavior

Having said that, I would expect the output of viash config view to contain file paths that can actually be resolved.

That is, the output of viash config view and viash ns list show the original values stored in the viash config:

name: "foo"
resources:
- type: "bash_script"
  path: "script.sh"
  is_executable: true
- type: "file"
  path: "/project_relative.txt"
- type: "file"
  path: "../relative.txt"

However, when a viash build or viash ns build is run, the resulting .config.vsh.yaml should now contain the following info, because the resource files are now available relative to the .config.vsh.yaml.

name: "foo"
resources:
- type: "bash_script"
  path: "script.sh"
  is_executable: true
- type: "file"
  path: "project_relative.txt"
- type: "file"
  path: "relative.txt"

Relevant log output

No response

Version

0.9.0-RC2

Possible solution

This could be solved in a variety of ways. Either we could:

  • Not do any resource path resolution when running viash config view or viash ns list
  • Rename a resource's parent field to uri and make it store the full uri instead of the parent directory uri. That way, we can let the path field simply retain the unmodified original data.
  • Use different classes to denote whether the resource has not been resolved (string) or has been resolved (string and uri to parent dir / resource itself).

Confirmation

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided clear and concise information about the bug.

Additional context

No response

@rcannood rcannood added the bug Something isn't working label Feb 24, 2024
@Grifs
Copy link
Collaborator

Grifs commented Apr 3, 2024

Will be fixed in Viash 0.9.0-RC3

@Grifs Grifs closed this as completed Apr 3, 2024
@Grifs Grifs added this to the Viash 0.9.0-RC3 milestone Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants