Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter depth and processed elements' tags #6917

Closed

Conversation

wordpressfan
Copy link
Contributor

@wordpressfan wordpressfan commented Aug 27, 2024

Description

Fixes #6904

Explain how this code impacts users.

This PR adds two filters:

  1. rocket_lazy_render_content_depth: returns integer value with default of 2 to adjust the depth.
  2. rocket_lazy_render_content_processed_tags: returns array value with default of:
[
	'DIV',
	'MAIN',
	'FOOTER',
	'SECTION',
	'ARTICLE',
	'HEADER',
]

To adjust the elements to be processed by this feature.

Type of change

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

Detailed scenario

As groomed and mentioned above.

Technical description

Documentation

We only added the filters as mentioned above

New dependencies

No

Risks

We shouldn't have any risk here, we just added the filter so the user can change those values, the only think that I can think of, is that the user can break the functionality by returning not valid elements from the tags filter or by decreasing the depth value.

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.

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.).

@wordpressfan wordpressfan self-assigned this Aug 27, 2024
@wordpressfan wordpressfan changed the base branch from develop to feature/lrc August 27, 2024 12:24
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 7999ed21 20.70% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7999ed2) Report Missing Report Missing Report Missing
Head commit (d734781) 37943 9516 25.08%

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 (#6917) 570 118 20.70%

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

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  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.

Copy link

codacy-production bot commented Aug 27, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.01% (target: -0.10%) 100.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d7a5719) 37925 16540 43.61%
Head commit (1599c45) 37917 (-8) 16532 (-8) 43.60% (-0.01%)

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 (#6917) 21 21 100.00%

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

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@wordpressfan wordpressfan marked this pull request as ready for review August 27, 2024 13:07
@wordpressfan wordpressfan requested a review from a team August 27, 2024 13:15
@MathieuLamiot
Copy link
Contributor

Closing this PR as it is merged in #6929 which will be merged in LRC branch already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.17 - Make depth and type of LRC candidates filterable
3 participants