Skip to content

Commit

Permalink
Remove generic polling task (demisto#31411)
Browse files Browse the repository at this point in the history
* generic polling task was removed and read me file created

* Release notes update

* release notes update

* old playbook deprecated and new version created

* release notes added

* added image to the old playbook version

* deprecated for the playbook

* RN updated

* added image

* removed unnecessary tasks

* added more outputs

* RN updated

* added description

* image replaced

* added an instance to a test PB

* removed tests instances
removed from PB this test

* removed tests

---------

Co-authored-by: Sasha Sokolovich <[email protected]>
Co-authored-by: ssokolovich <[email protected]>
  • Loading branch information
3 people authored Dec 17, 2023
1 parent 91f5c50 commit 7ca7eeb
Show file tree
Hide file tree
Showing 13 changed files with 773 additions and 98 deletions.
101 changes: 24 additions & 77 deletions Packs/AzureDevOps/Playbooks/Azure-DevOps-Pipeline-Run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: -1
contentitemexportablefields:
contentitemfields: {}
name: Azure-DevOps-Pipeline-Run
description: This playbook runs a pipeline on the Azure DevOps Environment.
description: Deprecated. Use azure-devops-pipeline-run command instead.
starttaskid: "0"
tasks:
"0":
Expand Down Expand Up @@ -35,6 +35,7 @@ tasks:
quietmode: 0
isoversize: false
isautoswitchedtoquietmode: false
continueonerrortype: ""
"1":
id: "1"
taskid: c8c1d796-08f6-428d-8c85-71634d0db775
Expand Down Expand Up @@ -76,6 +77,7 @@ tasks:
quietmode: 0
isoversize: false
isautoswitchedtoquietmode: false
continueonerrortype: ""
"2":
id: "2"
taskid: 30368ad5-36da-4472-8a60-527a45685005
Expand Down Expand Up @@ -103,76 +105,18 @@ tasks:
complex:
root: AzureDevOps.PipelineRun
accessor: run_id
separatecontext: false
view: |-
{
"position": {
"x": 162.5,
"y": 370
}
}
note: false
timertriggers: []
ignoreworker: false
skipunavailable: false
quietmode: 0
isoversize: false
isautoswitchedtoquietmode: false
"3":
id: "3"
taskid: c2ca1354-c0f9-43be-8316-a97e90103594
type: playbook
task:
id: c2ca1354-c0f9-43be-8316-a97e90103594
version: -1
name: GenericPolling
description: |-
Use this playbook as a sub-playbook to block execution of the master playbook until a remote action is complete.
This playbook implements polling by continuously running the command in Step \#2 until the operation completes.
The remote action should have the following structure:
1. Initiate the operation.
2. Poll to check if the operation completed.
3. (optional) Get the results of the operation.
playbookName: GenericPolling
type: playbook
iscommand: false
brand: ""
nexttasks:
'#none#':
- "4"
scriptarguments:
AdditionalPollingCommandArgNames:
simple: project,pipeline_id
AdditionalPollingCommandArgValues:
simple: ${inputs.Project Name},${inputs.Pipeline ID}
Ids:
complex:
root: AzureDevOps.PipelineRun
accessor: run_id
Interval:
interval:
complex:
root: inputs.interval
PollingCommandArgName:
simple: run_id
PollingCommandName:
simple: azure-devops-pipeline-run-get
Timeout:
timeout:
complex:
root: inputs.Timeout
dt:
simple: AzureDevOps.PipelineRun(val.state!=='completed').run_id
separatecontext: true
loop:
iscommand: false
exitCondition: ""
wait: 1
max: 0
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 720
"x": 162.5,
"y": 370
}
}
note: false
Expand All @@ -182,6 +126,7 @@ tasks:
quietmode: 0
isoversize: false
isautoswitchedtoquietmode: false
continueonerrortype: ""
"4":
id: "4"
taskid: 28edb4ce-1718-4e2f-80fa-0fbac12fec8d
Expand Down Expand Up @@ -214,7 +159,7 @@ tasks:
{
"position": {
"x": 162.5,
"y": 895
"y": 790
}
}
note: false
Expand All @@ -224,6 +169,7 @@ tasks:
quietmode: 0
isoversize: false
isautoswitchedtoquietmode: false
continueonerrortype: ""
"5":
id: "5"
taskid: 172877e1-d636-4b2a-8b3e-70dddf7ea585
Expand All @@ -241,7 +187,7 @@ tasks:
{
"position": {
"x": 162.5,
"y": 1070
"y": 990
}
}
note: false
Expand All @@ -251,6 +197,7 @@ tasks:
quietmode: 0
isoversize: false
isautoswitchedtoquietmode: false
continueonerrortype: ""
"6":
id: "6"
taskid: df1cb9bf-f569-40c6-8bda-fc4ec11ebe26
Expand All @@ -265,7 +212,7 @@ tasks:
brand: ""
nexttasks:
'#default#':
- "3"
- "5"
"yes":
- "4"
separatecontext: false
Expand Down Expand Up @@ -297,14 +244,15 @@ tasks:
quietmode: 0
isoversize: false
isautoswitchedtoquietmode: false
continueonerrortype: ""
view: |-
{
"linkLabelsPosition": {},
"paper": {
"dimensions": {
"height": 1085,
"width": 492.5,
"x": 50,
"height": 1005,
"width": 380,
"x": 162.5,
"y": 50
}
}
Expand Down Expand Up @@ -338,19 +286,18 @@ inputs:
value:
simple: "60"
required: true
description: The amount of time until the playbook stops waiting for the process
to finish. After this time has passed, the playbook finishes its run, even if
it didn't receive confirmation that the remote process completed.
description: The amount of time until the playbook stops waiting for the process to finish. After this time has passed, the playbook finishes its run, even if it didn't receive confirmation that the remote process completed.
playbookInputQuery:
outputs:
- contextPath: AzureDevOps.Project
description: The result of the search
description: The result of the search.
- contextPath: AzureDevOps.Project.Pipeline
description: AzureDevOps Pipeline Object
description: AzureDevOps Pipeline Object.
type: unknown
- contextPath: AzureDevOps.Project.Pipeline.Run
description: AzureDevOps Pipeling Run
description: AzureDevOps Pipeling Run.
type: unknown
tests:
- playbook-AzureDevOps-Test
- No tests (deprecated)
fromversion: 6.0.0
deprecated: true
50 changes: 50 additions & 0 deletions Packs/AzureDevOps/Playbooks/Azure-DevOps-Pipeline-Run_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Deprecated. Use azure-devops-pipeline-run command instead.

## Dependencies

This playbook uses the following sub-playbooks, integrations, and scripts.

### Sub-playbooks

This playbook does not use any sub-playbooks.

### Integrations

* AzureDevOps

### Scripts

This playbook does not use any scripts.

### Commands

* azure-devops-pipeline-run
* azure-devops-pipeline-run-get

## Playbook Inputs

---

| **Name** | **Description** | **Default Value** | **Required** |
| --- | --- | --- | --- |
| Project Name | The name of the pipeline project. | xsoar | Required |
| Pipeline ID | The ID of the pipeline. | 1 | Required |
| Branch Name | The name of the repository branch which runs the pipeline. | main | Required |
| interval | Indicates how long to wait between each poll. (In seconds) | 1 | Required |
| Timeout | The amount of time until the playbook stops waiting for the process to finish. After this time has passed, the playbook finishes its run, even if it didn't receive confirmation that the remote process completed. (In seconds) | 60 | Required |

## Playbook Outputs

---

| **Path** | **Description** | **Type** |
| --- | --- | --- |
| AzureDevOps.Project | The result of the search. | unknown |
| AzureDevOps.Project.Pipeline | AzureDevOps Pipeline Object. | unknown |
| AzureDevOps.Project.Pipeline.Run | AzureDevOps Pipeling Run. | unknown |

## Playbook Image

---

![Azure-DevOps-Pipeline-Run](../doc_files/Azure-DevOps-Pipeline-Run.png)
6 changes: 6 additions & 0 deletions Packs/AzureDevOps/ReleaseNotes/1_3_11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Playbooks

##### Azure-DevOps-Pipeline-Run

- Deprecated. Use azure-devops-pipeline-run command instead. The generic polling implemented as part of the integration.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Packs/AzureDevOps/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "AzureDevOps",
"description": "Create and manage Git repositories in Azure DevOps Services.",
"support": "xsoar",
"currentVersion": "1.3.10",
"currentVersion": "1.3.11",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
Loading

0 comments on commit 7ca7eeb

Please sign in to comment.