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

chore: user config in notifications #600

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

giovanni-guidini
Copy link
Contributor

@giovanni-guidini giovanni-guidini commented Aug 8, 2024

These changes hide away the current_yaml from the Contexts.
The original idea was to not expose it, but I didn't do that detail correctly the 1st time.
Now it's hidden behind the user_config field. Builders still have full access.

The user_config field parses the config that will be used for commit statuses,
and also the config already used for the PR comment required changes.

Notice that we have 2 seemingly redundant options with changes_threshold and
required_changes_threshold. Still waiting on design to clean that up,
but they are technically different things at this time:

  • required_changes_threshold is the threshold to send the comment;
  • changes_threshold is the threshold to fail status checks
    If they remain separate one of them will be renamed :E

@codecov-notifications
Copy link

codecov-notifications bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 98.43750% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files Patch % Lines
services/bundle_analysis/new_notify/helpers.py 92.30% 1 Missing ⚠️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #600   +/-   ##
=======================================
  Coverage   97.59%   97.59%           
=======================================
  Files         431      431           
  Lines       36096    36147   +51     
=======================================
+ Hits        35229    35279   +50     
- Misses        867      868    +1     
Flag Coverage Δ
integration 97.59% <98.43%> (+<0.01%) ⬆️
latest-uploader-overall 97.59% <98.43%> (+<0.01%) ⬆️
unit 97.59% <98.43%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.80% <97.67%> (+<0.01%) ⬆️
OutsideTasks 97.82% <98.43%> (+<0.01%) ⬆️
Files Coverage Δ
...es/bundle_analysis/new_notify/contexts/__init__.py 98.91% <100.00%> (+0.16%) ⬆️
...ces/bundle_analysis/new_notify/contexts/comment.py 98.48% <100.00%> (ø)
...nalysis/new_notify/contexts/tests/test_contexts.py 100.00% <100.00%> (ø)
...analysis/new_notify/messages/tests/test_comment.py 100.00% <100.00%> (ø)
...s/bundle_analysis/new_notify/tests/test_helpers.py 100.00% <100.00%> (ø)
...e_analysis/new_notify/tests/test_notify_service.py 100.00% <100.00%> (ø)
services/bundle_analysis/new_notify/types.py 100.00% <100.00%> (ø)
services/bundle_analysis/new_notify/helpers.py 98.03% <92.30%> (-1.97%) ⬇️

@codecov-qa
Copy link

codecov-qa bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 98.43750% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.59%. Comparing base (8fdff97) to head (9611ce2).

✅ All tests successful. No failed tests found.

Files Patch % Lines
services/bundle_analysis/new_notify/helpers.py 92.30% 1 Missing ⚠️

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #600   +/-   ##
=======================================
  Coverage   97.59%   97.59%           
=======================================
  Files         431      431           
  Lines       36096    36147   +51     
=======================================
+ Hits        35229    35279   +50     
- Misses        867      868    +1     
Flag Coverage Δ
integration 97.59% <98.43%> (+<0.01%) ⬆️
latest-uploader-overall 97.59% <98.43%> (+<0.01%) ⬆️
unit 97.59% <98.43%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.80% <97.67%> (+<0.01%) ⬆️
OutsideTasks 97.82% <98.43%> (+<0.01%) ⬆️
Files Coverage Δ
...es/bundle_analysis/new_notify/contexts/__init__.py 98.91% <100.00%> (+0.16%) ⬆️
...ces/bundle_analysis/new_notify/contexts/comment.py 98.48% <100.00%> (ø)
...nalysis/new_notify/contexts/tests/test_contexts.py 100.00% <100.00%> (ø)
...analysis/new_notify/messages/tests/test_comment.py 100.00% <100.00%> (ø)
...s/bundle_analysis/new_notify/tests/test_helpers.py 100.00% <100.00%> (ø)
...e_analysis/new_notify/tests/test_notify_service.py 100.00% <100.00%> (ø)
services/bundle_analysis/new_notify/types.py 100.00% <100.00%> (ø)
services/bundle_analysis/new_notify/helpers.py 98.03% <92.30%> (-1.97%) ⬇️

Copy link

codecov-public-qa bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 98.43750% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.59%. Comparing base (8fdff97) to head (9611ce2).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #600   +/-   ##
=======================================
  Coverage   97.59%   97.59%           
=======================================
  Files         431      431           
  Lines       36096    36147   +51     
=======================================
+ Hits        35229    35279   +50     
- Misses        867      868    +1     
Flag Coverage Δ
integration 97.59% <98.43%> (+<0.01%) ⬆️
latest-uploader-overall 97.59% <98.43%> (+<0.01%) ⬆️
unit 97.59% <98.43%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.80% <97.67%> (+<0.01%) ⬆️
OutsideTasks 97.82% <98.43%> (+<0.01%) ⬆️
Files Coverage Δ
...es/bundle_analysis/new_notify/contexts/__init__.py 98.91% <100.00%> (+0.16%) ⬆️
...ces/bundle_analysis/new_notify/contexts/comment.py 98.48% <100.00%> (ø)
...nalysis/new_notify/contexts/tests/test_contexts.py 100.00% <100.00%> (ø)
...analysis/new_notify/messages/tests/test_comment.py 100.00% <100.00%> (ø)
...s/bundle_analysis/new_notify/tests/test_helpers.py 100.00% <100.00%> (ø)
...e_analysis/new_notify/tests/test_notify_service.py 100.00% <100.00%> (ø)
services/bundle_analysis/new_notify/types.py 100.00% <100.00%> (ø)
services/bundle_analysis/new_notify/helpers.py 98.03% <92.30%> (-1.97%) ⬇️

Copy link

codecov bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 98.43750% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.63%. Comparing base (8fdff97) to head (9611ce2).

✅ All tests successful. No failed tests found.

Files Patch % Lines
services/bundle_analysis/new_notify/helpers.py 92.30% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #600   +/-   ##
=======================================
  Coverage   97.63%   97.63%           
=======================================
  Files         466      466           
  Lines       37302    37353   +51     
=======================================
+ Hits        36421    36471   +50     
- Misses        881      882    +1     
Flag Coverage Δ
integration 97.59% <98.43%> (+<0.01%) ⬆️
latest-uploader-overall 97.59% <98.43%> (+<0.01%) ⬆️
unit 97.59% <98.43%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.87% <97.67%> (+<0.01%) ⬆️
OutsideTasks 97.82% <98.43%> (+<0.01%) ⬆️
Files Coverage Δ
...es/bundle_analysis/new_notify/contexts/__init__.py 98.91% <100.00%> (+0.16%) ⬆️
...ces/bundle_analysis/new_notify/contexts/comment.py 98.48% <100.00%> (ø)
...nalysis/new_notify/contexts/tests/test_contexts.py 100.00% <100.00%> (ø)
...analysis/new_notify/messages/tests/test_comment.py 100.00% <100.00%> (ø)
...s/bundle_analysis/new_notify/tests/test_helpers.py 100.00% <100.00%> (ø)
...e_analysis/new_notify/tests/test_notify_service.py 100.00% <100.00%> (ø)
services/bundle_analysis/new_notify/types.py 100.00% <100.00%> (ø)
services/bundle_analysis/new_notify/helpers.py 98.03% <92.30%> (-1.97%) ⬇️

This change has been scanned for critical changes. Learn more

@giovanni-guidini giovanni-guidini force-pushed the gio/refactor/ba-notifier/service branch from 06e6e73 to 91fdbec Compare August 8, 2024 14:50
@giovanni-guidini giovanni-guidini force-pushed the gio/bs-commit-status/notification-settings branch from 7704236 to 7e7277c Compare August 8, 2024 14:50
Base automatically changed from gio/refactor/ba-notifier/service to main August 9, 2024 09:32
@giovanni-guidini giovanni-guidini force-pushed the gio/bs-commit-status/notification-settings branch 3 times, most recently from 895487a to 08cd3d9 Compare August 9, 2024 12:39
@giovanni-guidini giovanni-guidini requested a review from a team August 9, 2024 12:39
requirements.in Outdated
@@ -1,3 +1,4 @@
https://github.com/codecov/shared/archive/1ab8ac9b8875ee2da8b473033772c2377f09bf95.tar.gz#egg=shared
Copy link
Contributor

Choose a reason for hiding this comment

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

this line is duplicated

These changes hide away the current_yaml from the Contexts.
The original idea was to not expose it, but I didn't do that detail correctly the 1st time.
Not it's hidden behind the `user_config` field. Builders still have full access.

The `user_config` field parses the config that will be used for commit statuses,
and also the config already used for the PR comment required changes.

There are 2 similar but different configurations:
* `required_changes_threshold` is the threshold to send the comment;
* `warning_threshold` is the threshold to fail status checks (emit warning by default)
@giovanni-guidini giovanni-guidini force-pushed the gio/bs-commit-status/notification-settings branch from 1946182 to 9611ce2 Compare August 13, 2024 09:10
@giovanni-guidini giovanni-guidini added this pull request to the merge queue Aug 13, 2024
Merged via the queue into main with commit 5324736 Aug 13, 2024
25 of 26 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/bs-commit-status/notification-settings branch August 13, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants