Skip to content

Conversation

@RenderMichael
Copy link
Contributor

@RenderMichael RenderMichael commented Nov 23, 2025

User description

All references to framework pass in "nuget" as its first argument. We can simplify and self-document what the method means.

🔗 Related Issues

💥 What does this PR do?

🔧 Implementation Notes

💡 Additional Considerations

🔄 Types of changes

  • Cleanup (formatting, renaming)

PR Type

Other


Description

  • Rename framework() function to nuget_package() for clarity

  • Remove hardcoded "nuget" parameter from function signature

  • Update all call sites across dotnet build files

  • Delete old framework.bzl file and create new nuget_package.bzl


Diagram Walkthrough

flowchart LR
  A["framework.bzl<br/>framework(framework_moniker, name)"] -->|Refactor| B["nuget_package.bzl<br/>nuget_package(nuget_package)"]
  B -->|Update imports| C["defs.bzl"]
  C -->|Propagate changes| D["Multiple BUILD.bazel files"]
  D -->|Replace calls| E["nuget_package() calls"]
Loading

File Walkthrough

Relevant files
Refactoring
9 files
defs.bzl
Update imports from framework to nuget_package                     
+2/-2     
nunit_test.bzl
Replace framework calls with nuget_package calls                 
+2/-2     
BUILD.bazel
Update all NuGet package references to use nuget_package 
+15/-15 
BUILD.bazel
Replace framework function with nuget_package throughout 
+8/-8     
BUILD.bazel
Update NuGet package references in firefox tests                 
+2/-2     
BUILD.bazel
Replace framework calls with nuget_package in events tests
+4/-4     
BUILD.bazel
Update NuGet references in extensions test suite                 
+3/-3     
BUILD.bazel
Replace framework function with nuget_package in UI tests
+4/-4     
BUILD.bazel
Update devtools generator NuGet package references             
+6/-6     
Cleanup
1 files
framework.bzl
Delete deprecated framework function definition                   
+0/-2     
Enhancement
1 files
nuget_package.bzl
Create new nuget_package function with simplified signature
+2/-0     

@selenium-ci selenium-ci added C-dotnet .NET Bindings B-build Includes scripting, bazel and CI integrations B-devtools Includes everything BiDi or Chrome DevTools related B-support Issue or PR related to support classes labels Nov 23, 2025
@selenium-ci
Copy link
Member

Thank you, @RenderMichael for this code suggestion.

The support packages contain example code that many users find helpful, but they do not necessarily represent
the best practices for using Selenium, and the Selenium team is not currently merging changes to them.

After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium
to work, we will likely close the PR.

We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks.
If you have any questions, please contact us

@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Nov 23, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Dependency resolution risk

Description: Lowercasing the NuGet package name may cause mismatched package identifiers when package
IDs are case-sensitive in external systems, potentially resolving to the wrong artifact or
failing to fetch intended dependencies.
nuget_package.bzl [1-2]

Referred Code
def nuget_package(nuget_package):
    return "@paket.nuget//%s" % (nuget_package.lower())
Ticket Compliance
🟡
🎫 #1234
🔴 Investigate and fix regression where click() on an anchor with JavaScript in href no
longer triggers the script in Selenium 2.48.x (works in 2.47.1) on Firefox 42.0.
Provide verification that the alert is triggered as in 2.47.1 (e.g., tests or reproducible
case) on affected Firefox version.
🟡
🎫 #5678
🔴 Diagnose and resolve intermittent "Error: ConnectFailure (Connection refused)" when
instantiating multiple ChromeDriver instances on Ubuntu 16.04 with Selenium 3.9.0 and
Chrome/ChromeDriver specified.
Ensure stable repeated instantiation without connection errors; provide steps or fixes.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
No auditing: The changes refactor Bazel macros and dependency references without introducing or
affecting any runtime actions or logging, so there is no evidence of audit logging for
critical actions in the added code.

Referred Code
def nuget_package(nuget_package):
    return "@paket.nuget//%s" % (nuget_package.lower())

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
No error handling: The new macro simply formats a label from input without any validation or error handling,
which may be acceptable for Bazel macros but cannot be verified from the diff alone.

Referred Code
def nuget_package(nuget_package):
    return "@paket.nuget//%s" % (nuget_package.lower())

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status:
Unvalidated input: The macro accepts nuget_package and lowercases it to form a label without explicit
validation or sanitization, which may be sufficient in Bazel context but cannot be fully
assessed from the diff.

Referred Code
def nuget_package(nuget_package):
    return "@paket.nuget//%s" % (nuget_package.lower())

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-merge-pro
Copy link
Contributor

qodo-merge-pro bot commented Nov 23, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Rename parameter to avoid shadowing

Rename the nuget_package parameter to package_name within the nuget_package
function to avoid shadowing the function name.

dotnet/private/nuget_package.bzl [1-2]

-def nuget_package(nuget_package):
-    return "@paket.nuget//%s" % (nuget_package.lower())
+def nuget_package(package_name):
+    return "@paket.nuget//%s" % (package_name.lower())
  • Apply / Chat
Suggestion importance[1-10]: 4

__

Why: The suggestion correctly identifies that the function parameter nuget_package shadows the function's name, which is poor practice, and proposes a better name to improve code clarity.

Low
  • Update

@RenderMichael RenderMichael merged commit 292327f into SeleniumHQ:trunk Nov 23, 2025
10 checks passed
@RenderMichael RenderMichael deleted the dotnet-nuget-build branch November 23, 2025 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-build Includes scripting, bazel and CI integrations B-devtools Includes everything BiDi or Chrome DevTools related B-support Issue or PR related to support classes C-dotnet .NET Bindings Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants