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

Fix missing dag parameter in Slack notification #5341

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dhruvkb
Copy link
Member

@dhruvkb dhruvkb commented Jan 21, 2025

Description

This PR fixes the bug with missing dag param when notify_slack is invoked as a function.

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (ov just catalog/generate-docs for catalog
    PRs) or the media properties generator (ov just catalog/generate-docs media-props
    for the catalog or ov just api/generate-docs for the API) where applicable.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@dhruvkb dhruvkb added 🟧 priority: high Stalls work on the project or its dependents 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository 🧱 stack: catalog Related to the catalog and Airflow DAGs labels Jan 21, 2025
@dhruvkb dhruvkb requested a review from a team as a code owner January 21, 2025 12:01
@dhruvkb dhruvkb requested review from krysal and obulat and removed request for a team January 21, 2025 12:01
@obulat obulat requested a review from a team as a code owner January 21, 2025 12:50
Copy link

github-actions bot commented Jan 21, 2025

Latest k6 run output1

     ✓ status was 200

     checks.........................: 100.00% ✓ 400      ✗ 0   
     data_received..................: 93 MB   385 kB/s
     data_sent......................: 52 kB   217 B/s
     http_req_blocked...............: avg=42.81µs  min=2.37µs   med=4.98µs   max=754.27µs p(90)=161.08µs p(95)=230.28µs
     http_req_connecting............: avg=29µs     min=0s       med=0s       max=701.33µs p(90)=111.95µs p(95)=175.61µs
     http_req_duration..............: avg=171.54ms min=19.74ms  med=105.74ms max=1.11s    p(90)=393.83ms p(95)=511.73ms
       { expected_response:true }...: avg=171.54ms min=19.74ms  med=105.74ms max=1.11s    p(90)=393.83ms p(95)=511.73ms
   ✓ http_req_failed................: 0.00%   ✓ 0        ✗ 400 
     http_req_receiving.............: avg=180.32µs min=51.4µs   med=153.79µs max=639.79µs p(90)=284.58µs p(95)=343.28µs
     http_req_sending...............: avg=26.87µs  min=7.16µs   med=24.09µs  max=141.31µs p(90)=40.01µs  p(95)=47.86µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=171.33ms min=19.55ms  med=105.6ms  max=1.11s    p(90)=393.41ms p(95)=511.48ms
     http_reqs......................: 400     1.662519/s
     iteration_duration.............: avg=922.11ms min=240.99ms med=966.32ms max=1.97s    p(90)=1.22s    p(95)=1.62s   
     iterations.....................: 75      0.311722/s
     vus............................: 0       min=0      max=6 
     vus_max........................: 60      min=60     max=60

Footnotes

  1. This comment will automatically update with new output each time k6 runs for this PR

@dhruvkb
Copy link
Member Author

dhruvkb commented Jan 21, 2025

Thanks @obulat!

@dhruvkb
Copy link
Member Author

dhruvkb commented Jan 21, 2025

How would we test it first before merging this PR?

@krysal
Copy link
Member

krysal commented Jan 21, 2025

How would we test it first before merging this PR?

@dhruvkb To run the DAG locally, set these environment variables:

AIRFLOW_CONN_AWS_S3_ENVFILE_ROTATION=aws://<user_id>:<secret>@/?region_name=us-east-1
AIRFLOW_VAR_S3_ENVFILE_ROTATION_AWS_CONN_ID=aws_s3_envfile_rotation
# Find the connection URL to the `#openverse-alerts-in-development` channel in the secret store.
AIRFLOW_CONN_SLACK_NOTIFICATIONS=https://hooks.slack.com/services/...

We should probably add these as instructions to the docstring because it can be difficult to guess otherwise. It took me a while to realize when I was testing it the first time.

Copy link
Member

@krysal krysal left a comment

Choose a reason for hiding this comment

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

I tested it, and it works great! Thanks. I made a slight improvement in the task involved. Take it or feel free to leave it as is currently.

catalog/dags/maintenance/rotate_envfiles.py Outdated Show resolved Hide resolved
Copy link

Playwright failure test results: https://github.com/WordPress/openverse/actions/runs/12894308773

It looks like some of the Playwright tests failed. If you made changes to the frontend UI without updating snapshots, this might be the cause. You can download zipped patches containing the updated snapshots alongside a general trace of the tests under the "Artifacts" section in the above page. They're named in the form *_snapshot_diff and *_test_results respectively.

You can read more on how to use these artifacts in the docs.

If the test is flaky, follow the flaky test triage procedure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents 🧱 stack: catalog Related to the catalog and Airflow DAGs
Projects
Status: ✅ Approved
Development

Successfully merging this pull request may close these issues.

3 participants