gtristan commented on code in PR #1906:
URL: https://github.com/apache/buildstream/pull/1906#discussion_r1545449936
##########
src/buildstream/_project.py:
##########
@@ -220,6 +221,17 @@ def translate_url(self, url, *, first_pass=False):
url_alias, url_body = url.split(utils._ALIAS_SEPARATOR, 1)
alias_url = config._aliases.get_str(url_alias, default=None)
if alias_url:
+ if self.junction:
+ parent_project = self.junction._get_project()
+ parent_alias = self.junction.get_parent_alias(url_alias)
+ if parent_alias:
+ # Delegate translation to parent project
+ return parent_project.translate_url(
+ parent_alias + utils._ALIAS_SEPARATOR + url_body,
first_pass=first_pass
+ )
+ elif parent_project.disallow_subproject_uris:
Review Comment:
This logic looks backwards, is this an artifact of having changed
`allow_subproject_uris` to `disallow_subproject_uris` ?
It looks to me like we should instead have:
```python
if not disallow_subproject_uris and parent_alias:
return parent_project.translate_url(...)
```
Rather than delegating `translate_url()` to the parent project *before*
checking if that is allowed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]