Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Override cache for web hook inflate #76

Merged

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Nov 19, 2018

Problem

If a mod author uploads a release to SpaceDock, then deletes it and re-uploads the same version with a changed file (usually because the first version had an error), the original version will remain in the Netkan bot's cache, and the metadata for that release will have an incorrect file size and hashes. Resolving this situation requires having @techman83 manually purge the files from the bot's cache.

Related pull request

KSP-CKAN/CKAN#2582 added a netkan.exe --overwrite-cache option. This will delete the cached file so it can be re-downloaded for indexing.

Changes

This pull request updates the Perl scripts to pass the --overwrite-cache parameter when inflating from the web hook. This should eliminate the need to manually purge files from the bot's cache.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 91.676% when pulling a3d609b on HebaruSan:feature/webhook-overwrite-cache into 4a2b258 on KSP-CKAN:master.

@politas
Copy link
Member

politas commented Nov 19, 2018

KSP-CKAN/CKAN#2582 is merged.

);
push @opts, '--github-token=' . $self->token if $self->token;
push @opts, '--overwrite-cache' if $self->overwrite;
return join(' ', $self->netkan, @opts, $self->file);
}
Copy link
Member

Choose a reason for hiding this comment

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

This is really neat, I like it.

$self->ckan_meta->reset(file => $file);
return 0;
}

if ( ! $self->_netkan_metadata->staging ) {
$self->info("Commiting $changed");
$self->info("Committing $changed");
$self->ckan_meta->commit(
Copy link
Member

Choose a reason for hiding this comment

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

Haha, thank you for the spelling fixes ☺️

@techman83 techman83 merged commit 3c735a6 into KSP-CKAN:master Nov 30, 2018
@techman83
Copy link
Member

@HebaruSan - SpaceDocks webhook service probably needs to be updated to point at the new domain. Also your webhook @NathanKell likely needs the same.

@HebaruSan HebaruSan deleted the feature/webhook-overwrite-cache branch November 30, 2018 07:37
@HebaruSan
Copy link
Member Author

Good point, opened KSP-SpaceDock/SpaceDock#192 to request that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants