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

Allow the user to select the account from the SPI case to be used for the G5 calculations #232

Open
Dreamy-Jazz opened this issue Sep 15, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@Dreamy-Jazz
Copy link
Contributor

Currently the master of a case is the only account that can be used to determine what contributions are probably G5'able. However, it's possible for an account that is not the oldest account to have the earliest block in the case.

This is especially apparent when a new SPI case is created, and a checkuser finds an account that has an earlier block that may or may not be the oldest too. If it's the oldest the case can be moved, but otherwise a checkuser will only be able to use the block on the master which may be seconds old as the master may have been unblocked until said checkuser finished running the check.

Solutions:

  • The tool gets the block dates for all accounts that are not in archived cases, or if not API call heavy, all accounts in the archive too. It then chooses the account with the earliest block date and then uses that for the G5 calculation. The block dates should take into account that modifications to the block create a new block timestamp but do not reset the counter for the time blocked.
  • The tool should allow the user to select an account after generating a list of accounts and then once an account is selected performs the above but for one account.
@roysmith roysmith added the enhancement New feature or request label Sep 16, 2022
@roysmith
Copy link
Owner

This is turning out to be more complicated than I originally thought. I already have a Wiki.mutli_user_blocks() which should be a drop-in replacement for Wiki.user_blocks() in G5View. The problem is, it uses asyncio which isn't supported in the unittest.mock library from Python 3.7. There's an AsyncMock class which was added in Python 3.8 which I think is what I need.

Toolforge does support a python3.9 container. I've been meaning to upgrade to that for a while, for other reasons. So, this might be a good excuse to bite that bullet.

@roysmith
Copy link
Owner

Well, this became an adventure. I remember that I once tried to move to Python 3.9, and now I've been reminded of just how painful that is in Toolforge, at least for the workflow I've been using.

It turns out, there's a backport of AsyncMock so I installed that. It appeared to be working, but I was getting async_to_sync was passed a non-async-marked callable warnings which I didn't want to ignore. But then it turns out, those warnings are probably bogus after all.

So, I think I'm making progress :-)

@Dreamy-Jazz
Copy link
Contributor Author

Nice to hear progress is being made :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants