Skip to content

Fix Python doc line ranges for BiDi network examples (#2639 follow-up)#2699

Merged
diemol merged 2 commits into
SeleniumHQ:trunkfrom
ajithrao2509:fix-python-bidi-doc-ranges
Jul 14, 2026
Merged

Fix Python doc line ranges for BiDi network examples (#2639 follow-up)#2699
diemol merged 2 commits into
SeleniumHQ:trunkfrom
ajithrao2509:fix-python-bidi-doc-ranges

Conversation

@ajithrao2509

Copy link
Copy Markdown
Contributor

(#2639 follow-up)

Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly

Description

The final commit in #2639 missed the documentation line-range updates, so the Python snippets on the live Network page are misaligned with the merged test file (for example, the Fail request snippet starts below its decorator and bleeds into the next test).
This corrects the gh-codeblock ranges in all four language pages (en, ja, pt-br, zh-cn).

It also updates the Fail request badge from 4.32 to 4.46, since request.fail() is a 4.46 API.

Motivation and Context

The live docs currently render misaligned Python snippets; follow-up to #2639.

Types of changes

  • "Change to the site - I have double-checked the Netlify deployment, and my changes look good".

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

@netlify

netlify Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploy Preview for selenium-dev ready!

Name Link
🔨 Latest commit a0802e8
🔍 Latest deploy log https://app.netlify.com/projects/selenium-dev/deploys/6a565bd41cd75200086016fa
😎 Deploy Preview https://deploy-preview-2699--selenium-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Fix Python BiDi Network docs snippet line ranges and correct Fail request badge

🐞 Bug fix 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Fix Python gh-codeblock line ranges so Network page snippets align with test code.
• Update the Python “Fail request” snippet badge to Selenium 4.46.
• Apply the same corrections across en/ja/pt-br/zh-cn Network docs.
Diagram

graph TD
  Docs["BiDi network docs (4 locales)"] --> Codeblock["gh-codeblock shortcode"] --> PyTest["Python BiDi tests"] --> Site["Rendered Network page"]
  Docs --> Badge["badge-version (Python tab)"] --> Site
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use snippet region markers instead of raw line ranges
  • ➕ Avoids future drift when test files gain/lose lines
  • ➕ More resilient to refactors and reformatting
  • ➖ Requires shortcode/tooling support to parse markers
  • ➖ Adds conventions to example code (region comments)
2. Maintain dedicated snippet files per example
  • ➕ Stable snippet boundaries and clearer docs ownership
  • ➕ No coupling to test line numbers
  • ➖ Risk of docs/examples diverging from tests
  • ➖ More files to maintain and keep in sync

Recommendation: For a follow-up fix, updating the gh-codeblock line ranges and the version badge is the best minimal change and directly resolves the live rendering issue. Longer-term, consider adding region-marker support (or dedicated snippet sources) to reduce recurring breakage from line-number drift.

Files changed (4) +20 / -20

Bug fix (4) +20 / -20
network.en.mdRealign Python snippet ranges and bump Fail request badge to 4.46 +5/-5

Realign Python snippet ranges and bump Fail request badge to 4.46

• Adjusts multiple Python gh-codeblock #Lx-Ly ranges to match the current test file structure so rendered snippets start/end correctly. Updates the Python Fail request badge-version from 4.32 to 4.46 to reflect when request.fail() became available.

website_and_docs/content/documentation/webdriver/bidi/w3c/network.en.md

network.ja.mdRealign Python snippet ranges and bump Fail request badge to 4.46 (JA) +5/-5

Realign Python snippet ranges and bump Fail request badge to 4.46 (JA)

• Updates Python gh-codeblock line ranges to prevent misrendered/misaligned snippets on the Japanese Network page. Also bumps the Fail request badge-version to 4.46 for API accuracy.

website_and_docs/content/documentation/webdriver/bidi/w3c/network.ja.md

network.pt-br.mdRealign Python snippet ranges and bump Fail request badge to 4.46 (PT-BR) +5/-5

Realign Python snippet ranges and bump Fail request badge to 4.46 (PT-BR)

• Updates Python gh-codeblock line ranges so the Portuguese (Brazil) Network docs embed the intended example code slices. Also corrects the Fail request badge-version to 4.46.

website_and_docs/content/documentation/webdriver/bidi/w3c/network.pt-br.md

network.zh-cn.mdRealign Python snippet ranges and bump Fail request badge to 4.46 (ZH-CN) +5/-5

Realign Python snippet ranges and bump Fail request badge to 4.46 (ZH-CN)

• Adjusts Python gh-codeblock line ranges to ensure snippets render cleanly on the Simplified Chinese Network page. Also updates the Fail request badge-version to 4.46.

website_and_docs/content/documentation/webdriver/bidi/w3c/network.zh-cn.md

@qodo-code-review

qodo-code-review Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@diemol
diemol merged commit d1fecf0 into SeleniumHQ:trunk Jul 14, 2026
6 checks passed
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit a0802e8

selenium-ci added a commit that referenced this pull request Jul 14, 2026
#2699)

Fix Python doc line ranges and badge for BiDi network examples (#2639 follow-up)

Co-authored-by: Diego Molina <diemol@users.noreply.github.com>

[deploy site] d1fecf0
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.

2 participants