-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
[AIRFLOW-1526] Add dingding hook and operator #4895
Conversation
Do you think it is a good idea to allow tokens to be passed as an operator parameter? For me it is not safe. Similar comment from today: https://github.com/apache/airflow/pull/4891/files#r264048383 |
@mik-laj This PR have to way to pass token, One is pass token by |
I know there are two ways but I think one of them is not safe and should not be supported. First, security should be a standard, not an option to choose from. people are too lazy and therefore do not make good choices about security. Second, the code of operators that is in the core is used to learning and therefore it should not have security flaws. I develop a operators for GCP Transfer Service. and I intentionally blocked the passing of passwords as parameters to limit the misuse of the operator. |
@mik-laj Ok, your right, I will remove pass token from operator. do you think I should add some docs to describe in |
The implementation is a bit tricky to me. It's dependent on the Dingtalk's single API endpoint (https://oapi.dingtalk.com). The scope of this PR itself is similar to Slack-related hooks/operators. However, they were implemented on top of |
@XD-DENG we have a two hooks for Slack :-) Look at https://github.com/apache/airflow/blob/master/airflow/contrib/hooks/slack_webhook_hook.py. |
@zhongjiajie The howto documentation is recommended, but not required. If you have the time and desire then I will be happy when you write.
Good example is: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-example-creating-buckets.html Fragment of the code should be attached using the Currently, the guides do not contain all sections, but I plan to develop them. |
@XD-DENG slack have officail client, but dingtalk not, as @mik-laj said we have two slack hook, one is base on |
a961a9d
to
7956d0f
Compare
CI failed unrelated |
e7cfb72
to
aeb055a
Compare
aeb055a
to
965d8c8
Compare
1c54cbb
to
fd7c2e5
Compare
Codecov Report
@@ Coverage Diff @@
## master #4895 +/- ##
==========================================
- Coverage 75.81% 75.69% -0.13%
==========================================
Files 458 461 +3
Lines 29882 29935 +53
==========================================
+ Hits 22655 22658 +3
- Misses 7227 7277 +50
Continue to review full report at Codecov.
|
5d2d7d9
to
ccb4f21
Compare
I edited the docs a bit directly on your branch to improve the English a bit (some of the tenses and plurals were a bit wrong) and to update the instructions about setting up the hook: 19133bc (We don't need to set the host anymore do we?) |
@ashb Thank for you improvement. About the |
BTW, I am trying improve my English recently 😭 |
Sounds good. |
So should I revert describe in https://github.com/apache/airflow/pull/4895/files#diff-a46bd26d7b5231c209f6fa37d2622cc5R29 to tell user could pass |
Not revert, but say something like "if you need to change the host used you can set the host field of the connection". (Most people wont need to do this, so the docs shouldn't imply its a required step) |
I update this PR, PTAL, Thanks. |
f877fcc
to
6c914de
Compare
@ashb PTAL, |
@zhongjiajie Could you rebase please? |
Dingding is popular team collaboration tools talk just like Slack. This PR is add it to master, could help us easy send message to Dingding. Change db.py add conn dingding_webhook_default, could easy configure dingding message due the host is constant Add how to operator dingding section tell users how to send different kind of dingding message or how to use dingding as callback funtion in DAG and add example to show how to use. Set operator UI color as dingding icon color
6c914de
to
372c6ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -28,6 +28,7 @@ information. | |||
.. toctree:: | |||
:maxdepth: 2 | |||
|
|||
python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabetical order operator
@ashb Thanks. |
@ashb FYI, CI green |
BTW, could we cherry-pick this PR to 1.10.3 ? |
Dingding is popular team collaboration tools talk just like Slack. This PR is add it to master, could help us easy send message to Dingding. Add how to operator dingding section tell users how to send different kind of dingding message or how to use dingding as callback funtion in DAG and add example to show how to use. Set operator UI color as dingding icon color
@ashb Thanks 👍 |
Dingding is popular team collaboration tools talk just like Slack. This PR is add it to master, could help us easy send message to Dingding. Add how to operator dingding section tell users how to send different kind of dingding message or how to use dingding as callback funtion in DAG and add example to show how to use. Set operator UI color as dingding icon color
Dingding is popular team collaboration tools talk just like Slack. This PR is add it to master, could help us easy send message to Dingding. Add how to operator dingding section tell users how to send different kind of dingding message or how to use dingding as callback funtion in DAG and add example to show how to use. Set operator UI color as dingding icon color
Dingding is popular team collaboration tools talk just like Slack. This PR is add it to master, could help us easy send message to Dingding. Add how to operator dingding section tell users how to send different kind of dingding message or how to use dingding as callback funtion in DAG and add example to show how to use. Set operator UI color as dingding icon color
Dingding is popular team collaboration tools talk
just like Slack. This PR is add it to master, could
help us easy send message to Dingding.
Change db.py add conn dingding_webhook_default, could
easy configure dingding message due the host is constant
Add how to operator dingding section tell users
how to send different kind of dingding message or
how to use dingding as callback funtion in DAG
and add example to show how to use.
Set operator UI color as dingding icon color
Make sure you have checked all steps below.
Jira
Description
Add dingding (popular team collaboration tools in China) hook and operator to master,
Tests
Commits
Documentation
Code Quality
flake8