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 MaxMind database files to Git #177

Closed
wants to merge 1 commit into from
Closed

Add MaxMind database files to Git #177

wants to merge 1 commit into from

Conversation

blag
Copy link
Contributor

@blag blag commented Oct 17, 2023

Cache mmdb files in git to speed up CI tests

Description

Instead of constantly regenerating the MaxMind database fixtures in the GHA test workflow, just commit them and let pre-commit check if they need to be updated.

Generally speaking, it's not a great idea to commit binary files to Git, but I only expect these files to change very rarely (or never), and they are 2.7kB and 2.5kB, respectively. So I don't think this will be a big deal.

To double check that the MMDB files don't need to be updated, I added that as a pre-commit check. It uses make to avoid doing any work unless the Dockerfile or the Perl script have been touched.

It should be noted that even regenerating the mmdb files does change them, so reproducible builds aren't currently possible AFAIK.

Types of changes

  • Code improvement

Checklist:

  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Merging #177 (7d8e466) into master (eb315b2) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #177   +/-   ##
=======================================
  Coverage   97.67%   97.67%           
=======================================
  Files          17       17           
  Lines         689      689           
  Branches       56       56           
=======================================
  Hits          673      673           
  Misses         10       10           
  Partials        6        6           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@blag blag requested a review from WhyNotHugo November 1, 2023 03:26
@WhyNotHugo
Copy link
Member

Can't CI just cache the files without them being in the repository?

@blag
Copy link
Contributor Author

blag commented Jan 23, 2024

Yes, but only for 7 days. And given how infrequently this repository is updated, that means the cached files will never exist, and always be regenerated, which isn't any better than what we do now.

But, since this repository is so infrequently updated, I guess this only provides minor value as well.

Closing, since I've switched over to using django-qsessions instead anyway.

@blag blag closed this Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants