You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by "gtristan (via GitHub)" <gi...@apache.org> on 2023/08/20 08:46:44 UTC
[GitHub] [buildstream] gtristan opened a new pull request, #1862: source.py: Check for the availability of alias targets in preflight()
gtristan opened a new pull request, #1862:
URL: https://github.com/apache/buildstream/pull/1862
Fixes #1860
--
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: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] gtristan commented on a diff in pull request #1862: source.py: Check for the availability of alias targets in preflight()
Posted by "gtristan (via GitHub)" <gi...@apache.org>.
gtristan commented on code in PR #1862:
URL: https://github.com/apache/buildstream/pull/1862#discussion_r1299863028
##########
src/buildstream/source.py:
##########
@@ -308,6 +308,15 @@ def mark_download_url(self, url: str) -> None:
Args:
url: The url used to download.
+
+ .. note::
+
+ While this must be called in a SourceFetcher initializer for the URL which
Review Comment:
`SourceFetcher.mark_download_url()` must be called for download URLs and is **not** a replacement for the required call to `Source.mark_download_url()` at `Plugin.configure()` time.
The `git` plugin technically must call `Source.mark_download_url()` *"for any URL that is specified in the source configuration"*, i.e. not necessarily for URLs which it will discover later by virtue of having the git module present and discovering submodules.
Technically without calling this, BuildStream core is unable to validate aliases which are used in the URL configurations in the yaml (although this *reason* need not be communicated as the sole purpose in the contract).
And... so it does in fact: https://github.com/apache/buildstream-plugins/blob/master/src/buildstream_plugins/sources/git.py#L749
The `git` plugin does indeed call `SourceFetcher.mark_download_url()` from the `Source.get_source_fetchers()` method instead of in the individual `SourceFetcher` initializers... and I would agree that it does not make a difference, it is more important that it gets called before the `SourceFetcher` is handed over to the core.
--
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: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] abderrahim commented on a diff in pull request #1862: source.py: Check for the availability of alias targets in preflight()
Posted by "abderrahim (via GitHub)" <gi...@apache.org>.
abderrahim commented on code in PR #1862:
URL: https://github.com/apache/buildstream/pull/1862#discussion_r1299892723
##########
src/buildstream/source.py:
##########
@@ -308,6 +308,15 @@ def mark_download_url(self, url: str) -> None:
Args:
url: The url used to download.
+
+ .. note::
+
+ While this must be called in a SourceFetcher initializer for the URL which
Review Comment:
I might have gotten things mixed up, I'll try to have a deeper look this evening.
--
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: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] gtristan commented on a diff in pull request #1862: source.py: Check for the availability of alias targets in preflight()
Posted by "gtristan (via GitHub)" <gi...@apache.org>.
gtristan commented on code in PR #1862:
URL: https://github.com/apache/buildstream/pull/1862#discussion_r1299863028
##########
src/buildstream/source.py:
##########
@@ -308,6 +308,15 @@ def mark_download_url(self, url: str) -> None:
Args:
url: The url used to download.
+
+ .. note::
+
+ While this must be called in a SourceFetcher initializer for the URL which
Review Comment:
The `git` plugin technically *should* call `Source.mark_download_url()` *"for any URL that is specified in the source configuration"*, i.e. not necessarily for URLs which it will discover later by virtue of having the git module present and discovering submodules.
Technically without calling this, BuildStream core is unable to validate aliases which are used in the URL configurations in the yaml (although this *reason* need not be communicated as the sole purpose in the contract).
--
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: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] abderrahim commented on a diff in pull request #1862: source.py: Check for the availability of alias targets in preflight()
Posted by "abderrahim (via GitHub)" <gi...@apache.org>.
abderrahim commented on code in PR #1862:
URL: https://github.com/apache/buildstream/pull/1862#discussion_r1299809717
##########
src/buildstream/source.py:
##########
@@ -308,6 +308,15 @@ def mark_download_url(self, url: str) -> None:
Args:
url: The url used to download.
+
+ .. note::
+
+ While this must be called in a SourceFetcher initializer for the URL which
Review Comment:
Looks like this isn't consistently done. In buildstream-plugins, the `cargo` plugin does it but the `git` plugin doesn't. In bst-plugins-experimental, all plugins using source fetchers (`git_tag`, `git_repo` and `pypi`) do call it in the initializer.
I noticed however that the `git` plugin calls it from get_source_fetchers() instead, which is weird but probably gives the same end result?
--
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: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] gtristan commented on pull request #1862: source.py: Check for the availability of alias targets in preflight()
Posted by "gtristan (via GitHub)" <gi...@apache.org>.
gtristan commented on PR #1862:
URL: https://github.com/apache/buildstream/pull/1862#issuecomment-1685239558
Looks like there are issues with calling `Source.get_source_fetchers()` in preflight... might be better off raising a lazy error here rather than a preflight error...
--
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: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] gtristan commented on pull request #1862: source.py: Check for the availability of alias targets in preflight()
Posted by "gtristan (via GitHub)" <gi...@apache.org>.
gtristan commented on PR #1862:
URL: https://github.com/apache/buildstream/pull/1862#issuecomment-1685694097
> Looks like there are issues with calling `Source.get_source_fetchers()` in preflight... might be better off raising a lazy error here rather than a preflight error...
Tried a lazy failing approach, that works but still wasn't satisfied with this.
Came back and did the check now in `Source.mark_download_url()`, verifying the correctness of this in the Source API contract.
Added a comment to `SourceFetcher.mark_download_url()` to reinforce the already existing contract, which already specified
that *"This must be called for every URL in the configuration during `Plugin.configure()` if `Source.translate_url()` is not called."*
This existing contract already validates the correctness of this approach to policing the alias, however it helps to reinforce the statement in the `SourceFetcher` docs and avoid misguiding plugin authors into thinking that `SourceFetcher.mark_download_url()` is a *replacement* of calling `Source.mark_download_url()`
--
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: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [buildstream] gtristan merged pull request #1862: source.py: Check for the availability of alias targets in preflight()
Posted by "gtristan (via GitHub)" <gi...@apache.org>.
gtristan merged PR #1862:
URL: https://github.com/apache/buildstream/pull/1862
--
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: commits-unsubscribe@buildstream.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org