Minor changes to url error messages [chromium/tools/depot_tools : main]

0 views
Skip to first unread message

Jordan Brown (Gerrit)

unread,
12:13 AM (4 hours ago) 12:13 AM
to LUCI CQ, Anne Redulla, chromium...@chromium.org, chops-source-team...@google.com
Attention needed from Anne Redulla

Jordan Brown added 7 comments

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Jordan Brown . resolved

After some further thought, I've decided to move this check upstream to the autorollers, but I'd still like to land the minor improvement to the url error message.

File metadata/fields/custom/url.py
Line 67, Patchset 5: f"Supported schemes: {sorted(list(_SUPPORTED_SCHEMES))}.")
Anne Redulla . resolved

Does the hardcoded set really need to be sorted?

Jordan Brown

Done

Line 70, Patchset 5: # They must provide the fqdn e.g rpc://project.googlesource.com/project.
Anne Redulla . resolved

(optional) Is this documented anywhere? Would be good to have the README.chromium template or `adding_to_third_party.md` doc reflect this.

Jordan Brown

I've removed the rpc component of this change in favour of fixing it upstream in the autorollers.

Line 71, Patchset 5: if u.scheme == "rpc" and "." not in u.netloc:
Anne Redulla . resolved

Do you have a reference for this? I'm wary about relying on the presence of a character to determine whether a URL is a FQDN.

Jordan Brown

I've removed the rpc component of this change in favour of fixing it upstream in the autorollers.

Line 101, Patchset 5:
Anne Redulla . resolved

nit: not a fan of `validation_errors` not actually being `ValidationError`s. Maybe `error_messages`?

Jordan Brown

Done

Line 102, Patchset 5: validation_errors = set(filter(lambda x: x, map(_url_error, urls)))
Anne Redulla . resolved

What's the point of the `lambda` here? And `map`?

I think you can replace this with `set(filter(_url_error, urls))`.

Jordan Brown

That would return the original values, this needs to return the mapped error values. I just rewrote it to use a for loop so it's clearer.

Line 106, Patchset 5: additional=sorted(
Anne Redulla . resolved

IIRC you should be able to pass a set into `sorted`.

Jordan Brown

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Anne Redulla
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/tools/depot_tools
Gerrit-Branch: main
Gerrit-Change-Id: Iabbc5165135518075ad94a688fecf94e31e1fbc2
Gerrit-Change-Number: 7619885
Gerrit-PatchSet: 8
Gerrit-Owner: Jordan Brown <r...@google.com>
Gerrit-Reviewer: Anne Redulla <ared...@google.com>
Gerrit-Reviewer: Jordan Brown <r...@google.com>
Gerrit-Attention: Anne Redulla <ared...@google.com>
Gerrit-Comment-Date: Mon, 02 Mar 2026 05:13:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anne Redulla <ared...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Anne Redulla (Gerrit)

unread,
12:31 AM (3 hours ago) 12:31 AM
to Jordan Brown, LUCI CQ, chromium...@chromium.org, chops-source-team...@google.com
Attention needed from Jordan Brown

Anne Redulla added 2 comments

File metadata/fields/custom/url.py
Line 30, Patchset 8 (Latest):_SUPPORTED_SCHEMES = [
Anne Redulla . unresolved

The main check is an `in`, which is O(1) for sets. Arguably this should actually be a `frozenset`. Why is it important for the schemes to be deterministic in the error message?

Line 57, Patchset 8 (Latest):def _url_error(url: str) -> Optional[str]:
Anne Redulla . unresolved

On more reflection, I think it's weird to name a function `_url_error`; later on, `_url_error(url)` reads like you are converting a url to an error. Strongly suggest to rename this to what the function aims to do.

Open in Gerrit

Related details

Attention is currently required from:
  • Jordan Brown
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/tools/depot_tools
    Gerrit-Branch: main
    Gerrit-Change-Id: Iabbc5165135518075ad94a688fecf94e31e1fbc2
    Gerrit-Change-Number: 7619885
    Gerrit-PatchSet: 8
    Gerrit-Owner: Jordan Brown <r...@google.com>
    Gerrit-Reviewer: Anne Redulla <ared...@google.com>
    Gerrit-Reviewer: Jordan Brown <r...@google.com>
    Gerrit-Attention: Jordan Brown <r...@google.com>
    Gerrit-Comment-Date: Mon, 02 Mar 2026 05:31:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages