gtristan commented on code in PR #1997:
URL: https://github.com/apache/buildstream/pull/1997#discussion_r2041857031


##########
src/buildstream/source.py:
##########
@@ -262,10 +261,147 @@ def __init__(
 
 @dataclass
 class AliasSubstitution:
+    """AliasSubstitution()
+    An opaque data structure which may be passed through
+    :func:`SourceFetcher.fetch() <buildstream.source.SourceFetcher.fetch>` and 
in such cases
+    must be provided to :func:`Source.translate_url() 
<buildstream.source.Source.translate_url>`.
+    """
+
     _effective_alias: str
     _mirror: Union[SourceMirror, str]
 
 
+class SourceInfoMedium(FastEnum):
+    """
+    Indicates the medium in which the source is obtained
+
+    *Since: 2.5*
+    """
+
+    WORKSPACE = "workspace"
+    """
+    Files in an open workspace
+    """
+
+    LOCAL = "local"
+    """
+    Files stored locally in the project
+    """
+
+    REMOTE_FILE = "remote-file"
+    """
+    A remote file
+    """
+
+    GIT = "git"
+    """
+    A git repository
+    """
+
+
+class SourceVersionType(FastEnum):
+    """
+    Indicates the type of the version string
+
+    *Since: 2.5*
+    """
+
+    COMMIT = "commit"
+    """
+    A commit string which accurately represents a version in a source
+    code repository or VCS

Review Comment:
   > Should we comment something about git specifically? In particular, our 
plugins can use either the commit sha1, or a the long version of the git 
describe.
   > 
   > I think the current description fits both, which I think is a good thing. 
But maybe it's better to give an example.
   
   Interesting. I think that for the git plugins which do this, we can either 
include the whole git describe string or we can have the plugins parse out the 
commit sha only, while parsing out other things into the *guess_version*.
   
   I think that *if* the git describe string cannot be directly used in every 
way a commit sha can be used, it would be preferable to be more strict here and 
have the plugins parse out the pure commit sha from the ref and report that for 
the version of type `SourceVersionType.COMMIT`.
   



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