Closed ryanwhowe closed 3 years ago
The results should be that 1/2 the calls required to perform a deployment have been removed, and ALL the calls that would have been required to run a unit test and CI run have been removed.
I will leave this ticket open to see if we still want to explore more options, I would be open to adding a second weather provider to allow for the weather API to be configurable or to have a fall over data source for when we run out of available requests to Accuweather, but that should be in a separate issue.
This appears to be resolved, it has been some time since I have run out of requests regardless of the work that was being performed
Is your feature request related to a problem? Please describe. The basic problem is that we are running out of weather api calls when performing testing and development on the project. The current Accuweather api limits the free api calls to 50 per day. Whenever developing or testing there are 2 calls that are made, the first is to the location service to get a location id for the town, then the second is to use that location id to request the weather. Between testing, development and production this call limit is quickly depleted on any day that development is being performed.
using the numbers above, if a development work is done, we use 3 calls to boot the local dev environment, 3 calls to run tests (assume only on run needed), once changes are made, a deployment will consume 6 additional calls. A single development task minimally will consume 12/50 (24%) of the available api calls. The minimal api calls that the statusboard requires to function throughout a day are 1 (daily location update) + 2 per hour forecast update or 21/50 (42%) of the available calls per 10 hour day. Leaving 29 api calls before there is no returned data.
Describe the solution you'd like The primary issue is to not run out of API calls throughout the day without having to limit any activity.
Describe alternatives you've considered With the Environment checks being made available in PR #69 there is the possibility to utilize a Guzzle Mock when in a testing environment which would reduce the utilization for a testing pipeline and local phpunit tests.
If possible use a different test structure to validate the api token vs validating the response of the internal API.
Moving caching outside the application could reduce the required api calls per deployment.
Getting a second api key would double the call volume, but is against the agreement.
Additional context Accuweather Api Guide Accuweather Api Best Practices