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

Check release date in AutoFreezer #175

Merged
merged 1 commit into from Jun 30, 2020

Conversation

HebaruSan
Copy link
Member

Problems

The AutoFreezer from #96 has itself been in cryofreeze due to mass-update changes:

It uses ModStatus.last_indexed to detect idle mods, so anytime we re-index a mod due to a change in how we generate metadata, we effectively fool the AutoFreezer into thinking that the mod was just updated. In reality we should be checking when the most recent release came out.

Background

After KSP-CKAN/CKAN#3059, we will be capturing mods' release dates in metadata. They will pass through the Indexer on their way to CKAN-meta.

Changes

  • Now Ckan parses release_date into a datetime object
  • Now ModStatus has a release_date property
  • Now the Indexer copies Ckan.release_date into ModStatus.release_date
  • Now the AutoFreezer's _too_old check looks at release_date if it's defined and falls back to last_indexed otherwise

This way we will be able to detect idle mods again.

@HebaruSan HebaruSan added Enhancement New feature or request Status It's about the inflation status (page or db) Indexer Receives inflated modules and adds them to CKAN-meta In Progress labels May 26, 2020
try:
dct[k] = dateutil.parser.isoparse(dct[k])
except:
pass
Copy link
Member

Choose a reason for hiding this comment

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

That's a pretty broad catch, probably ok here, but can lead to hiding errors we didn't expect.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's intentional. Don't want the whole thing to come to a screeching halt because there's some problem parsing a date string. If that happens, it'll just leave the string in the dict, which is fine.

Copy link
Member

@techman83 techman83 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@HebaruSan
Copy link
Member Author

HebaruSan commented May 27, 2020

Waiting on KSP-CKAN/CKAN#3059, which is waiting on KSP-SpaceDock/SpaceDock#265 to go live in production (currently merged to alpha).

EDIT: KSP-SpaceDock/SpaceDock#265 is live in beta, expected to go to prod soon-ish.

@HebaruSan HebaruSan force-pushed the feature/status-release-date branch from a388d93 to c0b3b23 Compare June 1, 2020 04:27
@HebaruSan
Copy link
Member Author

HebaruSan commented Jun 30, 2020

Those PRs are now merged, so we're about to have a big wave of release_date getting set. I want to watch how that goes before merging this.

... so far so good. Going to merge all the staged mods first.

@HebaruSan HebaruSan force-pushed the feature/status-release-date branch from c0b3b23 to 5546c12 Compare June 30, 2020 21:46
@HebaruSan HebaruSan merged commit db38ebe into KSP-CKAN:master Jun 30, 2020
@HebaruSan HebaruSan deleted the feature/status-release-date branch June 30, 2020 21:49
@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 In Progress Indexer Receives inflated modules and adds them to CKAN-meta Status It's about the inflation status (page or db)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants