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

Change task run value color to white to make it readable in the ForEach task Gantt and Logs views #5445

Closed
anna-geller opened this issue Oct 14, 2024 · 6 comments
Assignees
Labels
area/frontend Needs frontend code changes bug Something isn't working good first issue Great issue for new contributors kind/quick-win Seems to be quick to do

Comments

@anna-geller
Copy link
Member

Describe the issue

image

image

to reproduce, create two flows and run the first one:

id: file_output_parent_concat_foreach_batch_1
namespace: company.team

  outputs:
    - id: myoutput
      type: FILE
      value: "{{ outputs.jsonata.uri }}"

tasks:
  - id: extract
    type: io.kestra.plugin.jdbc.duckdb.Query
    sql: |
      INSTALL httpfs;
      LOAD httpfs;
      SELECT *
      FROM read_csv_auto('https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv', header=True);
    store: true

  - id: for_each_item
    type: io.kestra.plugin.core.flow.ForEachItem
    items: "{{ outputs.extract.uri }}"
    batch:
      rows: 1 # TBD annoying that it cannot be passed from inputs
      # https://github.com/kestra-io/kestra/issues/5442
    namespace: company.team
    flowId: file_output_child
    wait: true
    transmitFailed: true
    inputs:
      json_file: "{{ taskrun.items }}"

  - id: ion_to_json
    type: io.kestra.plugin.serdes.json.IonToJson
    from: "{{ outputs.for_each_item_merge.subflowOutputs }}"
    newLine: false

  - id: merge
    type: io.kestra.plugin.core.storage.Concat
    files: "{{ read(outputs.ion_to_json.uri) | jq('map(.myoutput)') | flatten }}"
    separator: "\n"

  - id: for_each
    type: io.kestra.plugin.core.flow.ForEach
    allowFailure: true
    description: this will fail with Unable to read the file 'kestra:///....ion' as it didn't belong to the current execution
    values: "{{ read(outputs.ion_to_json.uri) }}"
    tasks:
      - id: log
        type: io.kestra.plugin.core.log.Log
        allowFailure: true
        message: "{{ read(json(taskrun.value).myoutput) }}"

child flow:

id: file_output_child
namespace: company.team

inputs:
  - id: json_file
    type: FILE

tasks:
  - id: read_raw_ion_file
    type: io.kestra.plugin.core.log.Log
    message: "{{ read(inputs.json_file) }}"

  - id: jsonata
    type: io.kestra.plugin.transform.jsonata.TransformItems
    from: "{{ inputs.json_file }}"
    expression: |
      {
        "id": id,
        "name": data.Color & ' ' & name
      }

Environment

  • Kestra Version:
  • Operating System (OS/Docker/Kubernetes):
  • Java Version (if you don't run kestra in Docker):
@anna-geller anna-geller added bug Something isn't working area/frontend Needs frontend code changes kind/quick-win Seems to be quick to do good first issue Great issue for new contributors labels Oct 14, 2024
@MilosPaunovic MilosPaunovic self-assigned this Oct 14, 2024
@MilosPaunovic
Copy link
Member

Absolutely, go for it! 🚀

@Daulat1249
Copy link

I think we can add a "color" attribute within the "log" task like this :

  • id: log
    type: io.kestra.plugin.core.log.Log
    allowFailure: true
    message: "{{ read(json(taskrun.value).myoutput) }}"
    color: white
    -> can add this inside the parent file
    -> Q: I'm not sure about this so can you just help me with do i have to something more in it?
    @MilosPaunovic

@anna-geller
Copy link
Member Author

@Daulat1249 this issue is purely a frontend display/design issue, no need to adjust the Log task 👍

@Dheerajr444
Copy link

Hi @anna-geller unable to reproduce this issue as you say I create two flows and run the first one this show an error
Unable to find subflowOutputsused in the expression{{ outputs.for_each_item_merge.subflowOutputs }} at line 1

@anna-geller
Copy link
Member Author

anna-geller commented Oct 15, 2024

the flow here is just an example, what matters for the issue is the task run name color

@mithindev mithindev removed their assignment Oct 23, 2024
mithindev added a commit to mithindev/kestra that referenced this issue Oct 23, 2024
…Gantt and Logs views (kestra-io#5445)

Signed-off-by: mithindev <mithindev1@gmail.com>
@MilosPaunovic
Copy link
Member

Closed via #5642.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Needs frontend code changes bug Something isn't working good first issue Great issue for new contributors kind/quick-win Seems to be quick to do
Projects
Status: Done
Development

No branches or pull requests

5 participants