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

Add ChimeWebhookHook #31939

Merged
merged 34 commits into from
Jun 27, 2023
Merged

Add ChimeWebhookHook #31939

merged 34 commits into from
Jun 27, 2023

Conversation

cjames23
Copy link
Contributor

@cjames23 cjames23 commented Jun 15, 2023

Creating a Hook to call a Chime Web Hook. This is preliminary work to be able to enable Chime notifications similar to #31273


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg
Copy link

boring-cyborg bot commented Jun 15, 2023

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

Copy link
Contributor

@o-nikolas o-nikolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! Thanks for the contribution Cary!

You can install pre-commit and enable it for commit/push in airflow to catch the static check failures (docs). You can also run the docs build locally too for just the Amazon provider package to iterate on those build failures (breeze build-docs --package-filter apache-airflow-providers-amazon)

airflow/providers/amazon/aws/hooks/chime.py Show resolved Hide resolved
airflow/providers/amazon/aws/hooks/chime.py Outdated Show resolved Hide resolved
airflow/providers/amazon/aws/hooks/chime.py Show resolved Hide resolved
airflow/providers/amazon/aws/hooks/chime.py Outdated Show resolved Hide resolved
airflow/providers/amazon/aws/hooks/chime.py Outdated Show resolved Hide resolved
airflow/providers/amazon/aws/hooks/chime.py Outdated Show resolved Hide resolved
airflow/providers/amazon/aws/hooks/chime.py Outdated Show resolved Hide resolved
airflow/providers/amazon/aws/hooks/chime.py Outdated Show resolved Hide resolved
airflow/providers/amazon/aws/hooks/chime.py Outdated Show resolved Hide resolved
@potiuk
Copy link
Member

potiuk commented Jun 26, 2023

Hey @cjames23 -> you need to update breeze selective tests. Apparently the change caused changes in dependencies between providers: https://github.com/apache/airflow/pull/31939/files#diff-e1c023651fed5dc86ec9d3303308052dd32afa65a80bfbc6d6c4554d9aae7c1d -> so expected output of seme selective check tests should be updated to match it.

Basically "http" provider is seen as affected when any of the amazon code is changed, so needs to be added to the lists that are verified during tests.

@cjames23
Copy link
Contributor Author

@potiuk is there a way to run selective checks locally with breeze? If I try to run it with pytest inside the breeze container I get an import error.

ImportError while importing test module '/opt/airflow/dev/breeze/tests/test_selective_checks.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.8/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/local/lib/python3.8/site-packages/_pytest/pathlib.py:565: in import_path
    importlib.import_module(module_name)
/usr/local/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
/usr/local/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
    exec(co, module.__dict__)
test_selective_checks.py:24: in <module>
    from airflow_breeze.global_constants import COMMITTERS, GithubEvents
E   ModuleNotFoundError: No module named 'airflow_breeze'

I want to test if for http do I need to set run-amazon-tests to true rather than false based on the latest error I am seeing from the last attempted run.

@eladkal eladkal changed the title Create ChimeWebhook Hook to send messages to chime room from Airflow. Add ChimeWebhookHook Jun 26, 2023
@eladkal eladkal merged commit 10df743 into apache:main Jun 27, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jun 27, 2023

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@ferruzzi
Copy link
Contributor

Nice! Congrats.

ferruzzi pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jun 27, 2023
* Create ChimeWebhook Hook to send messages to chime room from Airflow.

---------

Co-authored-by: Beata Kossakowska <109511937+bkossakowska@users.noreply.github.com>
Co-authored-by: Beata Kossakowska <bkossakowska@google.com>
Co-authored-by: eladkal <45845474+eladkal@users.noreply.github.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
@cjames23 cjames23 deleted the chime-webhook-feature branch June 28, 2023 01:15
@ephraimbuddy ephraimbuddy added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) provider:amazon-aws AWS/Amazon - related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants