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

Fix toggling DAG suspension for DAGs with custom names #636

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

rocwang
Copy link
Contributor

@rocwang rocwang commented Jul 29, 2024

I find that toggling DAG suspension (i.e. "live") from frontend doesn't work when the DAG has a custom name defined:

Screenshot 2024-07-29 at 8 06 11 PM

Similar to #625, the frontend fix is extracting the file basename with out the .yaml bit as the DAG ID, and pass that to the backend for toggling.

However, upon fruther inspection, I also found the backend rest API doesn't return the right suspension status on a DAG with custom name. Furthermore, the scheduler also assumes a DAG's "name" is always the filename when calling client.IsSuspended(). So I fixed those as well.

It looks like DAG.Name is used quite a few times when actually a DAG.ID should be used instead. Maybe we should consider adding a new ID field to the DAG struct, which always stores the YAML filename, while DAG.Name can be overwritten with a custom name from the DAG spec.

@yohamta
Copy link
Collaborator

yohamta commented Jul 29, 2024

Thank you very much for fixing the problem! Yes, I totally agree that we should add the ID field or method to DAG and use it throughout the internal code.

@yohamta yohamta merged commit 8198756 into dagu-org:main Jul 29, 2024
3 checks passed
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.

2 participants