Opened 5 months ago

Last modified 5 months ago

#68873 new enhancement

Periodically refresh user data from GitHub

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: admin@…
Priority: Normal Milestone:
Component: trac Version:
Keywords: Cc:
Port:

Description

How often is a user's real name, which is displayed on Trac and stored in its database, refreshed from the user's GitHub account? If the answer is never, it should be done periodically. If it is already done periodically, it should be done more frequently. People sometimes change their names due to marriage, personal preference, etc. and we shouldn't be displaying stale information on Trac for too long.

The same question might apply to the user's email address(es).

Change History (3)

comment:1 Changed 5 months ago by jmroot (Joshua Root)

One problem is that you can update your details on Trac manually, so there would at least need to be a "manually edited" flag stored so further updates from GitHub can be skipped.

comment:2 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

Oh! I forgot that existed. That solves my immediate problem anyway.

comment:3 Changed 5 months ago by neverpanic (Clemens Lang)

We don't refresh those unless they aren't set:

https://github.com/trac-hacks/trac-github/blob/master/tracext/github/__init__.py#L223-L224:

        req.session.setdefault('name', name or '')
        req.session.setdefault('email', email or '')

req.session is a python dict object, setdefault is documented at https://docs.python.org/3/library/stdtypes.html#dict.setdefault to only set the value if a value does not exist yet.

This behavior allows users to change their name on Trac to a different value than the one they use on GitHub, should they wish to do so. We do not have a flag that would indicate whether a name was set automatically or manually, so I'm not sure whether automatically updating the name from GitHub would be what our users expect.

Note: See TracTickets for help on using tickets.