You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/README.md
+70-15Lines changed: 70 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,17 +3,21 @@ The "on_failure_actions" plugin listens to the DAGs run results and takes action
3
3
## Pre-requisites:
4
4
To leverage the "on_failure_actions" plugin, ensure the following conditions are met:
5
5
6
-
### 1. **DAG Opt-In:**
6
+
### 1. **DAG Opt-In:**
7
7
Each DAG intended to utilize this feature **must include the `"on_failure_alert"` tag** within its DAG definition. DAGs without this specific tag will be ignored by the plugin's failure-handling logic, and no GitHub issue will be filed for their failures.
8
8
9
9
with DAG(
10
10
dag_id='my_critical_dag',
11
11
# ... other DAG parameters ...
12
-
tags=['data_ingestion', 'critical', 'on_failure_alert'], # <--- Add this tag
12
+
tags = [
13
+
'data_ingestion',
14
+
'critical',
15
+
'on_failure_alert' # <--- Add this tag
16
+
],
13
17
) as dag:
14
18
# ... tasks ...
15
19
16
-
### 2. **GitHub Owner Mapping:**
20
+
### 2. **GitHub Owner Mapping:**
17
21
For accurate issue assignment, ensure that the `owner` property defined for tests within your DAGs corresponds directly to valid **GitHub usernames**. The plugin will collect unique test owners from the failed DAG and attempt to assign the GitHub issue to these users.
18
22
19
23
#### Example task definition
@@ -29,20 +33,71 @@ For accurate issue assignment, ensure that the `owner` property defined for test
29
33
def task_a():
30
34
pass
31
35
36
+
### 2.5 **GitHub Owner Mapping for Test Config:**
37
+
If you are using test_config.py in your DAG, you should fill test_owner attribute with your GitHub username
test_owner='github_username_here', # This should be a valid GitHub username
48
+
).run()
49
+
32
50
## Configuration and Installation:
51
+
### Create a GitHub APP
52
+
Refer to this [procedure](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app) to register a GitHub App.
53
+
54
+
- Give the app a unique name, for example "ml-auto-solutions-app", and record it as "APP_ID".
55
+
- Choose "Issues" for the "Repository permissions".
56
+
- Install it to the Target GitHub Repo (ml-auto-solutions). Record the "INSTALLATION_ID" from the web URL. For example, if the URL is https://github.com/apps/ml-auto-solutions-app/installations/78297659, then 78297659 is the INSTALLATION_ID.
57
+
- Create a private key and record it as PRIVATE_KEY.
58
+
59
+
The APP_ID, INSTALLATION_ID, and PRIVATE_KEY will be used in the next steps.
60
+
61
+
### Set up via GCP console UI
33
62
1. From GCP console UI, Your Composer Env -> Tab -> Pypi packages -> Edit -> Add 'apache-airflow-providers-github' -> Save
34
63
35
-
2. From GCP console UI, search for "Secret Manager", and add conn_id 'github_default' into Secret Manager.
0 commit comments