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

ui(fix): fix broken genreated curl #4696

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

yuri1969
Copy link
Contributor

@yuri1969 yuri1969 commented Aug 18, 2024

What changes are being made and why?

  • The 'FILE' type is always used with the kestra.json file.
  • Values of temporal types are correctly formatted.

closes #4661


How the changes have been QAed?

Removed the SECRET type due OSS limitations:

id: inputs_curl
namespace: company.team

inputs:
  - id: user
    type: STRING
    required: false
    defaults: Rick Astley

  - id: int
    type: INT
    defaults: 100

  - id: list_of_int
    type: ARRAY
    itemType: INT
    defaults: [1, 2, 3]

  - id: bool
    type: BOOLEAN
    defaults: true

  - id: float
    type: FLOAT
    defaults: 42.42

  - id: select
    type: SELECT 
    defaults: VALUE_1
    values:
      - VALUE_1
      - VALUE_2
      - VALUE_3

  - id: multiselect
    type: MULTISELECT 
    defaults: 
      - VALUE_1
      - VALUE_2
    options:
      - VALUE_1
      - VALUE_2
      - VALUE_3

  - id: dt
    type: DATETIME
    defaults: "2024-08-09T14:19:00Z"

  - id: json
    type: JSON
    defaults: |-
      [{"name": "kestra", "rating": "best in class"}]

  - id: file
    type: FILE
    required: false

  - id: date
    type: DATE
    defaults: "2024-10-25"
    description: Illegal state as curl shows this as datetime -F 'date=2024-10-24T22:00:00.000Z'

  - id: time
    type: TIME
    defaults: "12:45:00"
    description: Illegal state as curl shows this as -F 'time=Wed Aug 14 2024 12:45:00 GMT+0200'

  - id: duration
    type: DURATION
    defaults: "PT1H"
    description: Illegal state as curl shows this as -F 'duration=Wed Aug 14 2024 01:00:00 GMT+0200'

tasks:
  - id: hello
    type: io.kestra.plugin.core.log.Log
    message: Hello {{ inputs.user }}

  - id: get
    type: io.kestra.plugin.core.output.OutputValues
    values: 
      inputs: "{{ inputs }}"

Rendered curl command:

curl -O 'https://huggingface.co/datasets/kestra/datasets/resolve/main/json/kestra.json' && \
curl -v -X POST -H 'Content-Type: multipart/form-data' -F 'user=Rick Astley' -F 'int=100' -F 'list_of_int=[1,2,3]' -F 'bool=true' -F 'float=42.42' -F 'select=VALUE_1' -F 'multiselect=["VALUE_1","VALUE_2"]' -F 'dt=2024-08-09T14:19:00.000Z' -F 'json=[{"name": "kestra", "rating": "best in class"}]' -F 'files=@kestra.json;filename=file' -F 'date=2024-10-25' -F 'time=12:45:00' -F 'duration=PT1H' 'http://localhost:8080/api/v1/executions/company.team/inputs_curl'

* The 'FILE' type is always used with the `kestra.json` file.
* Values of temporal types are correctly formated.
@MilosPaunovic MilosPaunovic merged commit cb1d2a7 into kestra-io:develop Aug 26, 2024
7 checks passed
@yuri1969 yuri1969 deleted the improve-curl branch August 26, 2024 08:17
Skraye added a commit that referenced this pull request Sep 10, 2024
Skraye added a commit that referenced this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants