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

Updates and Fixes for WikiBots #55

Merged
merged 4 commits into from
Jan 28, 2019
Merged

Updates and Fixes for WikiBots #55

merged 4 commits into from
Jan 28, 2019

Conversation

sagepe
Copy link
Member

@sagepe sagepe commented Jan 18, 2019

The SignedJwtAssertionCredentials class was deprecated and removed from oauth2client some considerable time ago. This change uses the replacement and also updates the virtual environment's requirements file to reflect this.

See also sysadmin#858.

@sagepe sagepe requested a review from dracos January 18, 2019 12:49
We see errors from `wikibot-pipedrive` when run from cron due to the
presence of unicode characters that don't match the default encoding
for STDOUT, ASCII. Setting `PYTHONIOENCODING` ensures the encoding is
set correctly.
With more recent versions of MediaWiki and the Auth_remoteuser plugin
it seems this call to `site.login` generates an error which prevents
access. This is unnecessary as the user is being identified by the
HTTP authentication process.
@sagepe
Copy link
Member Author

sagepe commented Jan 18, 2019

I've updated this PR to include some additional changes:

  • Set PYTHONIOENCODING when running the Pipedrive bot to prevent encoding errors;
  • Remove a superfluous call to site.login from our MediaWiki library that generates errors on more recent versions of MediaWiki;
  • Splits the original commit into two separate commits, one for the code change and one fort he dependency list.

@sagepe sagepe changed the title Update Google Apps bot to use new oauth2client version Updates and Fixes for WikiBots Jan 18, 2019
@sagepe sagepe self-assigned this Jan 22, 2019
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

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

Couple of comments is all :)

wiki/bin/update-emails-google Outdated Show resolved Hide resolved
@@ -6,7 +6,7 @@ PATH=/usr/local/bin:/usr/bin:/bin
PYTHON=/data/vhost/!!(*= $vhost *)!!/virtualenv-wiki/bin/python

24 5 * * * !!(*= $user *)!! $PYTHON /data/vhost/!!(*= $vhost *)!!/internal/wiki/bin/wikibot-fixup.py
36 3 * * * !!(*= $user *)!! $PYTHON /data/vhost/!!(*= $vhost *)!!/internal/wiki/bin/wikibot-pipedrive.py
36 3 * * * !!(*= $user *)!! export PYTHONIOENCODING=utf-8; $PYTHON /data/vhost/!!(*= $vhost *)!!/internal/wiki/bin/wikibot-pipedrive.py
Copy link
Member

Choose a reason for hiding this comment

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

Better solution would be to use python3 instead ;-)

Copy link
Member Author

Choose a reason for hiding this comment

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

No doubt you are right, but I think I'd like to get this change in for now so that it runs - there are a couple of issues covering more detailed improvements (e.g. #38 and #39), so perhaps we can revisit this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe I'll have a chat with @jacksonj04 about revisiting #40.

The `SignedJwtAssertionCredentials` class was deprecated and removed
from `oauth2client` some considerable time ago. This change uses the
replacement `ServiceAccountCredentials` construct.
Updated `requirements.txt` for the wiki that includes a newer version
of the `oauth2client` package.
@sagepe
Copy link
Member Author

sagepe commented Jan 28, 2019

I'm going to merge this - this gets everything running then we can then work on the wider improvements in dedicated issues.

@sagepe sagepe merged commit de232b9 into master Jan 28, 2019
@sagepe sagepe deleted the google-oauth-client-update branch January 28, 2019 11:10
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