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

Directory extraction task in workflow extracts unexpected items #9

Open
ishizuka-mihoko opened this issue Sep 27, 2023 · 0 comments
Open

Comments

@ishizuka-mihoko
Copy link

Problem

I have a question about using digdag-plugin-shresult.
In a .dig file, I have the following configuration:

_export:
  plugin:
    repositories:
      - https://jitpack.io/
    dependencies:
      - com.github.takemikami:digdag-plugin-shresult:0.0.3

+find_dirs:
  sh_result>: |
    find ./ -maxdepth 1 -type d -exec basename {} \; | grep -v "^.$" | grep -E '^\[' | sort -u | tr '\n' ',' | sed 's/,$//'
  destination_variable: dirs
  stdout_format: text

+call_dig:
  for_each>:
    dir: "${dirs.split(',')}"
  _parallel: true
  _do:
    +loop_dig:
      call>: ${dir}/unload.dig

In the ‘+find_dirs’ task, I’m attempting to extract directory names that start with ‘[’ and store them in the ‘dirs’ variable. However, during Digdag execution, there are instances where items other than directory names starting with ‘[’ are being stored in ‘dirs’.
Is this potentially a bug in plugin? I would appreciate your confirmation.
Here are the ‘dirs’ values that I want to extract and the ‘dirs’ values that were mistakenly extracted in this operation:

Desired ‘dirs’:
dirs: [foo1]bar1,[foo2]bar2,[foo3]bar3,[foo4]bar4

‘Dirs’ extracted in the current operation (Example 1: Code from the executed workflow’s .dig file is being extracted):

dirs: >+ 
2023-09-14 21:45:48 +0000 [INFO] (1913@[0:test_wf]+test_coordinator+call_dig^sub^sub+find_dirs) io.digdag.core.agent.OperatorManager: sh_result>: find ./ -maxdepth 1 -type d -exec basename {} \; | grep -v "^.$" | grep -E '^\[' | sort -u | tr '\n' ',' | sed 's/,$//' 

‘Dirs’ extracted in the current operation (Example 2: Logs from other projects executed at the same time are being extracted):

dirs: >- 
2023-09-07 09:15:02 +0000 [INFO] (5117@[0:cost_alert]+cost_change+scripts+notice) io.digdag.core.agent.OperatorManager: sh>: cd cost_alert python3 [main.py](http://main.py/) -t increase [foo1]bar1,[foo2]bar2,[foo3]bar3,[foo4]bar4

Problem Information

digdag: 0.10.4
macOS: 12.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant