Repository navigation
Replace devto-api-go with inline HTTP client and add tests - #2126
Merged
Seanstoppable merged 1 commit intoJul 24, 2026
Merged
Seanstoppable merged 1 commit into
Seanstoppable merged 1 commit into
Conversation
Remove the archived github.com/VictorAvelar/devto-api-go dependency by implementing a small internal client (modules/devto/client.go) that calls the DEV.to public API directly with net/http + encoding/json. Changes: - Add injectable Client with FetchArticles() using httptest-friendly design - Extract formatArticleRow() as a testable pure function - Make URL opener injectable for side-effect-free testing - Add comprehensive test suite (98.7% coverage)
Seanstoppable
force-pushed
the
seanstoppable-inline-devto-api-and-add-tests
branch
from
July 23, 2026 02:57
b6c1889 to
812dda5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove the archived
github.com/VictorAvelar/devto-api-godependency by inlining the DEV.to API calls usingnet/http+encoding/json.Changes
modules/devto/client.go— NewClientstruct with injectable*http.Clientand base URL.FetchArticles()makes a GET to the DEV.to public API with tag/username/state/per_page query params.modules/devto/widget.go— Switched from the external library to the internal client. ExtractedformatArticleRow()as a pure function. Made URL opener injectable for testability.modules/devto/client_test.go— Tests fetch/parse, empty params, non-200 status, invalid JSON, connection errors.modules/devto/widget_test.go— Tests Refresh (success, error, disabled, truncation), content rendering, openStory edge cases, formatting.modules/devto/settings_test.go— Tests YAML config parsing with custom values and defaults.go.mod/go.sum— RemovedVictorAvelar/devto-api-goviago mod tidy.Coverage