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

Feat/workflow list enhancement #305

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

tdari
Copy link
Contributor

@tdari tdari commented Jun 27, 2024

This PR will enhance the workflow list by adding checkboxes to control workflows and changing the UI for this new feature.

  • Implement Force stop run of a workflow #298
  • Add action buttons for batch operations.
    Add a control for the disabled state of the action buttons.
  • Update the alignment and density of rows.
  • Add stop action endpoint for single workflow.
  • Add REST endpoints for batch operations.
    • batch delete
    • batch run
    • batch stop
  • Add the last run status of tasks to the workflow list.
  • Add a single run button.
  • Update the toast notifications for batch operations.
  • Add unit tests for the new REST endpoints.
  • Allow only a single run for a workflow to be running. (no reason to run the same workflow with the same params in parallel)

Current UI (WIP):
image

@luiztauffer
Copy link
Member

@tdari this is looking neat, I like compact!

we are missing the "visualize workflow" action, though. Or, in your proposed design, how does the user navigate to the specific workflow visualization page?

@tdari
Copy link
Contributor Author

tdari commented Jun 28, 2024

hi, @luiztauffer. Individual list items are still redirecting to the details page. It's working as it was before.

@tdari
Copy link
Contributor Author

tdari commented Jul 10, 2024

@vinicvaz why do we have this restriction here in workflow_service.py? Is it something with Airflow? I think we should allow this to enable users to test their workflows. What do you think?

def run_workflow(self, workflow_id: int):
        .
        .

        # Check if start date is in the past
        if workflow.start_date and workflow.start_date > datetime.now(tz=timezone.utc):
            raise ForbiddenException('Workflow start date is in the future. Can not run it now.')

        if workflow.end_date and workflow.end_date < datetime.now(tz=timezone.utc):
            raise ForbiddenException('You cannot run workflows that have ended.')

        .
        .

@vinicvaz
Copy link
Collaborator

@vinicvaz why do we have this restriction here in workflow_service.py? Is it something with Airflow? I think we should allow this to enable users to test their workflows. What do you think?

def run_workflow(self, workflow_id: int):
        .
        .

        # Check if start date is in the past
        if workflow.start_date and workflow.start_date > datetime.now(tz=timezone.utc):
            raise ForbiddenException('Workflow start date is in the future. Can not run it now.')

        if workflow.end_date and workflow.end_date < datetime.now(tz=timezone.utc):
            raise ForbiddenException('You cannot run workflows that have ended.')

        .
        .

Hey @tdari .

In Airflow, if a DAG has a start date set in the future, triggering a run will only schedule it for execution after the start date, transitioning the DAG to a 'scheduled' state instead of running it immediately. That is why we are blocking this operation for workflows with start date in the future.

@tdari
Copy link
Contributor Author

tdari commented Jul 10, 2024

I see thanks @vinicvaz

@tdari tdari force-pushed the feat/workflow-list-enhancement branch from 1ebf8bb to 959cd5d Compare July 16, 2024 20:44
@tdari
Copy link
Contributor Author

tdari commented Jul 18, 2024

I've finished most of this PR. Can you test it before I start writing tests? There may be some mistakes I haven't noticed, and I've had to decide on naming conventions, endpoints, etc. Let me know if you have a better proposal. I couldn't separate commits as I expected. Sorry for such a big change list.

@tdari tdari force-pushed the feat/workflow-list-enhancement branch from 959cd5d to 65f90b4 Compare July 26, 2024 20:18
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

Successfully merging this pull request may close these issues.

3 participants