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

Attempt at example for logging consistency for discussion #1221

Merged
merged 20 commits into from Nov 26, 2019
Merged

Attempt at example for logging consistency for discussion #1221

merged 20 commits into from Nov 26, 2019

Conversation

iguyking
Copy link
Contributor

An quick run of connectors with a shot at rules around logging consistency.

Description

A quick run against connectors tree with a shot at something that might be useful for documenting consistency in logging.

Fixes #1137

Status

UNDER DEVELOPMENT

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update
  • Documentation (fix or adds documentation)

How Has This Been Tested?

Basic documentation updates effectively. Should not be breaking type of changes unless there is some kind of width restriction concern for a given connector. Most of my changes reduced the general length of the messages, with a couple just adding a character or two.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

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

Thanks for raising this, it's great!

I'm especially pleased to see you add a section to the contributing docs.

I've added a few comments that I'd like you to address.

docs/contributing.md Show resolved Hide resolved
docs/contributing.md Show resolved Hide resolved
docs/contributing.md Outdated Show resolved Hide resolved
@jacobtomlinson
Copy link
Member

Would also be good to get eyes from @opsdroid/maintainers on this.

Copy link
Member

@FabioRosado FabioRosado left a comment

Choose a reason for hiding this comment

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

I've already given my feedback on the punctuation issue. I've also noticed something on the log messages when they are split (this was done before we used black).

Also we should keep in mind that whatever changes we do to the logs message we will need to update all the translations otherwise they will stop working.

@codecov
Copy link

codecov bot commented Nov 3, 2019

Codecov Report

Merging #1221 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1221   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          51      51           
  Lines        2775    2775           
======================================
  Hits         2775    2775
Impacted Files Coverage Δ
opsdroid/matchers.py 100% <ø> (ø) ⬆️
opsdroid/connector/github/__init__.py 100% <100%> (ø) ⬆️
opsdroid/connector/facebook/__init__.py 100% <100%> (ø) ⬆️
opsdroid/connector/webexteams/__init__.py 100% <100%> (ø) ⬆️
opsdroid/web.py 100% <100%> (ø) ⬆️
opsdroid/connector/rocketchat/__init__.py 100% <100%> (ø) ⬆️
opsdroid/parsers/luisai.py 100% <100%> (ø) ⬆️
opsdroid/parsers/dialogflow.py 100% <100%> (ø) ⬆️
opsdroid/parsers/rasanlu.py 100% <100%> (ø) ⬆️
opsdroid/cli/utils.py 100% <100%> (ø) ⬆️
... and 16 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 473b540...cd04520. Read the comment docs.

@iguyking
Copy link
Contributor Author

Thoughts on the shift here @opsdroid/maintainers?

Copy link
Member

@FabioRosado FabioRosado left a comment

Choose a reason for hiding this comment

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

Hello @iguyking sorry for taking so long to check this PR. I've added a few comments and suggestions (you can easily just click the button to commit these to your PR).

All the rest I'm pretty happy with it. We just need to update all the translated catalogs. Do you know how to do this or would you like me to explain?

opsdroid/connector/github/__init__.py Outdated Show resolved Hide resolved
opsdroid/connector/slack/__init__.py Show resolved Hide resolved
opsdroid/connector/telegram/__init__.py Outdated Show resolved Hide resolved
opsdroid/connector/telegram/__init__.py Outdated Show resolved Hide resolved
opsdroid/connector/telegram/__init__.py Outdated Show resolved Hide resolved
opsdroid/connector/telegram/__init__.py Outdated Show resolved Hide resolved
opsdroid/core.py Outdated Show resolved Hide resolved
@jacobtomlinson
Copy link
Member

@iguyking are you able to pick this up again?

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

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

This looks good. Thanks for all the effort here. I'm sure we could nitpick forever with this one so I'm keen to just get it merged. We can always continue to iterate on this later.

Some future steps we may consider:

  • Ensure all translations still work while we've updated these strings
  • Maybe add some tests to enforce the format?

@FabioRosado
Copy link
Member

If you need help with updating the translations you can check the documentation on localization. I haven't tried to update the translations yet but I think you can just run the command:

python setup.py update_catalog

then compile them with the command: python setup.py compile_catalog

This should be enough, if you have any issue let me us know 😄

@jacobtomlinson
Copy link
Member

Looks like we've still got a failing test here that is looking for a specific log message (that now has a period at the end and doesn't match).

Also black needs to be run.

@iguyking could you fix this couple of issues so we get a green tick and can merge?

@iguyking
Copy link
Contributor Author

@opsdroid/maintainers Fixed for the appveyor and travis-ci passing now. Couple fixes around a test case and cleaning up more logging along with associated documentation. Anything else?

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

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

Some code was removed/moved in another PR that has been merged. This PR seems to be reinstating the code (maybe due to a bad merge conflict resolution) and therefore the coverage is failing as the tests have also been removed.

@FabioRosado could you confirm that the sections I've commented on have been removed and should also be removed here?

(Sorry about this @iguyking, we are so close to merging!)

opsdroid/loader.py Outdated Show resolved Hide resolved
opsdroid/helper.py Outdated Show resolved Hide resolved
@FabioRosado
Copy link
Member

Yeah I can confirm that those bits where the ones I have either moved to configuration or removed it from the codebase

@jacobtomlinson
Copy link
Member

Thanks @FabioRosado. I don't seem to be able to push onto this branch. @iguyking could you please delete the sections of code I highlighted and push again?

@jacobtomlinson jacobtomlinson merged commit 8d36a33 into opsdroid:master Nov 26, 2019
@jacobtomlinson
Copy link
Member

Thanks fo much for your patience here @iguyking! Glad to finally get this in.

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.

Inconsistency in the logging messages
3 participants