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 an edit and remove button when nutriscore prediction is posted on Slack channel #783

Merged
merged 22 commits into from
Jun 11, 2022

Conversation

Jagrutiti
Copy link
Member

Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

👏 well done @Jagrutiti

You only have to lint + change the title of your PR :-)

Lets merge this one and go ahead with next feature !

robotoff/slack.py Outdated Show resolved Hide resolved
@Jagrutiti Jagrutiti changed the title Added edit button and wrote test case to test the same Add an edit and remove button when nutriscore prediction is posted on Slack channel Jun 4, 2022
@Jagrutiti Jagrutiti marked this pull request as ready for review June 4, 2022 14:10
@Jagrutiti Jagrutiti requested a review from a team as a code owner June 4, 2022 14:10
robotoff/models.py Outdated Show resolved Hide resolved
robotoff/slack.py Outdated Show resolved Hide resolved
tests/unit/test_slack.py Outdated Show resolved Hide resolved
robotoff/slack.py Outdated Show resolved Hide resolved
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

@Jagrutiti thanks for your work. Still some changes necessary, but we never were so close to the end ;-)

tests/unit/test_slack.py Outdated Show resolved Hide resolved
tests/unit/test_slack.py Outdated Show resolved Hide resolved
tests/unit/test_slack.py Outdated Show resolved Hide resolved
robotoff/models.py Show resolved Hide resolved
tests/unit/test_slack.py Outdated Show resolved Hide resolved
)
)

mock.assert_called_once_with(
notifier.POST_MESSAGE_URL,
data=PartialRequestMatcher(
f"The `en:vegan` label was automatically added to product 123 (<https://world.{settings._robotoff_domain}/product/123|product>, <{settings.OFF_IMAGE_BASE_URL}/image/1|source image>)",
f"The `en:vegan` label was automatically added to product 123 (<https://world.{settings._robotoff_domain}/product/123|product>, <https://robotoff.{settings._robotoff_domain}/api/v1/images/crop?image_url={settings.OFF_IMAGE_BASE_URL}/image/1&y_min=2&x_min=2&y_max=4&x_max=4|source image>)",
Copy link
Member

Choose a reason for hiding this comment

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

This should not change, you restored the test, so there should be non crop any more

@codecov
Copy link

codecov bot commented Jun 11, 2022

Codecov Report

Merging #783 (fb98e7a) into master (1e63ca2) will increase coverage by 6.26%.
The diff coverage is 69.09%.

@@            Coverage Diff             @@
##           master     #783      +/-   ##
==========================================
+ Coverage   44.73%   51.00%   +6.26%     
==========================================
  Files          96       92       -4     
  Lines        6981     6772     -209     
==========================================
+ Hits         3123     3454     +331     
+ Misses       3858     3318     -540     
Impacted Files Coverage Δ
robotoff/cli/batch.py 0.00% <ø> (ø)
robotoff/cli/insights.py 0.00% <0.00%> (ø)
robotoff/insights/dataclass.py 100.00% <ø> (ø)
robotoff/prediction/ocr/brand.py 68.62% <0.00%> (ø)
robotoff/prediction/ocr/expiration_date.py 25.71% <ø> (ø)
robotoff/prediction/ocr/label.py 72.30% <0.00%> (ø)
robotoff/prediction/ocr/product_weight.py 49.10% <0.00%> (+1.28%) ⬆️
robotoff/products.py 41.51% <ø> (+1.02%) ⬆️
robotoff/workers/listener.py 0.00% <0.00%> (ø)
robotoff/metrics.py 23.61% <10.00%> (-2.20%) ⬇️
... and 53 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34f786b...fb98e7a. Read the comment docs.

@alexgarel alexgarel merged commit 0055ba7 into openfoodfacts:master Jun 11, 2022
@alexgarel
Copy link
Member

@Jagrutiti I merged though test didn't pass but, I will fix with another PR (Sonar seems unable to run on an external repository PR). Please, makes your next PRs directly from this repository (not from your own).

@Jagrutiti
Copy link
Member Author

Please, makes your next PRs directly from this repository (not from your own).

I will need to remember that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants