File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
readthedocs/vcs_support/backends Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -89,14 +89,26 @@ def get_remote_fetch_reference(self, identifier):
89
89
"""
90
90
Gets a valid remote reference for the identifier.
91
91
92
+ This method is terrible. It decides how to treat the incoming identifier from
93
+ knowledge of how the caller (the build process) uses build data.
94
+
95
+ Build.identifier = a branch name (branches)
96
+ Build.identifier = commit (tags)
97
+ Build.identifier = commit (external versions)
98
+ Build.verbose_name = branch alias, e.g. latest (branches)
99
+ Build.verbose_name = tag name (tags)
100
+ Build.verbose_name = PR number (external versions)
101
+
92
102
:param identifier: Should be a branch or tag name when building branches or tags.
93
103
:return: A reference valid for fetch operation
94
104
"""
95
- # Tags and branches have the tag/branch identifier set by the caller who instantiated the
96
- # Git backend -- this means that the build process needs to know this from build data,
97
- # essentially from an incoming webhook call.
98
- if self .version_type in (BRANCH , TAG ):
105
+ # Branches have the branch identifier set by the caller who instantiated the
106
+ # Git backend
107
+ if self .version_type == BRANCH :
99
108
return identifier
109
+ # Tags
110
+ if self .version_type == TAG :
111
+ return self .verbose_name
100
112
if self .version_type == EXTERNAL :
101
113
102
114
# TODO: We should be able to resolve this without looking up in oauth registry
You can’t perform that action at this time.
0 commit comments