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

Problem: Possible Bug when Removing Task Templates #2729

Open
norbekaiser opened this issue Feb 1, 2025 · 2 comments
Open

Problem: Possible Bug when Removing Task Templates #2729

norbekaiser opened this issue Feb 1, 2025 · 2 comments

Comments

@norbekaiser
Copy link

Issue

A Task which is Created can not be deleted once the Option "I want to run a task by the cron only for new [...]" is set.
This Option can not be deactivated by unchecking the Checkmark Again. Which resulst in the Task beeing not deletable.
Image

Image

Impact

Web-Frontend (what users interact with)

Installation method

Snap

Database

BoltDB

Browser

Firefox, Chrome, Microsoft Edge

Semaphore Version

2.10.22-e44910d-1721658299

Ansible Version

Logs & errors

No response

Manual installation - system information

No response

Configuration

No response

Additional information

When the above mentioned Option is not set, the task can be deleted as expected.
Image
However, the option can not be removed. After it is unchecked and saved, it persists.

@norbekaiser
Copy link
Author

I currently have the following workaround:
Export the Project via Backup, reset the cron value to null ( in template) and reimport Then it can be deleted again.

Before

{
      "inventory": "empty",
      "repository": "TestRepo",
      "environment": "Empty",
      "name": "Test A",
      "playbook": "playbook.yml",
      "arguments": "[]",
      "allow_override_args_in_task": false,
      "description": null,
      "vault_key": null,
      "type": "",
      "start_version": null,
      "build_template": null,
      "view": null,
      "autorun": false,
      "survey_vars": "null",
      "suppress_success_alerts": false,
      "cron": "@daily"
    },

After

{
      "inventory": "empty",
      "repository": "TestRepo",
      "environment": "Empty",
      "name": "Test A",
      "playbook": "playbook.yml",
      "arguments": "[]",
      "allow_override_args_in_task": false,
      "description": null,
      "vault_key": null,
      "type": "",
      "start_version": null,
      "build_template": null,
      "view": null,
      "autorun": false,
      "survey_vars": "null",
      "suppress_success_alerts": false,
      "cron": null
    },

@norbekaiser
Copy link
Author

i think i can narrow it down to soley beeing a gui issue with the Checkbox.
Looking at the Requests, the id of the schedule can be extracted
Image
and then be delted like in the following line

url: `/api/project/${this.projectId}/schedules/${this.schedules[0].id}`,

Image

which makes the template deletable, since no schedule is blocking it

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

No branches or pull requests

1 participant