wp-rocket icon indicating copy to clipboard operation
wp-rocket copied to clipboard

Enhance SaaS requests enhancements

Open wordpressfan opened this issue 2 months ago • 2 comments

Description

This PR reverts some changes made to RUCSS job handling and also caters for 410 response code.

Type of change

  • [x] Enhancement (non-breaking change which improves an existing functionality).

Detailed scenario

What was tested

Automated test. Cater for jobs with 410 response code and fail instantly without retries.

How to test

Will need to mock the response to see this.

Technical description

Documentation

  • Moved back instant failing with make_status_failed in validate_and_fail method to JobProcessor
  • Cater for 410 response code by failing job instantly without retrying
  • Update default response code to 599

New dependencies

N/A

Risks

N/A

Mandatory Checklist

Code validation

  • [x] I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • [x] I triggered all changed lines of code at least once without new errors/warnings/notices.
  • [x] I implemented built-in tests to cover the new/changed code.

Code style

  • [x] I wrote a self-explanatory code about what it does.
  • [ ] I protected entry points against unexpected inputs.
  • [x] I did not introduce unnecessary complexity.
  • [ ] Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

Unticked items justification

Not applicable to the changes in this PR

Additional Checks

  • [ ] In the case of complex code, I wrote comments to explain it.
  • [ ] When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • [ ] I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

wordpressfan avatar Oct 09 '25 18:10 wordpressfan

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 8ee3f19832028bf4231696b8579c1b4f5cbd1daa[^1] :x: 36.36% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8ee3f19832028bf4231696b8579c1b4f5cbd1daa) Report Missing Report Missing Report Missing
Head commit (0885ad1fa982f7d87c7b6a7760fa3d59dacd72fa) 41436 18488 44.62%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#7795) 11 4 36.36%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

[^1]: Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

codacy-production[bot] avatar Oct 10 '25 17:10 codacy-production[bot]

Going to block this one until seeing what will happen with the SaaS with our last changes.

wordpressfan avatar Oct 15 '25 08:10 wordpressfan