[build] standardize generated-file license and not to edit markers across generators#17816
Conversation
|
Thank you, @titusfortner for this code suggestion. The support packages contain example code that many users find helpful, but they do not necessarily represent After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks. |
PR Summary by QodoStandardize generator headers and DO NOT EDIT markers from shared templates
AI Description
Diagram
High-Level Assessment
Files changed (55)
|
Code Review by Qodo
1.
|
|
Code review by qodo was updated up to the latest commit 8f485a7 |
There was a problem hiding this comment.
Pull request overview
Standardizes generated-file headers across the repo by centralizing the Apache 2.0 license body and a consistent “generated / DO NOT EDIT” marker, then updating multiple generators and update_copyright.py to consume the shared sources.
Changes:
- Centralized canonical license text and generated-file marker text into shared
scripts/*.txtsources, with thin helpers for Python/Ruby. - Updated multiple generators (Python, Ruby, Java, JavaScript) to emit consistent “generated by … / regenerate with …” markers, and regenerated affected Ruby BiDi outputs.
- Simplified/expanded
update_copyright.pypasses and exclusions (notablynode_modulesand.rbs.erbcoverage) and made it consume the shared license text.
Reviewed changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/update_copyright.py | Loads canonical license text from scripts/license_header.txt and updates JS exclusions / adds .rbs.erb pass. |
| scripts/pinned_browsers.py | Uses shared generated-note helper to stamp generated marker into produced output. |
| scripts/license_header.txt | Introduces single-source Apache 2.0 license body text. |
| scripts/generated_note.py | Adds Python helper to render the standardized two-line generated marker. |
| scripts/generated_note_template.txt | Adds shared template for generated marker text. |
| scripts/BUILD.bazel | Exports shared template/license files; adds py_library helper and wires data deps. |
| rb/support/generated_note.rb | Adds Ruby helper for rendering the standardized marker via Bazel runfiles. |
| rb/support/BUILD.bazel | Adds rb_library target for the Ruby generated-note helper. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/web_extension.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/storage.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/speculation.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/session.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/script.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/permissions.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/network.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/log.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/input.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/emulation.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/browsing_context.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/browser.rbs | Updates generated marker wording to standardized form. |
| rb/sig/lib/selenium/webdriver/bidi/protocol/bluetooth.rbs | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/BUILD.bazel | Wires shared template and Ruby helper into BiDi generator + checker. |
| rb/lib/selenium/webdriver/bidi/support/templates/module.rbs.erb | Replaces inline marker text with templated generated-note injection. |
| rb/lib/selenium/webdriver/bidi/support/templates/module.rb.erb | Replaces inline marker text with templated generated-note injection. |
| rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb | Uses Ruby helper to render standardized marker for generated files. |
| rb/lib/selenium/webdriver/bidi/protocol/web_extension.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/user_agent_client_hints.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/storage.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/speculation.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/session.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/script.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/permissions.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/network.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/log.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/input.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/emulation.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/browsing_context.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/browser.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/webdriver/bidi/protocol/bluetooth.rb | Updates generated marker wording to standardized form. |
| rb/lib/selenium/devtools/support/cdp/loader.rb.erb | Switches CDP generated marker to standardized helper output. |
| rb/lib/selenium/devtools/support/cdp/domain.rb.erb | Switches CDP generated marker to standardized helper output. |
| rb/lib/selenium/devtools/support/cdp_client_generator.rb | Adds Ruby helper method to supply standardized marker to templates. |
| rb/lib/selenium/devtools/BUILD.bazel | Wires shared template and Ruby helper into CDP generator. |
| py/generate_bidi.py | Switches Python BiDi generator headers to shared license + marker sources. |
| py/BUILD.bazel | Copies shared license locally for Python generator; depends on Python marker helper. |
| javascript/selenium-webdriver/lib/atoms/make-atoms-module.js | Prepends shared license + standardized generated marker to generated atoms module output. |
| javascript/selenium-webdriver/lib/atoms/BUILD.bazel | Copies shared license + marker template next to the JS generator script. |
| javascript/selenium-webdriver/generate_bidi.mjs | Switches JS BiDi generator headers to shared license + marker template read as runfiles siblings. |
| javascript/selenium-webdriver/BUILD.bazel | Copies shared license + marker template next to the BiDi generator script and wires into js_binary. |
| javascript/private/gen_file.py | Switches JS private generator to shared license body + standardized marker block comments. |
| javascript/private/BUILD.bazel | Copies shared license locally for the Python generator and wires Python marker helper dep. |
| java/src/org/openqa/selenium/devtools/CdpClientGenerator.java | Prepends a shared license + standardized marker header to generated Java sources using Runfiles. |
| java/src/org/openqa/selenium/devtools/BUILD.bazel | Adds shared template/license runfiles and Runfiles library dep for the Java generator. |
| common/repositories.bzl | Updates generated marker wording for pinned browsers output. |
Comments suppressed due to low confidence (1)
rb/support/generated_note.rb:43
- Grammar nit: "Delete this when update to ..." should be "Delete this when updating to ...".
8f485a7 to
f91e171
Compare
|
Code review by qodo was updated up to the latest commit f91e171 |
|
Code review by qodo was updated up to the latest commit 8577ad5 |
|
Code review by qodo was updated up to the latest commit 3dca601 |
🔗 Related Issues
N/A — cleanup/consistency initiative.
💥 What does this PR do?
This file is generated by <generator>. DO NOT EDIT!/Regenerate with: <command>marker.Any changes will be lost!,AUTO GENERATED, etc.), and the Java CDP generator emitted no marker at all.Regenerate with:is a concrete, copy-pasteable command in each generated file, not vague prose.update_copyright.pynow ensures the Apache header idempotently on every source file — including generated ones — instead of skipping them; its pass is a verified no-op against every generator's output.🔧 Implementation Notes
scripts/license_header.txtandscripts/generated_note_template.txt. Python and Ruby get thin helper libs (scripts/generated_note.py,rb/support/generated_note.rb); Java and JS format the shared template inline — each language reads the same files because none can import another's helper.copy_fileper Bazel package for Python/JS, theRunfilesAPI for Java, andBazel::Runfiles(the lib added in [rb] resolve spec runfiles via Bazel::Runfiles #17810) for Ruby — avoiding repo-root path arithmetic.RUBYLIB, sorequire 'bazel/runfiles'resolves in an rb_test but not in a generator (rb_binary).GeneratedNote.ensure_runfiles_on_load_pathcovers that until rules_ruby#374 ships in 0.28.0; on that upgrade the method, its single call, and the//rb/lib/bazel:runfilesdep are all deleted — verified by building against merged Nodes are not reading hub's configuration during re-registering #374 with all three removed.update_copyright.pyidempotent: its leading-comment scan stops there and never rewrites the marker. Verified against the build-only Python/JS/Java/Ruby generator output, not just the committed files.update_copyright.pycleanup: dropped the now-redundant generated-file skip, pruned stale exclusions (deletedselenium-core/jsunit/nodedirs), generalized node_modules to**/node_modules/**and applied it to the.ts/.tsxpasses, and added a*.rbs.erbpass..rb/.rbsfiles,repositories.bzlheader) is a separate commit from the tooling change.🤖 AI assistance
update_copyright.pychanges, regenerated output, and this description🔄 Types of changes