Skip to content

feat: add weather provider and AviationWeather#795

Merged
mivek merged 2 commits intomainfrom
feat-metar-taf-providers
Apr 24, 2026
Merged

feat: add weather provider and AviationWeather#795
mivek merged 2 commits intomainfrom
feat-metar-taf-providers

Conversation

@mivek
Copy link
Copy Markdown
Owner

@mivek mivek commented Apr 23, 2026

No description provided.

@github-actions
Copy link
Copy Markdown

Please check on sonarcloud https://sonarcloud.io/project/pull_requests_list?id=io.github.mivek%3AmetarParser that the PR does not add any issue.

mivek and others added 2 commits April 23, 2026 21:58
…ther providers

Introduce a WeatherProvider interface and Strategy pattern to decouple
weather data fetching from the service layer, eliminating the NOAA
single point of failure.

- Add WeatherProvider interface with retrieveMetar() and retrieveTaf()
- Add AbstractWeatherProvider base class with shared HTTP utilities
  (checkIcao, buildRequest, getHttpResponse)
- Add NOAAWeatherProvider: moves existing NOAA fetching logic from
  AbstractWeatherCodeService and TAFService (including TAF reformatting)
- Add AviationWeatherProvider: new provider using
  https://aviationweather.gov/api/data endpoints; strips METAR/SPECI
  report-type prefixes for parser compatibility
- Refactor AbstractWeatherCodeService to accept a WeatherProvider
- Add MetarService.withProvider() and TAFService.withProvider() factory
  methods to create services with any provider
- Default singleton instances continue to use NOAAWeatherProvider
- Add integration tests for both providers verifying raw strings can
  be parsed end-to-end
- Add NOAAWeatherProviderTest with format() branch coverage tests
- Update CONTRIBUTING.md with instructions for adding a new provider

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add detailed section explaining:
- WeatherProvider interface and contract
- Built-in NOAA and AviationWeather providers
- AbstractWeatherProvider base class with shared HTTP utilities
- Factory methods withProvider() for custom provider instantiation
- Instructions for adding new providers
- Link to CONTRIBUTING.md for step-by-step guide

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mivek mivek force-pushed the feat-metar-taf-providers branch from d846898 to 119b585 Compare April 23, 2026 19:59
@sonarqubecloud
Copy link
Copy Markdown

@mivek mivek merged commit 2953f02 into main Apr 24, 2026
9 checks passed
@mivek mivek deleted the feat-metar-taf-providers branch April 24, 2026 06:28
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant