gtristan commented on code in PR #87:
URL: 
https://github.com/apache/buildstream-plugins/pull/87#discussion_r2072881206


##########
src/buildstream_plugins/sources/docker.py:
##########
@@ -57,13 +57,44 @@
    #
    # **Since**: 2.0.1
 
+   # Specify the version to be reported as the *guess_version* when reporting
+   # SourceInfo
+   #
+   # Since: 2.5
+   #
+   version: 1.2
+
 Note that Docker images may contain device nodes. BuildStream elements cannot
 contain device nodes so those will be dropped. Any regular files in the /dev
 directory will also be dropped.
 
 See `built-in functionality doumentation
 
<https://docs.buildstream.build/master/buildstream.source.html#core-source-builtins>`_
 for
 details on common configuration options for sources.
+
+
+Reporting `SourceInfo 
<https://docs.buildstream.build/master/buildstream.source.html#buildstream.source.SourceInfo>`_
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The docker source reports the URL of the docker registry as the *url*.
+
+Further, the docker source reports the ``SourceInfoMedium.OCI_IMAGE`` *medium* 
and
+the ``SourceVersionType.DIGEST`` *version_type*, for which it reports the 
content
+digest of the docker image as the *version*.
+
+Additionally, the docker source reports the docker image name through
+the ``image-name`` key of the *extra_data*.
+
+As such, after removing the scheme from the URL (i.e. remove ``https://``) the 
same docker
+image can be obtained by calling:
+
+.. code:: bash
+
+   docker pull <url-without-scheme>/<image-name>@<version>

Review Comment:
   I'm very not on board with this, this is totally the usefulness of the 
`extra_data`; to disambiguate things which would otherwise be overloaded into 
the url or version.
   
   * The docker registry is a data store, *it* has a URL
   * The docker plugin itself communicates with that registry, using the https 
URL
   
   It is IMO much better to provide structured and meaningful data in the API, 
than to overload the URL string.
   



-- 
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]

Reply via email to