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

Updated time duration to 30 seconds #5594

Merged
merged 11 commits into from
Oct 23, 2024
Merged

Conversation

yoyounik
Copy link
Contributor

Screenshot 2024-10-22 150434

What changes are being made and why?


How the changes have been QAed?


Setup Instructions

@Skraye
Copy link
Member

Skraye commented Oct 22, 2024

Hello @yoyounik, can you tell us more about your PR ?

@yoyounik
Copy link
Contributor Author

hello @Skraye
Sure! In this PR, I’ve added a sleep task with a 30-second duration to the test workflow. The purpose of this change is to simulate a wait time between tasks in the workflow to ensure smooth task transitions.
Specifically:

  1. Updated the duration flow to include the sleep task of 30seconds.
    2.This change is useful for testing scenarios where a delay is required between task executions.

please let me know if you need more details or have any questions! Thanks for reviewing.

@Skraye Skraye self-requested a review October 22, 2024 09:51
Copy link
Member

@Skraye Skraye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discuss here #4879 the issue has been misunderstood
Please make the change and restore the test as it was

@yoyounik
Copy link
Contributor Author

hello @Skraye
I've made some changes to this PR:

Added a new Java class: io.kestra.plugin.core.debug
Updated the YAML file: core/src/test/resources/flows/valids/wait-task-flow.yaml
The new Java class and YAML file are necessary for implementing the wait task functionality.

Note: I've temporarily ignored writing test cases to expedite the PR review process. I'll add comprehensive test cases in a follow-up commit once the core functionality is approved.

Please review these changes and let me know if you have any questions or require further clarification.

Copy link
Member

@Skraye Skraye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closed to perfection! Small changes and we are good, you can add a test :)

core/src/main/java/io/kestra/plugin/core/debug/Wait.java Outdated Show resolved Hide resolved
core/src/test/resources/flows/valids/sleep.yml Outdated Show resolved Hide resolved
core/src/test/resources/flows/valids/wait-task-flow.yaml Outdated Show resolved Hide resolved
@yoyounik
Copy link
Contributor Author

hey @anna-geller @Skraye
I've added a new test for the wait task in SequentialTest.java.
While running the tests, I encountered some Gradle build warnings related to deprecated features. Here's the relevant part of the output:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0
I'm not familiar with the specific configuration of the Kestra build process. Could you please provide some guidance on how to address these warnings?

Additionally, any feedback on the SequentialTest.java test case would be greatly appreciated.

@Skraye Skraye self-requested a review October 23, 2024 07:20
@Example(
code = """
id: wait
type: wait.task
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a valid type, the example won't work

@@ -0,0 +1,55 @@
package io.kestra.plugin.core.debug;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package is not the good one, here is the one asked in the original issue :
io.kestra.plugin.core.flow.Sleep
with io.kestra.plugin.core.flow being the package and Sleep being the class name
and this will form the task type

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yoyounik Please read this, better take your times to make correct changes once than doing it 10 times

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skraye I apologize for the repeated mistakes. I will take my time to ensure that the changes are correct before submitting them again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Skraye
Thanks for the feedback. You're right, "Sleep" might be a more descriptive name for the class.

I can rename the Wait.java class to Sleep.java and update the code accordingly. This would keep the file in the io.kestra.plugin.core.flow package.

Does that sound like a good approach?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly what's need to be done 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay then i will rename it and update you @Skraye

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Skraye
changes i made:
Wait.java changed to Sleep.java,
wait-task-flow.yml changed to sleep-task-flow.yml and changes inside it to Sleep.
sleep.yml's type has been changed.

going to update these changes now, please go through this once, and thanks for the patience shown :).
Please update me if any changes required.

Comment on lines 1 to 7
id: sleep-task-flow
namespace: io.kestra.tests

tasks:
- id: sleep
type: io.kestra.core.tasks.scripts.Bash
script: sleep 30
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this ? Never use

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done @Skraye

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete the file, not just remove the content please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello @Skraye
Updated the changes according to your review, Thanks alot for the review , if you have time to review it once more , please check and tell if there is need of any more modifications.

                      type: io.kestra.plugin.core.debug.Wait
                      duration: "PT5S"
                      type: io.kestra.plugin.core.debug.Wait
                      duration: "PT5S"

        Also updated the wait.java in the flow package
@Example(
code = """
id: wait
type: io.kestra.plugin.core.debug.Wait
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong type


tasks:
- id: wait
type: io.kestra.plugin.core.debug.Wait
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong type

core/src/test/resources/flows/sleep-task.yml Outdated Show resolved Hide resolved
wait-task-flow.yml changed to sleep-task-flow.yml and changes inside it to Sleep.
sleep.yml's type has been changed.
@Skraye Skraye merged commit b99d9d4 into kestra-io:develop Oct 23, 2024
7 checks passed
@yoyounik
Copy link
Contributor Author

Thanks again @Skraye and everyone for the guiding out throughout the work process. @Skraye do you have any suggestions or guidance on how I can contribute more to the project? I'm excited to keep learning and contributing wherever I can.

@Skraye
Copy link
Member

Skraye commented Oct 23, 2024

We have a full list that are good for learning to work on the project :
https://github.com/kestra-io/kestra/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+no%3Aassignee

Pick a new one in the list, take your times to understand the issue correctly, and feel free to open another PR!

@yoyounik
Copy link
Contributor Author

Thank you! @Skraye I'll take a look at the list and make sure to fully understand the issues before opening another PR :)

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

Successfully merging this pull request may close these issues.

2 participants