Add paging and caching to github release query.#4187
Conversation
|
This seems like a lot of complexity to manage, things that could break, etc. Can we get away with simply using #4189 instead? If we want to run |
| """ | ||
| Success: WP-CLI is at the latest version. | ||
| """ | ||
| # This will hit github rate limiting on Travis as the latest 1.2.1 phar doesn't use the github_releases cache. |
There was a problem hiding this comment.
Is this meant to still be commented?
There was a problem hiding this comment.
(Using this solution yes as the 1.2.1 version will hit the rate limiting as it doesn't cache.)
|
Hi (was away for several days)
Yes, I agree - that's a much simpler solution.
I'll give that a try tomorrow (it wasn't/isn't clear to me that it works), so I'll close this PR. |
|
Using a token seems to work fine - see gitlost#13, running all jobs (actually I left out PHP 7.1 but that was a mistake), if slowly (a nice side-effect of using a cache now lost was speed). If you want to go ahead with this I can do a PR. If you want to it just in one job I suppose PHP 7.0 as the most "mainstream" currently? Also I created a personal token WP_CLI_GITHUB_TOKEN on my fork so I suppose you (or is there a "wp-cli" user?!) would be best to do that on this repo. |
|
Actually getting rate limiting errors on trying it today so either I'm doing it wrong or it doesn't work. |
Ok. We'll go ahead and punt again on this for now. If it becomes a pressing issue in the future, we can revisit it. |
|
Got a chance to properly debug it and quelle surprise I was doing it wrong - had the format wrong in Anyway after testing with the fixes it does work, so I think this PR is now a runner seeing as it no longer needs the "primed cache" hack. |
|
@gitlost I've added a |
|
Do you think the environment variable should be please? The current plan is to replace I've veered back to thinking that caching (and paging) should be done with or without a token. It respects what the |
It doesn't need to be included in
I don't really want to include caching at this point. It adds complexity to the build system, and therefore the likelihood of something later breaking. Maybe we should simply continue to skip these tests in CI. I suspect there are more important things for us to work on. |
Okay, so apply it to all jobs then?
In what way?
I think getting tests working fully and speedily on travis and locally, with as few exceptions as possible and with no extraneous errors, is a very important thing to be working on, and will improve all our lives! The slowness is a particular millstone, and having exceptions or errors is confusing and leads one to miss bugs. |
It's additional code executed, with additional execution paths, which increases the overall complexity of the system. Notably, caching is notorious for introducing issues that are only intermittently reproducible.
Right. Even within scope:testing, there are a number of issues that will yield higher impact. For instance, #4108 is arguably critical and much higher priority than this. I don't mean to discount your work on this. I appreciate the effort invested so far. I just mean to suggest there might be more fruitful investments of the limited amount of time you have. |
You could say that about anything!
I can't see that applying in this case - either the cache is there or it isn't. If it isn't it doesn't matter. If it is, it's checked and only then used. It's pretty fail-safe I hope (famous last words).
I'm sure there are! I wasn't claiming otherwise or making comparisons (which are always odious).
I'm sure it is! Alain's doing that though isn't he?
I'm sure you don't. I'm not emotionally attached to this PR. If you're set against it, I'll drop it. I just think it's the right thing to do. |
In looking back at #1612 to show you how much time I've spent on this already, I completely forgot I had written a cache implementation #1618 that I ended up reverting #1653. Really, I'm just trying to save you (and myself) from trodding this already trodden path and potentially experiencing a world of pain along the way. If this breaks again, we can seriously explore running the |
|
Cool. Consider it dropped! |
Issue #4186
Adds paging to
CLI_Command::get_updates()to get all releases and cache them asgithub_releases.Also uses the cache to get around github's rate limiting on Travis, which involved setting up a server to run a cron job to update the
github_releasesinto the publicly availablebehat-data:(
wp-cli-cli.pharis a "cli" build #4185 ofwp-cli. ) The scheme is to download the cachedgithub_releasesfrom the server and populate the local cache with it (not ideal as the paging isn't being tested on Travis).Also makes sure
FileCachehas all the SymfonyFinderclasses loaded it needs forclean()to avoid a strange PHP issue that can occur on trying to load them in aregister_shutdown_function.Also adds
Utils\strtotime_gmt()to make sure time calcs are in UTC.Also unrelatedly enables the
cli-info.featureto be run repeatedly (useful for local testing) by clearing the packages path using a newan empty xxx directorygiven andFeatureContext::remove_dir().