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 recover-status-timestamps command #97

Merged
merged 2 commits into from
Nov 18, 2019

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Nov 17, 2019

Some mods have null timestamps, usually because they were only ever inflated by the legacy webhooks, which did not update the status file. This is inconvenient for changes that use these timestamps, such as #96.

Now a new recover-status-timestamps command is added that sets each null ModStatus.last_indexed to the timestamp of the newest commit in CKAN-meta for that module. This command is a one-off script and so it is not configured to run automatically; we would need to run it once on the server manually to backfill these timestamps.

@HebaruSan HebaruSan added Enhancement New feature or request Status It's about the inflation status (page or db) labels Nov 17, 2019
@DasSkelett
Copy link
Member

I'm not happy with "cluttering" the cli.py with one-offs. But tbh, I don't have an alternative in mind either.
Maybe this could benefit from #92? We could put it at least in a separate file then.

@HebaruSan
Copy link
Member Author

HebaruSan commented Nov 17, 2019

Agreed, but we do already have a one-off in there (the job that copied the old status.json to ModStatus), so I think it's sound in principle:

@click.command()
@click.argument('filename')
def restore_status(filename):
click.echo(
'To keep within free tier rate limits, this could take some time'
)
ModStatus.restore_status(filename)
click.echo('Done!')

One possible advantage of #92 here is that we could put normal commands and one-off commands in separate folders. netkan/netkan/cli vs netkan/netkan/cli/scripts e.g.

@techman83
Copy link
Member

techman83 commented Nov 18, 2019

One possible advantage of #92 here is that we could put normal commands and one-off commands in separate folders. netkan/netkan/cli vs netkan/netkan/cli/scripts e.g.

We could also use a different python entrypoint, say admin_cli.py

netkan_admin=netkan.admin_cli:admin

@techman83
Copy link
Member

LGTM, I'll merge this and give it a run. I've taken a sanity copy of the status dump just in case.

@techman83 techman83 merged commit 3f2ecc8 into KSP-CKAN:master Nov 18, 2019
@HebaruSan HebaruSan deleted the feature/backfill-last-indexed branch November 18, 2019 01:44
@HebaruSan HebaruSan added the Auto Freezer Finds idle mods and submits pull requests to freeze them label Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto Freezer Finds idle mods and submits pull requests to freeze them Enhancement New feature or request Status It's about the inflation status (page or db)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants