Skip to content

[workspace] Update ALIAS_REPOSITORIES to read dicts of aliases - #24916

Merged
SeanCurtis-TRI merged 1 commit into
RobotLocomotion:masterfrom
bobpaw:workspace-default-aliases-maps
Aug 26, 2026
Merged

[workspace] Update ALIAS_REPOSITORIES to read dicts of aliases#24916
SeanCurtis-TRI merged 1 commit into
RobotLocomotion:masterfrom
bobpaw:workspace-default-aliases-maps

Conversation

@bobpaw

@bobpaw bobpaw commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

The list of bazel repository aliases used to always be {name: actual}. Now that more will be maps, adjust the logic to support them naturally instead of as edge cases.

re: #24913 (review)


This change is Reviewable

@bobpaw

bobpaw commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

+a:@tyler-yankee

@bobpaw
bobpaw marked this pull request as draft August 25, 2026 18:27
@tyler-yankee tyler-yankee added the release notes: none This pull request should not be mentioned in the release notes label Aug 25, 2026

@tyler-yankee tyler-yankee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

holding off on review until the implementation is working...

@tyler-yankee reviewed 1 file and all commit messages, and made 2 comments.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee tyler-yankee, needs platform reviewer assigned, needs at least two assigned reviewers (waiting on bobpaw).


-- commits line 5 at r1:
nit the phrasing "Now that more" is slightly awkward to me. Consider e.g.:

The assumed `{name: actual}` mapping is inflexible as the number of packages
using this helper grows in the future.

@bobpaw
bobpaw force-pushed the workspace-default-aliases-maps branch from 459d13f to b8dba6c Compare August 25, 2026 21:52
@bobpaw
bobpaw marked this pull request as ready for review August 25, 2026 21:57

@tyler-yankee tyler-yankee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tyler-yankee reviewed 1 file and all commit messages, made 3 comments, and resolved 1 discussion.
Reviewable status: 3 unresolved discussions, LGTM missing from assignee tyler-yankee, needs platform reviewer assigned, needs at least two assigned reviewers (waiting on bobpaw).


tools/workspace/default.bzl line 184 at r2 (raw file):

    }

    for name in ALIAS_REPOSITORIES:

nit can we get away with for name, alias in ALIAS_REPOSITORIES.items() in Starlark?


tools/workspace/default.bzl line 185 at r2 (raw file):

    for name in ALIAS_REPOSITORIES:
        alias_root = "@drake//tools/workspace/"

nit I suppose we can define this outside the loop.


tools/workspace/default.bzl line 192 at r2 (raw file):

            aliases = {n: alias_root + a for n, a in alias.items()}
        else:
            aliases = {name: alias_root + name}

This is never taken, right? Can't weif str ... else assert dict ...?

Code quote:

        else:
            aliases = {name: alias_root + name}

@bobpaw

bobpaw commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

tools/workspace/default.bzl line 192 at r2 (raw file):

Previously, tyler-yankee (Tyler Yankee) wrote…

This is never taken, right? Can't weif str ... else assert dict ...?

Will do and I think starlark needs fail not assert

@bobpaw
bobpaw force-pushed the workspace-default-aliases-maps branch from b8dba6c to 2bb468a Compare August 25, 2026 22:35

@bobpaw bobpaw left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bobpaw made 1 comment and resolved 2 discussions.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee tyler-yankee, needs platform reviewer assigned, needs at least two assigned reviewers (waiting on tyler-yankee).


tools/workspace/default.bzl line 192 at r2 (raw file):

Previously, bobpaw (Aiden Woodruff) wrote…

Will do and I think starlark needs fail not assert

Done.

The assumed `{name: actual}` mapping is inflexible as the number of
packages using this helper grows in the future. Adjust the logic to
use str for single aliases or dict to map more values.

@tyler-yankee tyler-yankee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: feature

@tyler-yankee reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: needs platform reviewer assigned, needs at least two assigned reviewers (waiting on bobpaw).

@tyler-yankee tyler-yankee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+a:@SeanCurtis-TRI for platform review per schedule, please.

@tyler-yankee made 1 comment.
Reviewable status: LGTM missing from assignee SeanCurtis-TRI(platform) (waiting on SeanCurtis-TRI).

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:LGTM:

@SeanCurtis-TRI reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignees tyler-yankee,SeanCurtis-TRI(platform) (waiting on bobpaw).

@SeanCurtis-TRI
SeanCurtis-TRI merged commit c72e0af into RobotLocomotion:master Aug 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: none This pull request should not be mentioned in the release notes

Development

Successfully merging this pull request may close these issues.

3 participants