Page MenuHomePhabricator

Replace JsonStringReader class with CI validation in fundraising-frontend-content
Open, Needs TriagePublic2 Estimated Story Points

Description

The purpose of the class [JsonStringReader](https://github.com/wmde/FundraisingFrontend/blob/master/src/Infrastructure/JsonStringReader.php) is to read JSON files from the i18n directory and return the raw JSON as a string, while internally validating it. This approach is wasteful, since it runs json_decode on every request that uses the files, immediately dropping the decoded result. This kind of check would be placed better in the CI for fundraising-frontend-content.

Acceptance Criteria

  • Add the check for validity and non-empty array/object structure to the drone tasks in fundraising-frontend-content
  • In FunFunFactory, replace calls to JsonStringReader::readAndValidateJson with (new SimpleFileFetcher())->fetchFile('filename') (Lines 649ff).

Implementation Notes

  • The drone task should create a GitHub issue if it fails.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
gabriel-wmde renamed this task from Replace JsonStringReader class with CI validation in FundraisingFrontend to Replace JsonStringReader class with CI validation in fundraising-frontend-content.Jun 1 2021, 10:03 AM
gabriel-wmde moved this task from Backlog to Ready for Estimation on the WMDE-Fundraising-CFR board.
kai.nissen set the point value for this task to 8.

I can't find a simple method of creating a Github Issue when the CI fails.

AbbanWMDE moved this task from Doing to Review on the WMDE-FUN-Sprint-2024-02-13 board.
AbbanWMDE subscribed.
kai.nissen changed the point value for this task from 8 to 2.Feb 27 2024, 10:58 AM